From 5140773133659d9c38e3eb03df4fd95a7ac948c4 Mon Sep 17 00:00:00 2001 From: Yufang Zhang Date: Tue, 4 Dec 2012 20:20:11 +0800 Subject: [PATCH] libvirt: enable apic setting for Xen or KVM guest. Bug 1086352 Currently, nova doesn't enable apic setting for Xen or KVM guest in its libvirt driver. Windows guests would not boot successful in such case. This patch adds apic setting in libvirt driver for Xen or KVM guest, which would fix this problem. A check is also added to libvirt guest config test case for this patch. Change-Id: Ie213c9d086f77faf0cdc5a32337c5bf4b828cf5f --- nova/tests/test_libvirt.py | 1 + nova/tests/test_libvirt_config.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index 5c90ebcd..bf7e187b 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -652,6 +652,7 @@ class LibvirtConnTestCase(test.TestCase): _fake_network_info(self.stubs, 1), None, None) self.assertEquals(cfg.acpi, True) + self.assertEquals(cfg.apic, True) self.assertEquals(cfg.memory, 1024 * 1024 * 2) self.assertEquals(cfg.vcpus, 1) self.assertEquals(cfg.os_type, vm_mode.HVM) diff --git a/nova/tests/test_libvirt_config.py b/nova/tests/test_libvirt_config.py index c285d46c..88719960 100644 --- a/nova/tests/test_libvirt_config.py +++ b/nova/tests/test_libvirt_config.py @@ -632,6 +632,8 @@ class LibvirtConfigGuestTest(LibvirtConfigBaseTest): obj.os_loader = '/usr/lib/xen/boot/hvmloader' obj.os_root = "root=xvda" obj.os_cmdline = "console=xvc0" + obj.acpi = True + obj.apic = True disk = config.LibvirtConfigGuestDisk() disk.source_type = "file" @@ -654,6 +656,10 @@ class LibvirtConfigGuestTest(LibvirtConfigBaseTest): console=xvc0 root=xvda + + + + @@ -671,6 +677,8 @@ class LibvirtConfigGuestTest(LibvirtConfigBaseTest): obj.uuid = "b38a3f43-4be2-4046-897f-b67c2f5e0147" obj.os_type = "linux" obj.os_boot_dev = "hd" + obj.acpi = True + obj.apic = True disk = config.LibvirtConfigGuestDisk() disk.source_type = "file" @@ -691,6 +699,10 @@ class LibvirtConfigGuestTest(LibvirtConfigBaseTest): linux + + + +