From 7e2c5b9eee64c3a5b26fad6d5e58872032044d35 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Wed, 13 Aug 2008 14:24:36 +0000
Subject: [PATCH] Add --with-kvm-path configure option

This allows to configure a different path to the kvm binary. By default
/usr/bin/kvm is used, which is the one found in debian and ubuntu.

Reviewed-by: imsnah
---
 Makefile.am      |  1 +
 configure.ac     | 10 ++++++++++
 lib/constants.py |  2 ++
 3 files changed, 13 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 5c5c6b66f..ce7acacf2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -260,6 +260,7 @@ lib/_autoconf.py: Makefile stamp-directories
 	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
 	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
 	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
+	  echo "KVM_PATH = '$(KVM_PATH)'"; \
 	} > $@
 
 $(REPLACE_VARS_SED): Makefile stamp-directories
diff --git a/configure.ac b/configure.ac
index 58fcf71b4..a8d449972 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,6 +89,16 @@ AC_ARG_WITH([file-storage-dir],
   [file_storage_dir="/srv/ganeti/file-storage"])
 AC_SUBST(FILE_STORAGE_DIR, $file_storage_dir)
 
+# --with-kvm-path=...
+AC_ARG_WITH([kvm-path],
+  [AS_HELP_STRING([--with-kvm-path=PATH],
+    [absolute path to the kvm binary]
+    [ (default is /usr/bin/kvm)]
+  )],
+  [kvm_path="$withval"],
+  [kvm_path="/usr/bin/kvm"])
+AC_SUBST(KVM_PATH, $kvm_path)
+
 # Check common programs
 AC_PROG_INSTALL
 AC_PROG_LN_S
diff --git a/lib/constants.py b/lib/constants.py
index eb3275abc..6f5865b64 100644
--- a/lib/constants.py
+++ b/lib/constants.py
@@ -126,6 +126,8 @@ EXPORT_CONF_FILE = "config.ini"
 XEN_KERNEL = _autoconf.XEN_KERNEL
 XEN_INITRD = _autoconf.XEN_INITRD
 
+KVM_PATH = _autoconf.KVM_PATH
+
 VALUE_DEFAULT = "default"
 VALUE_NONE = "none"
 
-- 
GitLab