[libvirt] [PATCH] qemu: auto-add generic xhci rather than NEC xhci to Q35 domains

Laine Stump posted 1 patch 6 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20180121025514.20756-1-laine@laine.org
src/qemu/qemu_domain.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
[libvirt] [PATCH] qemu: auto-add generic xhci rather than NEC xhci to Q35 domains
Posted by Laine Stump 6 years, 2 months ago
We recently added a generic XHCI USB3 controller to QEMU, and libvirt
supports adding that controller rather than the NEC XHCI USB3
controller, but when auto-adding a USB controller to Q35 domains we
were still adding the vendor-specific NEC controller. This patch
changes to add the generic controller instead, if it's available in
the QEMU binary that will be used.
---
 src/qemu/qemu_domain.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 1676c03fc..6b4bd3cca 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2660,12 +2660,13 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
             addPCIeRoot = true;
             addImplicitSATA = true;
 
-            /* Prefer adding USB3 controller if supported
-             * (nec-usb-xhci). Failing that, add a USB2 controller set
-             * if the ich9-usb-ehci1 device is supported. Otherwise
-             * don't add anything.
+            /* Prefer adding a USB3 controller if supported, fall back
+             * to USB2 if there is no USB3 available, and if that's
+             * unavailable don't add anything.
              */
-            if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI))
+            if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI))
+                usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI;
+            else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NEC_USB_XHCI))
                 usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI;
             else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_USB_EHCI1))
                 usbModel = VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1;
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: auto-add generic xhci rather than NEC xhci to Q35 domains
Posted by Pavel Hrdina 6 years, 2 months ago
On Sat, Jan 20, 2018 at 09:55:14PM -0500, Laine Stump wrote:
> We recently added a generic XHCI USB3 controller to QEMU, and libvirt
> supports adding that controller rather than the NEC XHCI USB3
> controller, but when auto-adding a USB controller to Q35 domains we
> were still adding the vendor-specific NEC controller. This patch
> changes to add the generic controller instead, if it's available in
> the QEMU binary that will be used.
> ---
>  src/qemu/qemu_domain.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list