Browse Source

libvirt-xen: don't request features ACPI or APIC with PV guest.

Those are HVM features only.

Also, fix unit test.

Change-Id: I5f3630626c6bc908ee3456203ca38f3c57231782
changes/21/146621/4
Anthony PERARD 6 years ago
parent
commit
e4d4283119
2 changed files with 3 additions and 6 deletions
  1. +1
    -5
      nova/tests/unit/virt/libvirt/test_driver.py
  2. +2
    -1
      nova/virt/libvirt/driver.py

+ 1
- 5
nova/tests/unit/virt/libvirt/test_driver.py View File

@ -2564,13 +2564,9 @@ class LibvirtConnTestCase(test.NoDBTestCase):
cfg = drvr._get_guest_config(instance_ref, [], {}, disk_info)
self.assertEqual(cfg.os_type, vm_mode.XEN)
self.assertEqual(3, len(cfg.features))
self.assertEqual(1, len(cfg.features))
self.assertIsInstance(cfg.features[0],
vconfig.LibvirtConfigGuestFeaturePAE)
self.assertIsInstance(cfg.features[1],
vconfig.LibvirtConfigGuestFeatureACPI)
self.assertIsInstance(cfg.features[2],
vconfig.LibvirtConfigGuestFeatureAPIC)
@mock.patch.object(objects.Flavor, 'get_by_id')
def test_get_guest_config_with_vnc_and_spice(self, mock_flavor):


+ 2
- 1
nova/virt/libvirt/driver.py View File

@ -3627,7 +3627,8 @@ class LibvirtDriver(driver.ComputeDriver):
if caps.host.cpu.arch in (arch.I686, arch.X86_64):
guest.features.append(vconfig.LibvirtConfigGuestFeaturePAE())
if virt_type not in ("lxc", "uml", "parallels"):
if (virt_type not in ("lxc", "uml", "parallels", "xen") or
(virt_type == "xen" and guest.os_type == vm_mode.HVM)):
guest.features.append(vconfig.LibvirtConfigGuestFeatureACPI())
guest.features.append(vconfig.LibvirtConfigGuestFeatureAPIC())


Loading…
Cancel
Save