diff options
| author | Yufang Zhang <yufang521247@gmail.com> | 2012-12-04 20:20:11 +0800 |
|---|---|---|
| committer | Yufang Zhang <yufang521247@gmail.com> | 2012-12-10 16:58:42 +0800 |
| commit | d0e930bd9f1bddf6223635fdc463b2176cc39690 (patch) | |
| tree | 87f71fc16780d39cf27917b1d9084d644658b390 /nova/virt | |
| parent | ca1a2566d33aad15de640bf60630330aceb0ef2c (diff) | |
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
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/libvirt/config.py | 8 | ||||
| -rw-r--r-- | nova/virt/libvirt/driver.py | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/nova/virt/libvirt/config.py b/nova/virt/libvirt/config.py index 58d065d21..69864645c 100644 --- a/nova/virt/libvirt/config.py +++ b/nova/virt/libvirt/config.py @@ -587,6 +587,7 @@ class LibvirtConfigGuest(LibvirtConfigObject): self.vcpus = 1 self.cpu = None self.acpi = False + self.apic = False self.clock = None self.os_type = None self.os_loader = None @@ -624,9 +625,12 @@ class LibvirtConfigGuest(LibvirtConfigObject): root.append(os) def _format_features(self, root): - if self.acpi: + if self.acpi or self.apic: features = etree.Element("features") - features.append(etree.Element("acpi")) + if self.acpi: + features.append(etree.Element("acpi")) + if self.apic: + features.append(etree.Element("apic")) root.append(features) def _format_devices(self, root): diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 4d2408ff1..6e95b3728 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -1795,6 +1795,7 @@ class LibvirtDriver(driver.ComputeDriver): if CONF.libvirt_type != "lxc" and CONF.libvirt_type != "uml": guest.acpi = True + guest.apic = True clk = vconfig.LibvirtConfigGuestClock() clk.offset = "utc" |
