guest: Add USB3 controller for machvirt by default
...if libvirt is new enough to do machvirt PCI by default. We can just use usb3 since all guest OS that support aarch64 are new enough to support it
This commit is contained in:
parent
ae836304f9
commit
f2de47cee2
|
@ -28,6 +28,7 @@
|
|||
<target dev="sdb" bus="scsi"/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<controller type="scsi" index="0" model="virtio-scsi"/>
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
|
@ -64,6 +65,7 @@
|
|||
<target dev="sdb" bus="scsi"/>
|
||||
<readonly/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<controller type="scsi" index="0" model="virtio-scsi"/>
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<clock offset="utc"/>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
|
||||
<image compression="off"/>
|
||||
</graphics>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<controller type="scsi" index="0" model="virtio-scsi">
|
||||
<address type="pci"/>
|
||||
</controller>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<interface type="network">
|
||||
<source network="default"/>
|
||||
<mac address="00:11:22:33:44:55"/>
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="sda" bus="scsi"/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<controller type="scsi" index="0" model="virtio-scsi"/>
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="sda" bus="scsi"/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<controller type="scsi" index="0" model="virtio-scsi"/>
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="sda" bus="scsi"/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<controller type="scsi" index="0" model="virtio-scsi"/>
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="sda" bus="scsi"/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<controller type="scsi" index="0" model="virtio-scsi"/>
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="sda" bus="scsi"/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<controller type="scsi" index="0" model="virtio-scsi"/>
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<source file="/dev/default-pool/testvol1.img"/>
|
||||
<target dev="sda" bus="scsi"/>
|
||||
</disk>
|
||||
<controller type="usb" index="0" model="nec-xhci" ports="8"/>
|
||||
<controller type="scsi" index="0" model="virtio-scsi"/>
|
||||
<interface type="bridge">
|
||||
<source bridge="eth0"/>
|
||||
|
|
|
@ -81,6 +81,15 @@ class VirtualController(VirtualDevice):
|
|||
ret.append(ctrl)
|
||||
return ret
|
||||
|
||||
@staticmethod
|
||||
def get_usb3_controller(conn):
|
||||
ctrl = VirtualController(conn)
|
||||
ctrl.type = "usb"
|
||||
ctrl.model = "nec-xhci"
|
||||
if conn.check_support(conn.SUPPORT_CONN_USB3_PORTS):
|
||||
ctrl.ports = 8
|
||||
return ctrl
|
||||
|
||||
|
||||
_XML_PROP_ORDER = ["type", "index", "model", "master_startport"]
|
||||
|
||||
|
|
|
@ -653,15 +653,31 @@ class Guest(XMLBuilder):
|
|||
def add_default_usb_controller(self):
|
||||
if self.os.is_container():
|
||||
return
|
||||
if not self.os.is_x86():
|
||||
return
|
||||
if any([d.type == "usb" for d in self.get_devices("controller")]):
|
||||
return
|
||||
if not self.conn.check_support(
|
||||
self.conn.SUPPORT_CONN_DEFAULT_USB2):
|
||||
|
||||
usb2 = False
|
||||
usb3 = False
|
||||
if self.os.is_x86():
|
||||
usb2 = True
|
||||
elif (self.os.is_arm_machvirt() and
|
||||
self.conn.check_support(
|
||||
self.conn.SUPPORT_CONN_MACHVIRT_PCI_DEFAULT)):
|
||||
usb3 = True
|
||||
|
||||
|
||||
if not usb2 and not usb3:
|
||||
return
|
||||
for dev in VirtualController.get_usb2_controllers(self.conn):
|
||||
self.add_device(dev)
|
||||
|
||||
if usb2:
|
||||
if not self.conn.check_support(
|
||||
self.conn.SUPPORT_CONN_DEFAULT_USB2):
|
||||
return
|
||||
for dev in VirtualController.get_usb2_controllers(self.conn):
|
||||
self.add_device(dev)
|
||||
|
||||
if usb3:
|
||||
self.add_device(VirtualController.get_usb3_controller(self.conn))
|
||||
|
||||
def add_default_channels(self):
|
||||
if self.skip_default_channel:
|
||||
|
|
|
@ -321,6 +321,8 @@ SUPPORT_CONN_VIDEO_VIRTIO_ACCEL3D = _make(version="1.3.0",
|
|||
hv_version={"qemu": "2.5.0", "test": 0})
|
||||
SUPPORT_CONN_GRAPHICS_LISTEN_NONE = _make(version="2.0.0")
|
||||
SUPPORT_CONN_RNG_URANDOM = _make(version="1.3.4")
|
||||
SUPPORT_CONN_USB3_PORTS = _make(version="1.3.5")
|
||||
SUPPORT_CONN_MACHVIRT_PCI_DEFAULT = _make(version="3.0.0")
|
||||
|
||||
|
||||
# This is for disk <driver name=qemu>. xen supports this, but it's
|
||||
|
|
Loading…
Reference in New Issue