From d069531a57691fc1ebab01106fe480a207eb1c6c Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Thu, 3 Jul 2025 17:16:48 +0200 Subject: [PATCH] qemu: Fold check into qemuBuildSkipController() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Reviewed-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_command.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b48f7769b5..e57bbc3d9a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3036,6 +3036,11 @@ qemuBuildSkipController(const virDomainControllerDef *controller, return true; } + /* skip USB controllers with type none */ + if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && + controller->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) + return true; + return false; } @@ -3074,13 +3079,6 @@ qemuBuildControllersByTypeCommandLine(virCommand *cmd, if (qemuBuildSkipController(cont, def)) continue; - if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) { - - /* skip USB controllers with type none*/ - if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) - continue; - } - if (qemuBuildControllerDevProps(def, cont, qemuCaps, &props) < 0) return -1; -- 2.47.3