diff options
| author | Jim Fehlig <jfehlig@suse.com> | 2012-07-30 21:10:19 -0600 |
|---|---|---|
| committer | Jim Fehlig <jfehlig@suse.com> | 2012-08-01 12:00:49 -0600 |
| commit | 6a8181e3c40d9b4f5eb644c2cad79fc7866ba767 (patch) | |
| tree | a11e19b97bff90a2a46da1ab1f6f7ab9372a4d6a | |
| parent | 3a5ea16bec06fceddfe06af343ee505cfc419a1b (diff) | |
| download | nova-6a8181e3c40d9b4f5eb644c2cad79fc7866ba767.tar.gz nova-6a8181e3c40d9b4f5eb644c2cad79fc7866ba767.tar.xz nova-6a8181e3c40d9b4f5eb644c2cad79fc7866ba767.zip | |
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
| -rw-r--r-- | nova/tests/test_libvirt.py | 9 | ||||
| -rw-r--r-- | nova/virt/libvirt/driver.py | 2 |
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 |
