mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-10 01:18:03 +03:00
osdict: Move default_videomodel to guest
It's not really osdict specific
This commit is contained in:
parent
717cd87b16
commit
b902fbd54f
@ -1209,16 +1209,26 @@ class Guest(XMLBuilder):
|
||||
return True
|
||||
return False
|
||||
|
||||
def _default_videomodel(self):
|
||||
if self.os.is_pseries():
|
||||
return "vga"
|
||||
if self.os.is_arm_machvirt():
|
||||
return "virtio"
|
||||
if self.has_spice() and self.os.is_x86():
|
||||
if self.has_gl():
|
||||
return "virtio"
|
||||
return "qxl"
|
||||
if self._os_object.is_windows():
|
||||
return "vga"
|
||||
return None
|
||||
|
||||
def _set_video_defaults(self):
|
||||
if self.has_spice():
|
||||
self._add_spice_channels()
|
||||
self._add_spice_sound()
|
||||
self._add_spice_usbredir()
|
||||
|
||||
video_model = self._os_object.default_videomodel(self)
|
||||
if self.os.is_arm_machvirt():
|
||||
video_model = "virtio"
|
||||
|
||||
video_model = self._default_videomodel()
|
||||
for video in self.devices.video:
|
||||
if video.model == video.MODEL_DEFAULT:
|
||||
video.model = video_model
|
||||
|
@ -361,21 +361,6 @@ class _OsVariant(object):
|
||||
def supports_virtiorng(self):
|
||||
return bool(self._device_filter(cls="rng", name="virtio-rng"))
|
||||
|
||||
def default_videomodel(self, guest):
|
||||
if guest.os.is_pseries():
|
||||
return "vga"
|
||||
|
||||
if guest.has_spice() and guest.os.is_x86():
|
||||
if guest.has_gl():
|
||||
return "virtio"
|
||||
else:
|
||||
return "qxl"
|
||||
|
||||
if self.is_windows():
|
||||
return "vga"
|
||||
|
||||
return None
|
||||
|
||||
def get_recommended_resources(self, guest):
|
||||
ret = {}
|
||||
if not self._os:
|
||||
|
Loading…
Reference in New Issue
Block a user