diff options
| author | Yaguang Tang <yaguang.tang@canonical.com> | 2012-12-06 00:31:27 +0800 |
|---|---|---|
| committer | Yaguang Tang <yaguang.tang@canonical.com> | 2012-12-18 11:57:39 +0800 |
| commit | 3b8e122f7ddaa1382036f1f4d0c1f833f8d7deaa (patch) | |
| tree | 917166b8bbd0539ef1488934bc9e69fa3b79d4bc | |
| parent | 8749df777583f3c07e94ef277c7c93101e8bd541 (diff) | |
fix instance rescue without cmdline params in xml.rescue.
fix bug #1086780
Change-Id: I3495693b35dbde9c9da3d78208854b8ebc3f2a04
| -rw-r--r-- | nova/virt/libvirt/driver.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 263fd5ca4..7d7007957 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -1776,6 +1776,12 @@ class LibvirtDriver(driver.ComputeDriver): guest.os_kernel = os.path.join(CONF.instances_path, instance['name'], "kernel.rescue") + if CONF.libvirt_type == "xen": + guest.os_cmdline = "ro" + else: + guest.os_cmdline = ("root=%s console=ttyS0" % + (root_device_name or "/dev/vda",)) + if rescue.get('ramdisk_id'): guest.os_initrd = os.path.join(CONF.instances_path, instance['name'], @@ -1787,8 +1793,8 @@ class LibvirtDriver(driver.ComputeDriver): if CONF.libvirt_type == "xen": guest.os_cmdline = "ro" else: - guest.os_cmdline = "root=%s console=ttyS0" % ( - root_device_name or "/dev/vda",) + guest.os_cmdline = ("root=%s console=ttyS0" % + (root_device_name or "/dev/vda",)) if instance['ramdisk_id']: guest.os_initrd = os.path.join(CONF.instances_path, instance['name'], |
