mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemu_capabilities: Do not report USB as subsystem type if it is not available
libvirt currently always reports that USB is available as a bus subsystem type when running "virsh domcapabilities". However, this is not always true, for example the qemu-system-s390x binary normally never has support for USB. Thus we should only report that USB is available if there is also a USB host controller available where we can attach USB devices. Reported-by: Sebastian Mitterle <smitterl@redhat.com> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1759849 Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
177fbcdfaa
commit
bfd5f69d60
@ -5674,10 +5674,21 @@ virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps,
|
||||
VIR_DOMAIN_STARTUP_POLICY_OPTIONAL);
|
||||
|
||||
VIR_DOMAIN_CAPS_ENUM_SET(hostdev->subsysType,
|
||||
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB,
|
||||
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI,
|
||||
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI);
|
||||
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI) ||
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_PIIX4_USB_UHCI) ||
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_EHCI) ||
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_USB_EHCI1) ||
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_VT82C686B_USB_UHCI) ||
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI) ||
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI) ||
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) {
|
||||
VIR_DOMAIN_CAPS_ENUM_SET(hostdev->subsysType,
|
||||
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB);
|
||||
}
|
||||
|
||||
/* No virDomainHostdevCapsType for QEMU */
|
||||
virDomainCapsEnumClear(&hostdev->capsType);
|
||||
|
||||
|
@ -168,7 +168,6 @@
|
||||
<value>optional</value>
|
||||
</enum>
|
||||
<enum name='subsysType'>
|
||||
<value>usb</value>
|
||||
<value>pci</value>
|
||||
<value>scsi</value>
|
||||
</enum>
|
||||
|
@ -167,7 +167,6 @@
|
||||
<value>optional</value>
|
||||
</enum>
|
||||
<enum name='subsysType'>
|
||||
<value>usb</value>
|
||||
<value>pci</value>
|
||||
<value>scsi</value>
|
||||
</enum>
|
||||
|
@ -166,7 +166,6 @@
|
||||
<value>optional</value>
|
||||
</enum>
|
||||
<enum name='subsysType'>
|
||||
<value>usb</value>
|
||||
<value>pci</value>
|
||||
<value>scsi</value>
|
||||
</enum>
|
||||
|
@ -71,7 +71,6 @@
|
||||
<value>optional</value>
|
||||
</enum>
|
||||
<enum name='subsysType'>
|
||||
<value>usb</value>
|
||||
<value>pci</value>
|
||||
<value>scsi</value>
|
||||
</enum>
|
||||
|
@ -152,7 +152,6 @@
|
||||
<value>optional</value>
|
||||
</enum>
|
||||
<enum name='subsysType'>
|
||||
<value>usb</value>
|
||||
<value>pci</value>
|
||||
<value>scsi</value>
|
||||
</enum>
|
||||
|
@ -153,7 +153,6 @@
|
||||
<value>optional</value>
|
||||
</enum>
|
||||
<enum name='subsysType'>
|
||||
<value>usb</value>
|
||||
<value>pci</value>
|
||||
<value>scsi</value>
|
||||
</enum>
|
||||
|
@ -173,7 +173,6 @@
|
||||
<value>optional</value>
|
||||
</enum>
|
||||
<enum name='subsysType'>
|
||||
<value>usb</value>
|
||||
<value>pci</value>
|
||||
<value>scsi</value>
|
||||
</enum>
|
||||
|
@ -178,7 +178,6 @@
|
||||
<value>optional</value>
|
||||
</enum>
|
||||
<enum name='subsysType'>
|
||||
<value>usb</value>
|
||||
<value>pci</value>
|
||||
<value>scsi</value>
|
||||
</enum>
|
||||
|
@ -172,7 +172,6 @@
|
||||
<value>optional</value>
|
||||
</enum>
|
||||
<enum name='subsysType'>
|
||||
<value>usb</value>
|
||||
<value>pci</value>
|
||||
<value>scsi</value>
|
||||
</enum>
|
||||
|
Loading…
Reference in New Issue
Block a user