diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index c837d02b61..c19d73f5cc 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -3685,6 +3685,9 @@ class LibvirtConnTestCase(test.NoDBTestCase, cfg = self._get_guest_config_with_graphics() + expect = {"ppc": "vga", "ppc64": "vga", + "ppc64le": "vga", "aarch64": "virtio"} + video_type = expect.get(blockinfo.libvirt_utils.get_arch({}), "qxl") self.assertEqual(len(cfg.devices), 8) self.assertIsInstance(cfg.devices[0], vconfig.LibvirtConfigGuestDisk) @@ -3706,7 +3709,7 @@ class LibvirtConnTestCase(test.NoDBTestCase, self.assertEqual(cfg.devices[4].target_name, "com.redhat.spice.0") self.assertEqual(cfg.devices[4].type, 'spicevmc') self.assertEqual(cfg.devices[5].type, "spice") - self.assertEqual(cfg.devices[6].type, "qxl") + self.assertEqual(cfg.devices[6].type, video_type) def test_get_guest_config_with_vnc_no_keymap(self): self.flags(virt_type='kvm', group='libvirt') diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index a46b6a69d9..637935b1fb 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -4342,7 +4342,8 @@ class LibvirtDriver(driver.ComputeDriver): allowed=ALLOWED_QEMU_SERIAL_PORTS, virt_type=virt_type) def _add_video_driver(self, guest, image_meta, flavor): - VALID_VIDEO_DEVICES = ("vga", "cirrus", "vmvga", "xen", "qxl") + VALID_VIDEO_DEVICES = ("vga", "cirrus", "vmvga", + "xen", "qxl", "virtio") video = vconfig.LibvirtConfigGuestVideo() # NOTE(ldbragst): The following logic sets the video.type # depending on supported defaults given the architecture, @@ -4360,6 +4361,10 @@ class LibvirtDriver(driver.ComputeDriver): # NOTE(ldbragst): PowerKVM doesn't support 'cirrus' be default # so use 'vga' instead when running on Power hardware. video.type = 'vga' + elif guestarch in (fields.Architecture.AARCH64): + # NOTE(kevinz): Only virtio device type is supported by AARCH64 + # so use 'virtio' instead when running on AArch64 hardware. + video.type = 'virtio' elif CONF.spice.enabled: video.type = 'qxl' if image_meta.properties.get('hw_video_model'):