devices: video: Simplify model hvm check

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2019-10-03 15:41:44 -04:00
parent 534f2e03d0
commit 651e5b6d75
1 changed files with 5 additions and 5 deletions

View File

@ -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: