Merge "libvirt: pass log_path to _create_pty_device for non-kvm/qemu"

This commit is contained in:
Jenkins
2017-03-07 16:16:38 +00:00
committed by Gerrit Code Review
3 changed files with 18 additions and 3 deletions
+6 -2
View File
@@ -3804,13 +3804,14 @@ class LibvirtConnTestCase(test.NoDBTestCase):
drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True)
def _test_consoles(arch_to_mock, serial_enabled,
expected_device_type, expected_device_cls):
expected_device_type, expected_device_cls,
virt_type='qemu'):
guest_cfg = vconfig.LibvirtConfigGuest()
mock_get_arch.return_value = arch_to_mock
self.flags(enabled=serial_enabled, group='serial_console')
instance = objects.Instance(**self.test_instance)
drvr._create_consoles("qemu", guest_cfg, instance=instance,
drvr._create_consoles(virt_type, guest_cfg, instance=instance,
flavor=None, image_meta=None)
self.assertEqual(1, len(guest_cfg.devices))
@@ -3820,6 +3821,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
self.assertIsInstance(device.log,
vconfig.LibvirtConfigGuestCharDeviceLog)
self.assertEqual("off", device.log.append)
self.assertIsNotNone(device.log.file)
self.assertTrue(device.log.file.endswith("console.log"))
_test_consoles(fields.Architecture.X86_64, True,
@@ -3830,6 +3832,8 @@ class LibvirtConnTestCase(test.NoDBTestCase):
"tcp", vconfig.LibvirtConfigGuestConsole)
_test_consoles(fields.Architecture.S390X, False,
"pty", vconfig.LibvirtConfigGuestConsole)
_test_consoles(fields.Architecture.X86_64, False,
"pty", vconfig.LibvirtConfigGuestConsole, 'xen')
@mock.patch('nova.console.serial.acquire_port')
def test_get_guest_config_serial_console_through_port_rng_exhausted(
+3 -1
View File
@@ -4401,8 +4401,10 @@ class LibvirtDriver(driver.ComputeDriver):
if virt_type == 'parallels':
pass
elif virt_type not in ("qemu", "kvm"):
log_path = self._get_console_log_path(instance)
self._create_pty_device(guest_cfg,
vconfig.LibvirtConfigGuestConsole)
vconfig.LibvirtConfigGuestConsole,
log_path=log_path)
elif (virt_type in ("qemu", "kvm") and
self._is_s390x_guest(image_meta)):
self._create_consoles_s390x(guest_cfg, instance,
@@ -0,0 +1,9 @@
---
fixes:
- |
Fixes `bug 1670522`_ which was a regression in the 15.0.0 Ocata release.
For compute nodes running the libvirt driver with ``virt_type`` not set to
"kvm" or "qemu", i.e. "xen", creating servers will fail by default if
libvirt >= 1.3.3 and QEMU >= 2.7.0 without this fix.
.. _bug 1670522: https://bugs.launchpad.net/nova/+bug/1670522