From 5ba6467d88383edcdb940949d98f6f212ad3739d Mon Sep 17 00:00:00 2001 Message-Id: <5ba6467d88383edcdb940949d98f6f212ad3739d@dist-git> From: Pavel Hrdina Date: Thu, 3 Oct 2019 15:41:44 -0400 Subject: [PATCH] devices: video: Simplify model hvm check From: Cole Robinson Signed-off-by: Cole Robinson (cherry picked from commit 651e5b6d753930a2e7536efa4e6d20f57b038e80) Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1753644 Signed-off-by: Pavel Hrdina --- virtinst/devices/video.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/virtinst/devices/video.py b/virtinst/devices/video.py index 3d8ab939..3ebc561f 100644 --- a/virtinst/devices/video.py +++ b/virtinst/devices/video.py @@ -27,6 +27,8 @@ class DeviceVideo(Device): @staticmethod def default_model(guest): + if not guest.os.is_hvm(): + return None if guest.os.is_pseries(): return "vga" if guest.os.is_arm_machvirt() or guest.os.is_riscv_virt(): @@ -37,11 +39,9 @@ class DeviceVideo(Device): if guest.has_gl(): return "virtio" return "qxl" - if guest.os.is_hvm(): - if guest.conn.is_qemu(): - return "qxl" - return "vga" - return None + if guest.conn.is_qemu(): + return "qxl" + return "vga" def set_defaults(self, guest): if not self.model: -- 2.23.0