From b8203e1ee4e63032355b287e50527a5fdc91dbd5 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Fri, 23 Mar 2012 09:17:56 +0000
Subject: [PATCH] Update default instance kernel version
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We switch from vmlinuz-2.6-… to vmlinuz-3-…. To do this nicely, we
also add a ./configure-time setting for the KVM instance kernel.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 Makefile.am      |  1 +
 configure.ac     | 17 +++++++++++++----
 lib/constants.py |  3 ++-
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index f779eabb3..ad1b009b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1089,6 +1089,7 @@ lib/_autoconf.py: Makefile | lib/.dir
 	  echo "XEN_BOOTLOADER = '$(XEN_BOOTLOADER)'"; \
 	  echo "XEN_KERNEL = '$(XEN_KERNEL)'"; \
 	  echo "XEN_INITRD = '$(XEN_INITRD)'"; \
+	  echo "KVM_KERNEL = '$(KVM_KERNEL)'"; \
 	  echo "FILE_STORAGE_DIR = '$(FILE_STORAGE_DIR)'"; \
 	  echo "ENABLE_FILE_STORAGE = $(ENABLE_FILE_STORAGE)"; \
 	  echo "SHARED_FILE_STORAGE_DIR = '$(SHARED_FILE_STORAGE_DIR)'"; \
diff --git a/configure.ac b/configure.ac
index c836ea692..a679dd6d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,21 +83,30 @@ AC_SUBST(XEN_BOOTLOADER, $xen_bootloader)
 # --with-xen-kernel=...
 AC_ARG_WITH([xen-kernel],
   [AS_HELP_STRING([--with-xen-kernel=PATH],
-    [DomU kernel image for Xen hypervisor (default is /boot/vmlinuz-2.6-xenU)]
+    [DomU kernel image for Xen hypervisor (default is /boot/vmlinuz-3-xenU)]
   )],
   [xen_kernel="$withval"],
-  [xen_kernel="/boot/vmlinuz-2.6-xenU"])
+  [xen_kernel="/boot/vmlinuz-3-xenU"])
 AC_SUBST(XEN_KERNEL, $xen_kernel)
 
 # --with-xen-initrd=...
 AC_ARG_WITH([xen-initrd],
   [AS_HELP_STRING([--with-xen-initrd=PATH],
-    [DomU initrd image for Xen hypervisor (default is /boot/initrd-2.6-xenU)]
+    [DomU initrd image for Xen hypervisor (default is /boot/initrd-3-xenU)]
   )],
   [xen_initrd="$withval"],
-  [xen_initrd="/boot/initrd-2.6-xenU"])
+  [xen_initrd="/boot/initrd-3-xenU"])
 AC_SUBST(XEN_INITRD, $xen_initrd)
 
+# --with-kvm-kernel=...
+AC_ARG_WITH([kvm-kernel],
+  [AS_HELP_STRING([--with-kvm-kernel=PATH],
+    [Guest kernel image for KVM hypervisor (default is /boot/vmlinuz-3-kvmU)]
+  )],
+  [kvm_kernel="$withval"],
+  [kvm_kernel="/boot/vmlinuz-3-kvmU"])
+AC_SUBST(KVM_KERNEL, $kvm_kernel)
+
 # --with-file-storage-dir=...
 AC_ARG_WITH([file-storage-dir],
   [AS_HELP_STRING([--with-file-storage-dir=PATH],
diff --git a/lib/constants.py b/lib/constants.py
index 47d754881..28fc3d96e 100644
--- a/lib/constants.py
+++ b/lib/constants.py
@@ -280,6 +280,7 @@ XEN_INITRD = _autoconf.XEN_INITRD
 XEN_CMD = "xm"
 
 KVM_PATH = _autoconf.KVM_PATH
+KVM_KERNEL = _autoconf.KVM_KERNEL
 SOCAT_PATH = _autoconf.SOCAT_PATH
 SOCAT_USE_ESCAPE = _autoconf.SOCAT_USE_ESCAPE
 SOCAT_USE_COMPRESS = _autoconf.SOCAT_USE_COMPRESS
@@ -1758,7 +1759,7 @@ HVC_DEFAULTS = {
     HV_CPU_MASK: CPU_PINNING_ALL,
     },
   HT_KVM: {
-    HV_KERNEL_PATH: "/boot/vmlinuz-2.6-kvmU",
+    HV_KERNEL_PATH: KVM_KERNEL,
     HV_INITRD_PATH: "",
     HV_KERNEL_ARGS: "ro",
     HV_ROOT_PATH: "/dev/vda1",
-- 
GitLab