Skip to content

Commit cc59698

Browse files
committed
libvirt: Switch the default video model from 'cirrus' to 'virtio'
The current Nova default video device model of 'cirrus' was chosen by commit 2c7dca4 (Configuration element for describing video drivers, 2013-11-25). While it has worked fine-enough for all these years, Cirrus devices is is "considered harmful"[1] by QEMU graphics maintainers since 2014. The current recommended video device model for both UEFI and BIOS guests is 'virtio'[1]. 'virtio' is a sensible default whether or not the guest has a native kernel (called "virtio-gpu" in Linux) driver -- i.e. if the guest has the VirtIO GPU driver, then it'll be used; otherwise, the 'virtio' model falls back to VGA compatibiliy mode. To quote the documentation[2] from a QEMU graphics maintainer: This ['virtio' in libvirt or 'virtio-vga' in QEMU terms] is a modern, virtio-based display device designed for virtual machines. It comes with VGA compatibility mode. You need a guest driver to make full use of this device. If your guest OS has no driver it should still show a working display thanks to the VGA compatibility mode, but the device will not provide any advantages over standard VGA then. [...] This is the place where most development happens, support for new, cool features will most likely be added to this device. [1] "qemu: using cirrus considered harmful" https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/ [2] https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/#virtio-vga Implements: blueprint virtio-as-default-display-device Change-Id: I4c999bb4120768af40093ddb1e6004ee33c9698f Signed-off-by: Kashyap Chamarthy <[email protected]>
1 parent 5979c64 commit cc59698

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

nova/virt/libvirt/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ def __init__(self, **kwargs):
20552055
super(LibvirtConfigGuestVideo, self).__init__(root_name="video",
20562056
**kwargs)
20572057

2058-
self.type = 'cirrus'
2058+
self.type = 'virtio'
20592059
self.vram = None
20602060
self.heads = None
20612061
self.driver_iommu = False

nova/virt/libvirt/driver.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5920,6 +5920,15 @@ def _add_video_driver(self, guest, image_meta, flavor):
59205920
guestarch = libvirt_utils.get_arch(image_meta)
59215921
if CONF.libvirt.virt_type == 'parallels':
59225922
video.type = 'vga'
5923+
# NOTE(kchamart): 'virtio' is a sensible default whether or not
5924+
# the guest has the native kernel driver (called "virtio-gpu" in
5925+
# Linux) -- i.e. if the guest has the VirtIO GPU driver, it'll
5926+
# be used; otherwise, the 'virtio' model will gracefully
5927+
# fallback to VGA compatibiliy mode.
5928+
elif (guestarch in (fields.Architecture.I686,
5929+
fields.Architecture.X86_64) and not
5930+
CONF.spice.enabled):
5931+
video.type = 'virtio'
59235932
elif guestarch in (fields.Architecture.PPC,
59245933
fields.Architecture.PPC64,
59255934
fields.Architecture.PPC64LE):
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
features:
3+
- |
4+
From this release, Nova instances will get ``virtio`` as the default
5+
display device (instead of ``cirrus``, which has many limitations).
6+
If your guest has a native kernel (called "virtio-gpu" in Linux;
7+
available since Linux 4.4 and above) driver, then it'll be used;
8+
otherwise, the 'virtio' model will gracefully fallback to VGA
9+
compatibiliy mode, which is still better than ``cirrus``.

0 commit comments

Comments
 (0)