diff --git a/virtinst/guest.py b/virtinst/guest.py index c9e9b0b39..4f3fcea8f 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -454,12 +454,9 @@ class Guest(XMLBuilder): self.set_capabilities_defaults() - if not self.os.machine: - capsinfo = self.lookup_capsinfo() - default = capsinfo.machines and capsinfo.machines[0] or None - self.os.machine = default - + self._set_default_machine() self._set_default_uefi() + self._add_default_graphics() self._add_default_video_device() self._add_default_input_device() @@ -487,6 +484,20 @@ class Guest(XMLBuilder): # Private xml routines # ######################## + def _set_default_machine(self): + if self.os.machine: + return + if (self.os.is_x86() and + self.conn.is_qemu() and + self.osinfo.supports_chipset_q35()): + self.os.machine = "q35" + return + + capsinfo = self.lookup_capsinfo() + default = capsinfo.machines and capsinfo.machines[0] or None + self.os.machine = default + + def _set_default_uefi(self): if (self.prefers_uefi() and not self.os.kernel and diff --git a/virtinst/osdict.py b/virtinst/osdict.py index 9b15dcab5..5ccb11640 100644 --- a/virtinst/osdict.py +++ b/virtinst/osdict.py @@ -363,6 +363,9 @@ class _OsVariant(object): # 2018-09-01: osinfo data is wrong for RHEL/centos here return self._is_related_to("rhel6.0") + def supports_chipset_q35(self): + return False + def get_recommended_resources(self, guest): ret = {} if not self._os: