From f7a1abff1fb496ee9c76c88143c5ed7d67c663ce Mon Sep 17 00:00:00 2001 From: Jim Fehlig Date: Mon, 30 Jul 2012 21:10:19 -0600 Subject: [PATCH] Don't pass kernel args to Xen HVM instances The refactoring in commit c0f67877 missed setting guest.os_root for Xen PV instances only. If set for Xen HVM instances, the xen tools will invoke qemu-dm with '-append root=/dev/xxx'. qemu-dm promptly failes with '-append only allowed with -kernel option'. Change-Id: Iba8054b728e28463fb221d44417b1ddba323f596 --- nova/tests/test_libvirt.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index 10ed64429..6040f2d51 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -1422,6 +1422,15 @@ class LibvirtConnTestCase(test.TestCase): check = (lambda t: t.find('./os/kernel'), None) check_list.append(check) + # Hypervisors that only support vm_mode.HVM should + # not produce configuration that results in kernel + # arguments + if not expect_kernel and hypervisor_type in ['qemu', 'kvm']: + check = (lambda t: t.find('./os/root'), None) + check_list.append(check) + check = (lambda t: t.find('./os/cmdline'), None) + check_list.append(check) + if expect_ramdisk: check = (lambda t: t.find('./os/initrd').text.split( '/')[1], 'ramdisk' + suffix)