]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Skip USB controller validation when model=none
authorAndrea Bolognani <abologna@redhat.com>
Mon, 22 Sep 2025 16:24:17 +0000 (18:24 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 6 Oct 2025 09:16:08 +0000 (11:16 +0200)
This is not useful right now, because the function is simply
not called at all for model=none USB controllers, but that's
going to change in a moment, when we start calling the
function during validation instead of command line generation.
Making this change ahead of time means that we can simply
move the code verbatim later.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c

index a17e5eaaab765c6a81f9912332d0c8dc7d1350bf..d43c0fd21ddf6af9f5d01a31394bb182c0de2f66 100644 (file)
@@ -2624,6 +2624,9 @@ qemuValidateDomainDeviceDefControllerUSB(const virDomainControllerDef *controlle
                                          const virDomainDef *def,
                                          virQEMUCaps *qemuCaps)
 {
+    if (controller->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE)
+        return 0;
+
     if (controller->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unable to determine model for USB controller idx=%1$d"),