[PATCH v2 26/38] qemu: Skip USB controller validation when model=none

Andrea Bolognani via Devel posted 38 patches 1 week, 2 days ago
[PATCH v2 26/38] qemu: Skip USB controller validation when model=none
Posted by Andrea Bolognani via Devel 1 week, 2 days ago
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>
---
 src/qemu/qemu_command.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index a17e5eaaab..d43c0fd21d 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -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"),
-- 
2.51.0
Re: [PATCH v2 26/38] qemu: Skip USB controller validation when model=none
Posted by Peter Krempa via Devel 1 day, 17 hours ago
On Thu, Sep 25, 2025 at 20:07:12 +0200, Andrea Bolognani via Devel wrote:
> 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>
> ---
>  src/qemu/qemu_command.c | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>