summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/tests/test_libvirt.py9
-rw-r--r--nova/virt/libvirt/driver.py2
2 files changed, 10 insertions, 1 deletions
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)
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index fa4fbc4c6..b8c39b3fa 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -1740,7 +1740,7 @@ class LibvirtDriver(driver.ComputeDriver):
guest.os_kernel = "/usr/bin/linux"
guest.os_root = root_device_name or "/dev/ubda"
else:
- if FLAGS.libvirt_type == "xen":
+ if FLAGS.libvirt_type == "xen" and guest.os_type == vm_mode.XEN:
guest.os_root = root_device_name or "/dev/xvda"
else:
guest.os_type = vm_mode.HVM