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
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
| @@ -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): | ||||
|                 <cmdline>console=xvc0</cmdline> | ||||
|                 <root>root=xvda</root> | ||||
|               </os> | ||||
|               <features> | ||||
|                 <acpi/> | ||||
|                 <apic/> | ||||
|               </features> | ||||
|               <devices> | ||||
|                 <disk type="file" device="disk"> | ||||
|                   <source file="/tmp/img"/> | ||||
| @@ -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): | ||||
|                 <type>linux</type> | ||||
|                 <boot dev="hd"/> | ||||
|               </os> | ||||
|               <features> | ||||
|                 <acpi/> | ||||
|                 <apic/> | ||||
|               </features> | ||||
|               <devices> | ||||
|                 <disk type="file" device="disk"> | ||||
|                   <source file="/tmp/img"/> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Yufang Zhang
					Yufang Zhang