Add video type virtio for AArch64

Currently only "virtio" type is supported on AArch64, and the
other "virrus", "qxl" and "vga" don't work on AArch64 according to
libvirt upstream:
https://www.redhat.com/archives/libvir-list/2016-September/msg00546.html
Then this patch adds the virtio for AArch64 and tweaks the related test cases.

Closes-bug: #1710766

Change-Id: Iba8a1e671f2b5759b3d9178aa1871d0cf888b26b
Signed-off-by: Kevin Zhao <kevin.zhao@arm.com>
This commit is contained in:
Kevin Zhao
2017-08-15 09:52:09 +00:00
parent c1de4c73b9
commit f0f09530ee
2 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -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')
+6 -1
View File
@@ -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'):