mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 21:18:04 +03:00
guest: Use q35 chipset by default for new qemu + supported OS
There's been various discussions about changing the x86 default from 'pc' to 'q35' over the years, but it's unlikely to happen at the qemu or libvirt level for compatibility reasons. So let's start using it for new enough OS that support it.
This commit is contained in:
parent
a00152d72a
commit
edab908f42
@ -10,7 +10,7 @@
|
||||
<currentMemory>65536</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
<kernel>/tmp/virtinst-vmlinuz.</kernel>
|
||||
<initrd>/tmp/virtinst-initrd.img.</initrd>
|
||||
<cmdline>console=ttyS0 method=tests/cli-test-xml/fakefedoratree</cmdline>
|
||||
@ -68,7 +68,7 @@
|
||||
<currentMemory>65536</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<currentMemory>65536</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
<boot dev="cdrom"/>
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
@ -41,19 +41,19 @@
|
||||
<disk type="file" device="disk">
|
||||
<driver name="qemu" type="qcow2"/>
|
||||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="hda" bus="ide"/>
|
||||
<target dev="sda" bus="sata"/>
|
||||
</disk>
|
||||
<disk type="file" device="cdrom">
|
||||
<driver name="qemu" type="qcow2"/>
|
||||
<source file="/dev/default-pool/testvol2.img"/>
|
||||
<target dev="hdb" bus="ide"/>
|
||||
<target dev="sdb" bus="sata"/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="qemu-xhci" ports="15"/>
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
<model type="e1000e"/>
|
||||
</interface>
|
||||
<console type="pty"/>
|
||||
<channel type="spicevmc">
|
||||
@ -63,7 +63,7 @@
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
<sound model="ich6"/>
|
||||
<sound model="ich9"/>
|
||||
<video>
|
||||
<model type="qxl"/>
|
||||
</video>
|
||||
@ -83,7 +83,7 @@
|
||||
<currentMemory>65536</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
@ -112,19 +112,19 @@
|
||||
<disk type="file" device="disk">
|
||||
<driver name="qemu" type="qcow2"/>
|
||||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="hda" bus="ide"/>
|
||||
<target dev="sda" bus="sata"/>
|
||||
</disk>
|
||||
<disk type="file" device="cdrom">
|
||||
<driver name="qemu" type="qcow2"/>
|
||||
<source file="/dev/default-pool/testvol2.img"/>
|
||||
<target dev="hdb" bus="ide"/>
|
||||
<target dev="sdb" bus="sata"/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="qemu-xhci" ports="15"/>
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
<model type="e1000e"/>
|
||||
</interface>
|
||||
<console type="pty"/>
|
||||
<channel type="spicevmc">
|
||||
@ -134,7 +134,7 @@
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
<sound model="ich6"/>
|
||||
<sound model="ich9"/>
|
||||
<video>
|
||||
<model type="qxl"/>
|
||||
</video>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<currentMemory>65536</currentMemory>
|
||||
<vcpu placement="static">4</vcpu>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
@ -313,9 +313,9 @@
|
||||
<image compression="off"/>
|
||||
<listen type="socket" socket="/tmp/foobar"/>
|
||||
</graphics>
|
||||
<sound model="ich6"/>
|
||||
<sound model="ich9"/>
|
||||
<sound model="ac97"/>
|
||||
<sound model="ich6">
|
||||
<sound model="ich9">
|
||||
<codec type="micro"/>
|
||||
<codec type="duplex"/>
|
||||
<codec type="output"/>
|
||||
|
@ -20,7 +20,7 @@
|
||||
<partition>/virtualmachines/production</partition>
|
||||
</resource>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
<loader readonly="yes" type="pflash">/usr/share/OVMF/OVMF_CODE.fd</loader>
|
||||
<boot dev="hd"/>
|
||||
<smbios mode="emulate"/>
|
||||
|
@ -66,7 +66,7 @@
|
||||
</sysinfo>
|
||||
<bootloader>/new/bootld</bootloader>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
<loader>/foo/bar</loader>
|
||||
<boot dev="network"/>
|
||||
<smbios mode="sysinfo"/>
|
||||
@ -252,7 +252,7 @@
|
||||
</sysinfo>
|
||||
<bootloader>/new/bootld</bootloader>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
<loader>/foo/bar</loader>
|
||||
<boot dev="cdrom"/>
|
||||
<boot dev="fd"/>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<currentMemory>1048576</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
<boot dev="hd"/>
|
||||
</os>
|
||||
<features>
|
||||
@ -49,7 +49,7 @@
|
||||
<gl enable="yes" rendernode="/dev/dri/by-path/pci-0000:00:02.0-render"/>
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
<sound model="ich6"/>
|
||||
<sound model="ich9"/>
|
||||
<video>
|
||||
<model type="virtio">
|
||||
<acceleration accel3d="yes"/>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<currentMemory>65536</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
<loader type="pflash">CODE.fd</loader>
|
||||
<nvram template="VARS.fd"/>
|
||||
<boot dev="cdrom"/>
|
||||
@ -37,12 +37,12 @@
|
||||
<disk type="file" device="disk">
|
||||
<driver name="qemu" type="qcow2"/>
|
||||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="hda" bus="ide"/>
|
||||
<target dev="sda" bus="sata"/>
|
||||
</disk>
|
||||
<disk type="file" device="cdrom">
|
||||
<driver name="qemu" type="qcow2"/>
|
||||
<source file="/dev/default-pool/testvol2.img"/>
|
||||
<target dev="hdb" bus="ide"/>
|
||||
<target dev="sdb" bus="sata"/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="ich9-ehci1"/>
|
||||
@ -58,7 +58,7 @@
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
<model type="e1000e"/>
|
||||
</interface>
|
||||
<console type="pty"/>
|
||||
<channel type="spicevmc">
|
||||
@ -68,7 +68,7 @@
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
<sound model="ich6"/>
|
||||
<sound model="ich9"/>
|
||||
<video>
|
||||
<model type="qxl"/>
|
||||
</video>
|
||||
@ -88,7 +88,7 @@
|
||||
<currentMemory>65536</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os>
|
||||
<type arch="x86_64" machine="pc">hvm</type>
|
||||
<type arch="x86_64" machine="q35">hvm</type>
|
||||
<loader type="pflash">CODE.fd</loader>
|
||||
<nvram template="VARS.fd"/>
|
||||
<boot dev="hd"/>
|
||||
@ -113,12 +113,12 @@
|
||||
<disk type="file" device="disk">
|
||||
<driver name="qemu" type="qcow2"/>
|
||||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="hda" bus="ide"/>
|
||||
<target dev="sda" bus="sata"/>
|
||||
</disk>
|
||||
<disk type="file" device="cdrom">
|
||||
<driver name="qemu" type="qcow2"/>
|
||||
<source file="/dev/default-pool/testvol2.img"/>
|
||||
<target dev="hdb" bus="ide"/>
|
||||
<target dev="sdb" bus="sata"/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="ich9-ehci1"/>
|
||||
@ -134,7 +134,7 @@
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
<model type="e1000"/>
|
||||
<model type="e1000e"/>
|
||||
</interface>
|
||||
<console type="pty"/>
|
||||
<channel type="spicevmc">
|
||||
@ -144,7 +144,7 @@
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
<sound model="ich6"/>
|
||||
<sound model="ich9"/>
|
||||
<video>
|
||||
<model type="qxl"/>
|
||||
</video>
|
||||
|
@ -734,7 +734,7 @@ c.add_compare("--disk %(EXISTIMG1)s --pxe --os-variant rhel7.0", "kvm-rhel7", sk
|
||||
c.add_compare("--connect " + utils.URIs.kvm_nodomcaps + " --disk %(EXISTIMG1)s --pxe --os-variant rhel7.0", "kvm-cpu-default-fallback", skip_check=OLD_OSINFO) # No domcaps, so mode=host-model isn't safe, so we fallback to host-model-only
|
||||
c.add_compare("--disk %(EXISTIMG1)s --pxe --os-variant centos7.0", "kvm-centos7", skip_check=OLD_OSINFO) # Centos 7 defaults
|
||||
c.add_compare("--disk %(EXISTIMG1)s --cdrom %(EXISTIMG2)s --os-variant win10", "kvm-win10", skip_check=OLD_OSINFO) # win10 defaults
|
||||
c.add_compare("--os-variant win7 --cdrom %(EXISTIMG2)s --boot loader_type=pflash,loader=CODE.fd,nvram_template=VARS.fd --disk %(EXISTIMG1)s", "win7-uefi") # no HYPER-V with UEFI
|
||||
c.add_compare("--os-variant win7 --cdrom %(EXISTIMG2)s --boot loader_type=pflash,loader=CODE.fd,nvram_template=VARS.fd --disk %(EXISTIMG1)s", "win7-uefi", skip_check=OLD_OSINFO) # no HYPER-V with UEFI
|
||||
c.add_compare("--arch i686 --boot uefi --pxe --disk none", "kvm-i686-uefi") # i686 uefi
|
||||
c.add_compare("--machine q35 --cdrom %(EXISTIMG2)s --disk %(EXISTIMG1)s", "q35-defaults") # proper q35 disk defaults
|
||||
c.add_compare("--disk size=20 --os-variant solaris10", "solaris10-defaults") # test solaris OS defaults, triggers a couple specific code paths
|
||||
|
@ -32,10 +32,10 @@ clistate = _CLIState()
|
||||
def has_old_osinfo():
|
||||
# Some tests rely on newer osinfo data. Check for a new condition
|
||||
# here, and older tests will be skipped
|
||||
osname = "rhel7.0"
|
||||
osname = "win7"
|
||||
if not virtinst.OSDB.lookup_os(osname):
|
||||
return True
|
||||
return not virtinst.OSDB.lookup_os(osname).supports_usb3()
|
||||
return not virtinst.OSDB.lookup_os(osname).supports_chipset_q35()
|
||||
|
||||
|
||||
class _URIs(object):
|
||||
|
@ -511,13 +511,17 @@ class Guest(XMLBuilder):
|
||||
def _set_default_machine(self):
|
||||
if self.os.machine:
|
||||
return
|
||||
|
||||
capsinfo = self.lookup_capsinfo()
|
||||
|
||||
if (self.os.is_x86() and
|
||||
self.conn.is_qemu() and
|
||||
"q35" in capsinfo.machines and
|
||||
self.conn.check_support(self.conn.SUPPORT_QEMU_Q35_DEFAULT) 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
|
||||
|
||||
|
@ -411,8 +411,17 @@ class _OsVariant(object):
|
||||
devids = ["http://pcisig.com/pci/1b36/0004"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
|
||||
def supports_virtio1(self):
|
||||
# Use virtio1.0-net device as a proxy for virtio1.0 as a whole
|
||||
devids = ["http://pcisig.com/pci/1af4/1041"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
|
||||
def supports_chipset_q35(self):
|
||||
return False
|
||||
# For our purposes, check for the union of q35 + virtio1.0 support
|
||||
if self.supports_virtionet() and not self.supports_virtio1():
|
||||
return False
|
||||
devids = ["http://qemu.org/chipset/x86/q35"]
|
||||
return bool(self._device_filter(devids=devids))
|
||||
|
||||
def get_recommended_resources(self, guest):
|
||||
ret = {}
|
||||
|
@ -268,6 +268,10 @@ SUPPORT_CONN_MACHVIRT_PCI_DEFAULT = _make(version="3.0.0")
|
||||
SUPPORT_CONN_QEMU_XHCI = _make(version="3.3.0", hv_version={"qemu": "2.9.0"})
|
||||
SUPPORT_CONN_VNC_NONE_AUTH = _make(hv_version={"qemu": "2.9.0"})
|
||||
|
||||
# We choose qemu 2.11.0 as the first version to target for q35 default.
|
||||
# That's not really based on anything except reasonably modern at the
|
||||
# time of these patches.
|
||||
SUPPORT_QEMU_Q35_DEFAULT = _make(hv_version={"qemu": "2.11.0", "test": "0"})
|
||||
|
||||
# This is for disk <driver name=qemu>. xen supports this, but it's
|
||||
# limited to arbitrary new enough xen, since I know libxl can handle it
|
||||
|
Loading…
Reference in New Issue
Block a user