From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547625384920536.3616407262076; Tue, 15 Jan 2019 23:56:24 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CCA7BC03BC30; Wed, 16 Jan 2019 07:56:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E704C17B24; Wed, 16 Jan 2019 07:56:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 85FED180339A; Wed, 16 Jan 2019 07:56:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7u9Hw015731 for ; Wed, 16 Jan 2019 02:56:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id AD1455D967; Wed, 16 Jan 2019 07:56:09 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 327965D96E for ; Wed, 16 Jan 2019 07:56:09 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:06 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/11] qemu: move out legacy USB controller formatting X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 16 Jan 2019 07:56:23 +0000 (UTC) Move out the code formatting "-usb" on the QEMU command line. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 822d5f8669..d6b7d11cc6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3021,6 +3021,26 @@ qemuBuildControllerDevStr(const virDomainDef *domain= Def, } =20 =20 +static int +qemuBuildLegacyUSBControllerCommandLine(virCommandPtr cmd, + const virDomainDef *def, + int usbcontroller) +{ + if (usbcontroller =3D=3D 0 && + !qemuDomainIsQ35(def) && + !qemuDomainIsARMVirt(def) && + !qemuDomainIsRISCVVirt(def) && + !ARCH_IS_S390(def->os.arch)) { + /* We haven't added any USB controller yet, but we haven't been as= ked + * not to add one either. Add a legacy USB controller, unless we're + * creating a kind of guest we want to keep legacy-free */ + virCommandAddArg(cmd, "-usb"); + } + + return 0; +} + + /** * qemuBuildSkipController: * @controller: Controller to check @@ -3156,16 +3176,8 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, } } =20 - if (usbcontroller =3D=3D 0 && - !qemuDomainIsQ35(def) && - !qemuDomainIsARMVirt(def) && - !qemuDomainIsRISCVVirt(def) && - !ARCH_IS_S390(def->os.arch)) { - /* We haven't added any USB controller yet, but we haven't been as= ked - * not to add one either. Add a legacy USB controller, unless we're - * creating a kind of guest we want to keep legacy-free */ - virCommandAddArg(cmd, "-usb"); - } + if (qemuBuildLegacyUSBControllerCommandLine(cmd, def, usbcontroller) <= 0) + goto cleanup; =20 ret =3D 0; =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15476253749241004.9101877838917; Tue, 15 Jan 2019 23:56:14 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A420C004BF7; Wed, 16 Jan 2019 07:56:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0301F5C1B4; Wed, 16 Jan 2019 07:56:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6EB77A703; Wed, 16 Jan 2019 07:56:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7uAqt015741 for ; Wed, 16 Jan 2019 02:56:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7F9E45D970; Wed, 16 Jan 2019 07:56:10 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 062B85D967 for ; Wed, 16 Jan 2019 07:56:09 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:07 +0100 Message-Id: <7df3660d7152f139a8d2a8e896417cfef81d3547.1547625223.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/11] qemu: exit early if USB_CONTROLLER_MODEL_NONE is present X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 16 Jan 2019 07:56:13 +0000 (UTC) This removes the need to mark it in the 'usbcontroller' variable. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d6b7d11cc6..80b05efa03 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3026,6 +3026,19 @@ qemuBuildLegacyUSBControllerCommandLine(virCommandPt= r cmd, const virDomainDef *def, int usbcontroller) { + size_t i; + + for (i =3D 0; i < def->ncontrollers; i++) { + virDomainControllerDefPtr cont =3D def->controllers[i]; + + if (cont->type !=3D VIR_DOMAIN_CONTROLLER_TYPE_USB) + continue; + + /* If we have mode=3D'none', there are no other USB controllers */ + if (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) + return 0; + } + if (usbcontroller =3D=3D 0 && !qemuDomainIsQ35(def) && !qemuDomainIsARMVirt(def) && @@ -3127,7 +3140,6 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, /* skip USB controllers with type none.*/ if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_USB && cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) { - usbcontroller =3D -1; /* mark we don't want a controller */ continue; } =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 154762538430940.1908375573513; Tue, 15 Jan 2019 23:56:24 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D9E719EBB; Wed, 16 Jan 2019 07:56:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB4C919C7E; Wed, 16 Jan 2019 07:56:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7A5801803396; Wed, 16 Jan 2019 07:56:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7uBol015746 for ; Wed, 16 Jan 2019 02:56:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5362D5D971; Wed, 16 Jan 2019 07:56:11 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE0EA5D967 for ; Wed, 16 Jan 2019 07:56:10 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:08 +0100 Message-Id: <199139153c55523c68efc5e506b68ba4f29ed210.1547625223.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/11] Add qemuBuildDomainForbidLegacyUSBController X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 16 Jan 2019 07:56:23 +0000 (UTC) Shorten some long conditions. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 80b05efa03..cce5520783 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3021,6 +3021,18 @@ qemuBuildControllerDevStr(const virDomainDef *domain= Def, } =20 =20 +static bool +qemuBuildDomainForbidLegacyUSBController(const virDomainDef *def) +{ + if (qemuDomainIsQ35(def) || + qemuDomainIsARMVirt(def) || + qemuDomainIsRISCVVirt(def)) + return true; + + return false; +} + + static int qemuBuildLegacyUSBControllerCommandLine(virCommandPtr cmd, const virDomainDef *def, @@ -3040,9 +3052,7 @@ qemuBuildLegacyUSBControllerCommandLine(virCommandPtr= cmd, } =20 if (usbcontroller =3D=3D 0 && - !qemuDomainIsQ35(def) && - !qemuDomainIsARMVirt(def) && - !qemuDomainIsRISCVVirt(def) && + !qemuBuildDomainForbidLegacyUSBController(def) && !ARCH_IS_S390(def->os.arch)) { /* We haven't added any USB controller yet, but we haven't been as= ked * not to add one either. Add a legacy USB controller, unless we're @@ -3145,9 +3155,7 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, =20 if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_USB && cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT= && - !qemuDomainIsQ35(def) && - !qemuDomainIsARMVirt(def) && - !qemuDomainIsRISCVVirt(def)) { + !qemuBuildDomainForbidLegacyUSBController(def)) { =20 /* An appropriate default USB controller model should alre= ady * have been selected in qemuDomainDeviceDefPostParse(); if --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547625388857469.6947868425434; Tue, 15 Jan 2019 23:56:28 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 77979C002923; Wed, 16 Jan 2019 07:56:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2FB6D5C233; Wed, 16 Jan 2019 07:56:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C6AB3180339D; Wed, 16 Jan 2019 07:56:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7uCj1015751 for ; Wed, 16 Jan 2019 02:56:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 28B065D96E; Wed, 16 Jan 2019 07:56:12 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id A144D5D967 for ; Wed, 16 Jan 2019 07:56:11 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:09 +0100 Message-Id: <9e3b44458a849a2fdc75e36b45324dfeadc088aa.1547625223.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/11] qemu: separate counting of legacy USB controllers X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 16 Jan 2019 07:56:27 +0000 (UTC) Count them in qemuBuildLegacyUSBControllerCommandLine to remove yet another variable accessed from the loop in qemuBuildControllerDevCommandLine. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index cce5520783..014bd031a8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3039,6 +3039,7 @@ qemuBuildLegacyUSBControllerCommandLine(virCommandPtr= cmd, int usbcontroller) { size_t i; + size_t nlegacy =3D 0; =20 for (i =3D 0; i < def->ncontrollers; i++) { virDomainControllerDefPtr cont =3D def->controllers[i]; @@ -3049,6 +3050,16 @@ qemuBuildLegacyUSBControllerCommandLine(virCommandPt= r cmd, /* If we have mode=3D'none', there are no other USB controllers */ if (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) return 0; + + if (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT) + nlegacy++; + } + + if (nlegacy > 1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Multiple legacy USB controllers are " + "not supported")); + return -1; } =20 if (usbcontroller =3D=3D 0 && @@ -3109,7 +3120,6 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, { size_t i, j; int usbcontroller =3D 0; - bool usblegacy =3D false; int contOrder[] =3D { /* * List of controller types that we add commandline args for, @@ -3169,13 +3179,6 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, * (see 548ba43028 for the full story), so we skip * qemuBuildControllerDevStr() but we don't ultimately end * up adding the legacy USB controller */ - if (usblegacy) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Multiple legacy USB controllers are " - "not supported")); - goto cleanup; - } - usblegacy =3D true; continue; } =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547625394194462.9576354767015; Tue, 15 Jan 2019 23:56:34 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6BD96A0A57; Wed, 16 Jan 2019 07:56:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29152601A5; Wed, 16 Jan 2019 07:56:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C76783F608; Wed, 16 Jan 2019 07:56:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7uCv8015757 for ; Wed, 16 Jan 2019 02:56:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id EE2D95D96E; Wed, 16 Jan 2019 07:56:12 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74E335D967 for ; Wed, 16 Jan 2019 07:56:12 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:10 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/11] qemu: separate counting of USB controllers X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 16 Jan 2019 07:56:33 +0000 (UTC) qemuBuildLegacyUSBControllerCommandLine is the only place where we need to count the USB controllers. Count them again instead of keeping track in a variable passed to qemuBuildControllerDevStr. This removes the need for another variable in the loop in qemuBuildControllerDevCommandLine. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 014bd031a8..22f041a956 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3035,11 +3035,11 @@ qemuBuildDomainForbidLegacyUSBController(const virD= omainDef *def) =20 static int qemuBuildLegacyUSBControllerCommandLine(virCommandPtr cmd, - const virDomainDef *def, - int usbcontroller) + const virDomainDef *def) { size_t i; size_t nlegacy =3D 0; + size_t nusb =3D 0; =20 for (i =3D 0; i < def->ncontrollers; i++) { virDomainControllerDefPtr cont =3D def->controllers[i]; @@ -3053,6 +3053,8 @@ qemuBuildLegacyUSBControllerCommandLine(virCommandPtr= cmd, =20 if (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT) nlegacy++; + else + nusb++; } =20 if (nlegacy > 1) { @@ -3062,7 +3064,7 @@ qemuBuildLegacyUSBControllerCommandLine(virCommandPtr= cmd, return -1; } =20 - if (usbcontroller =3D=3D 0 && + if (nusb =3D=3D 0 && !qemuBuildDomainForbidLegacyUSBController(def) && !ARCH_IS_S390(def->os.arch)) { /* We haven't added any USB controller yet, but we haven't been as= ked @@ -3199,7 +3201,7 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, } } =20 - if (qemuBuildLegacyUSBControllerCommandLine(cmd, def, usbcontroller) <= 0) + if (qemuBuildLegacyUSBControllerCommandLine(cmd, def) < 0) goto cleanup; =20 ret =3D 0; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547625377961724.6877047152395; Tue, 15 Jan 2019 23:56:17 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F3DDA2DD2B; Wed, 16 Jan 2019 07:56:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B9EE15D77C; Wed, 16 Jan 2019 07:56:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 54AB73F7D0; Wed, 16 Jan 2019 07:56:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7uDwa015772 for ; Wed, 16 Jan 2019 02:56:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id C04A55D96E; Wed, 16 Jan 2019 07:56:13 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46F195D967 for ; Wed, 16 Jan 2019 07:56:13 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:11 +0100 Message-Id: <6d6ffceda15966745349420cfb14b5b49aa3a136.1547625223.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/11] qemuBuildControllerDevStr: remove nusbcontroller argument X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 16 Jan 2019 07:56:16 +0000 (UTC) Now that it's no longer needed, remove the argument. This removes the last helper variable in qemuBuildControllerDevCommandLine. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 10 ++-------- src/qemu/qemu_command.h | 3 +-- src/qemu/qemu_hotplug.c | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 22f041a956..f95231666f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2833,8 +2833,7 @@ int qemuBuildControllerDevStr(const virDomainDef *domainDef, virDomainControllerDefPtr def, virQEMUCapsPtr qemuCaps, - char **devstr, - int *nusbcontroller) + char **devstr) { virBuffer buf =3D VIR_BUFFER_INITIALIZER; =20 @@ -2913,9 +2912,6 @@ qemuBuildControllerDevStr(const virDomainDef *domainD= ef, if (qemuBuildUSBControllerDevStr(domainDef, def, qemuCaps, &buf) = =3D=3D -1) goto error; =20 - if (nusbcontroller) - *nusbcontroller +=3D 1; - break; =20 case VIR_DOMAIN_CONTROLLER_TYPE_PCI: { @@ -3121,7 +3117,6 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, virQEMUCapsPtr qemuCaps) { size_t i, j; - int usbcontroller =3D 0; int contOrder[] =3D { /* * List of controller types that we add commandline args for, @@ -3184,8 +3179,7 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, continue; } =20 - if (qemuBuildControllerDevStr(def, cont, qemuCaps, - &devstr, &usbcontroller) < 0) + if (qemuBuildControllerDevStr(def, cont, qemuCaps, &devstr) < = 0) goto cleanup; =20 if (devstr) { diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 1a4f1f5da4..d9f8a818b5 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -117,8 +117,7 @@ char int qemuBuildControllerDevStr(const virDomainDef *domainDef, virDomainControllerDefPtr def, virQEMUCapsPtr qemuCaps, - char **devstr, - int *nusbcontroller); + char **devstr); =20 int qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, const char *alias, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index a1c3ca999b..c3d935a412 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1022,7 +1022,7 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr= driver, if (qemuAssignDeviceControllerAlias(vm->def, priv->qemuCaps, controlle= r) < 0) goto cleanup; =20 - if (qemuBuildControllerDevStr(vm->def, controller, priv->qemuCaps, &de= vstr, NULL) < 0) + if (qemuBuildControllerDevStr(vm->def, controller, priv->qemuCaps, &de= vstr) < 0) goto cleanup; =20 if (!devstr) --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547625398924626.7633255855665; Tue, 15 Jan 2019 23:56:38 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E65C3C0669DB; Wed, 16 Jan 2019 07:56:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC15E19751; Wed, 16 Jan 2019 07:56:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6751E180BAAC; Wed, 16 Jan 2019 07:56:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7uE6W015835 for ; Wed, 16 Jan 2019 02:56:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 93A5F5D96E; Wed, 16 Jan 2019 07:56:14 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 197A15D967 for ; Wed, 16 Jan 2019 07:56:13 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:12 +0100 Message-Id: <5a40e8ba3dfb00cd714f2ef68781307fdb1b2858.1547625223.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/11] qemu: Introduce qemuBuildControllersByTypeCommandLine X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 16 Jan 2019 07:56:37 +0000 (UTC) Now that the inner loop does not require any other variables, it can be easily separated. Apart from reducing the indentation level this will allow it to be called from different code paths. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 118 +++++++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 50 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f95231666f..91c7ec5f7b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3111,12 +3111,77 @@ qemuBuildSkipController(const virDomainControllerDe= f *controller, } =20 =20 +static int +qemuBuildControllersByTypeCommandLine(virCommandPtr cmd, + const virDomainDef *def, + virQEMUCapsPtr qemuCaps, + virDomainControllerType type) +{ + int ret =3D -1; + size_t i; + + for (i =3D 0; i < def->ncontrollers; i++) { + virDomainControllerDefPtr cont =3D def->controllers[i]; + char *devstr; + + if (cont->type !=3D type) + continue; + + if (qemuBuildSkipController(cont, def)) + continue; + + /* skip USB controllers with type none.*/ + if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_USB && + cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) { + continue; + } + + if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_USB && + cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT && + !qemuBuildDomainForbidLegacyUSBController(def)) { + + /* An appropriate default USB controller model should already + * have been selected in qemuDomainDeviceDefPostParse(); if + * we still have no model by now, we have to fall back to the + * legacy USB controller. + * + * Note that we *don't* want to end up with the legacy USB + * controller for q35 and virt machines, so we go ahead and + * fail in qemuBuildControllerDevStr(); on the other hand, + * for s390 machines we want to ignore any USB controller + * (see 548ba43028 for the full story), so we skip + * qemuBuildControllerDevStr() but we don't ultimately end + * up adding the legacy USB controller */ + continue; + } + + if (qemuBuildControllerDevStr(def, cont, qemuCaps, &devstr) < 0) + goto cleanup; + + if (devstr) { + if (qemuCommandAddExtDevice(cmd, &cont->info) < 0) { + VIR_FREE(devstr); + goto cleanup; + } + + virCommandAddArg(cmd, "-device"); + virCommandAddArg(cmd, devstr); + VIR_FREE(devstr); + } + } + + ret =3D 0; + cleanup: + return ret; +} + + static int qemuBuildControllerDevCommandLine(virCommandPtr cmd, const virDomainDef *def, virQEMUCapsPtr qemuCaps) { - size_t i, j; + size_t j; int contOrder[] =3D { /* * List of controller types that we add commandline args for, @@ -3144,55 +3209,8 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, int ret =3D -1; =20 for (j =3D 0; j < ARRAY_CARDINALITY(contOrder); j++) { - for (i =3D 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont =3D def->controllers[i]; - char *devstr; - - if (cont->type !=3D contOrder[j]) - continue; - - if (qemuBuildSkipController(cont, def)) - continue; - - /* skip USB controllers with type none.*/ - if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_USB && - cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) { - continue; - } - - if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_USB && - cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT= && - !qemuBuildDomainForbidLegacyUSBController(def)) { - - /* An appropriate default USB controller model should alre= ady - * have been selected in qemuDomainDeviceDefPostParse(); if - * we still have no model by now, we have to fall back to = the - * legacy USB controller. - * - * Note that we *don't* want to end up with the legacy USB - * controller for q35 and virt machines, so we go ahead and - * fail in qemuBuildControllerDevStr(); on the other hand, - * for s390 machines we want to ignore any USB controller - * (see 548ba43028 for the full story), so we skip - * qemuBuildControllerDevStr() but we don't ultimately end - * up adding the legacy USB controller */ - continue; - } - - if (qemuBuildControllerDevStr(def, cont, qemuCaps, &devstr) < = 0) - goto cleanup; - - if (devstr) { - if (qemuCommandAddExtDevice(cmd, &cont->info) < 0) { - VIR_FREE(devstr); - goto cleanup; - } - - virCommandAddArg(cmd, "-device"); - virCommandAddArg(cmd, devstr); - VIR_FREE(devstr); - } - } + if (qemuBuildControllersByTypeCommandLine(cmd, def, qemuCaps, cont= Order[j]) < 0) + goto cleanup; } =20 if (qemuBuildLegacyUSBControllerCommandLine(cmd, def) < 0) --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547625388552787.0591204021324; Tue, 15 Jan 2019 23:56:28 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 92858A048A; Wed, 16 Jan 2019 07:56:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45B475C7A0; Wed, 16 Jan 2019 07:56:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CA2B83F600; Wed, 16 Jan 2019 07:56:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7uFbl015944 for ; Wed, 16 Jan 2019 02:56:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6963A5D96E; Wed, 16 Jan 2019 07:56:15 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id E28695D967 for ; Wed, 16 Jan 2019 07:56:14 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:13 +0100 Message-Id: <9ce1fc2810e9bc0bd23e0e8e5a1d9aac7c4b0f3d.1547625223.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/11] qemu: format CCID controllers after USB hubs X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 16 Jan 2019 07:56:27 +0000 (UTC) Since they go on the USB bus, format them after USB hubs. https://bugzilla.redhat.com/show_bug.cgi?id=3D1375402 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 8 +++++++- tests/qemuxml2argvdata/chardev-reconnect.args | 2 +- tests/qemuxml2argvdata/controller-order.args | 2 +- tests/qemuxml2argvdata/name-escape.args | 2 +- tests/qemuxml2argvdata/smartcard-controller.args | 2 +- .../smartcard-host-certificates-database.args | 2 +- tests/qemuxml2argvdata/smartcard-host-certificates.args | 2 +- tests/qemuxml2argvdata/smartcard-host.args | 2 +- .../qemuxml2argvdata/smartcard-passthrough-spicevmc.args | 2 +- tests/qemuxml2argvdata/smartcard-passthrough-tcp.args | 2 +- tests/qemuxml2argvdata/user-aliases.args | 2 +- 11 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 91c7ec5f7b..7aafe235e2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3197,6 +3197,9 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, * one. Likewise, we don't do anything for the primary IDE * controller on an i440fx machine or primary SATA on q35, but * we do add those beyond these two exceptions. + * + * CCID controllers are formated separately after USB hubs, + * because they go on the USB bus. */ VIR_DOMAIN_CONTROLLER_TYPE_PCI, VIR_DOMAIN_CONTROLLER_TYPE_USB, @@ -3204,7 +3207,6 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, VIR_DOMAIN_CONTROLLER_TYPE_IDE, VIR_DOMAIN_CONTROLLER_TYPE_SATA, VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL, - VIR_DOMAIN_CONTROLLER_TYPE_CCID, }; int ret =3D -1; =20 @@ -10602,6 +10604,10 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildHubCommandLine(cmd, def, qemuCaps) < 0) goto error; =20 + if (qemuBuildControllersByTypeCommandLine(cmd, def, qemuCaps, + VIR_DOMAIN_CONTROLLER_TYPE_C= CID) < 0) + goto error; + if (qemuBuildDisksCommandLine(cmd, def, qemuCaps) < 0) goto error; =20 diff --git a/tests/qemuxml2argvdata/chardev-reconnect.args b/tests/qemuxml2= argvdata/chardev-reconnect.args index e88e083291..baff469c7b 100644 --- a/tests/qemuxml2argvdata/chardev-reconnect.args +++ b/tests/qemuxml2argvdata/chardev-reconnect.args @@ -22,8 +22,8 @@ server,nowait \ -no-acpi \ -device virtio-serial-pci,id=3Dvirtio-serial1,bus=3Dpci.0,addr=3D0xa \ -device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x3 \ --device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -usb \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -chardev socket,id=3Dcharsmartcard0,path=3D/tmp/channel/asdf,reconnect=3D2= 0 \ -device ccid-card-passthru,chardev=3Dcharsmartcard0,id=3Dsmartcard0,bus=3D= ccid0.0 \ -chardev socket,id=3Dcharchannel0,host=3Dlocalhost,port=3D1234,reconnect= =3D10 \ diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2a= rgvdata/controller-order.args index 2477cd2e1c..6bb4942223 100644 --- a/tests/qemuxml2argvdata/controller-order.args +++ b/tests/qemuxml2argvdata/controller-order.args @@ -21,8 +21,8 @@ nowait \ -boot menu=3Doff \ -device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ -device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x7 \ --device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1.1 \ -device usb-hub,id=3Dhub0,bus=3Dusb.0,port=3D1 \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1.1 \ -drive file=3D/tmp/fdr.img,format=3Draw,if=3Dnone,id=3Ddrive-virtio-disk0,= cache=3Dnone,\ aio=3Dnative \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-virtio-disk0,\ diff --git a/tests/qemuxml2argvdata/name-escape.args b/tests/qemuxml2argvda= ta/name-escape.args index 58f284014c..d314ed409a 100644 --- a/tests/qemuxml2argvdata/name-escape.args +++ b/tests/qemuxml2argvdata/name-escape.args @@ -22,8 +22,8 @@ bar=3D2/monitor.sock,server,nowait \ -no-shutdown \ -no-acpi \ -device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.0,addr=3D0x3 \ --device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -usb \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-0,\ cache=3Dnone,throttling.bps-total=3D5000,throttling.iops-total=3D6000,\ throttling.bps-total-max=3D10000,throttling.iops-total-max=3D11000,\ diff --git a/tests/qemuxml2argvdata/smartcard-controller.args b/tests/qemux= ml2argvdata/smartcard-controller.args index 1a654cb4e1..4c5286dd87 100644 --- a/tests/qemuxml2argvdata/smartcard-controller.args +++ b/tests/qemuxml2argvdata/smartcard-controller.args @@ -20,7 +20,7 @@ server,nowait \ -rtc base=3Dutc \ -no-shutdown \ -no-acpi \ --device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -usb \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -device ccid-card-emulated,backend=3Dnss-emulated,id=3Dsmartcard0,bus=3Dcc= id0.0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/smartcard-host-certificates-database.ar= gs b/tests/qemuxml2argvdata/smartcard-host-certificates-database.args index 17fb50699a..1056f52cfa 100644 --- a/tests/qemuxml2argvdata/smartcard-host-certificates-database.args +++ b/tests/qemuxml2argvdata/smartcard-host-certificates-database.args @@ -20,8 +20,8 @@ server,nowait \ -rtc base=3Dutc \ -no-shutdown \ -no-acpi \ --device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -usb \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -device ccid-card-emulated,backend=3Dcertificates,cert1=3Dcert1,cert2=3Dce= rt2,\ cert3=3Dcert3,db=3D/tmp/foo,id=3Dsmartcard0,bus=3Dccid0.0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/smartcard-host-certificates.args b/test= s/qemuxml2argvdata/smartcard-host-certificates.args index 489299a475..6bfb56b94b 100644 --- a/tests/qemuxml2argvdata/smartcard-host-certificates.args +++ b/tests/qemuxml2argvdata/smartcard-host-certificates.args @@ -20,8 +20,8 @@ server,nowait \ -rtc base=3Dutc \ -no-shutdown \ -no-acpi \ --device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -usb \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -device ccid-card-emulated,backend=3Dcertificates,cert1=3Dcert1,cert2=3Dce= rt2,\ cert3=3Dcert3,db=3D/etc/pki/nssdb,id=3Dsmartcard0,bus=3Dccid0.0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/smartcard-host.args b/tests/qemuxml2arg= vdata/smartcard-host.args index 1a654cb4e1..4c5286dd87 100644 --- a/tests/qemuxml2argvdata/smartcard-host.args +++ b/tests/qemuxml2argvdata/smartcard-host.args @@ -20,7 +20,7 @@ server,nowait \ -rtc base=3Dutc \ -no-shutdown \ -no-acpi \ --device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -usb \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -device ccid-card-emulated,backend=3Dnss-emulated,id=3Dsmartcard0,bus=3Dcc= id0.0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/smartcard-passthrough-spicevmc.args b/t= ests/qemuxml2argvdata/smartcard-passthrough-spicevmc.args index 8784a3ffaa..9fbc86bce7 100644 --- a/tests/qemuxml2argvdata/smartcard-passthrough-spicevmc.args +++ b/tests/qemuxml2argvdata/smartcard-passthrough-spicevmc.args @@ -20,8 +20,8 @@ server,nowait \ -rtc base=3Dutc \ -no-shutdown \ -no-acpi \ --device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -usb \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -chardev spicevmc,id=3Dcharsmartcard0,name=3Dsmartcard \ -device ccid-card-passthru,chardev=3Dcharsmartcard0,id=3Dsmartcard0,bus=3D= ccid0.0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/smartcard-passthrough-tcp.args b/tests/= qemuxml2argvdata/smartcard-passthrough-tcp.args index e55126c206..12c03ad4b6 100644 --- a/tests/qemuxml2argvdata/smartcard-passthrough-tcp.args +++ b/tests/qemuxml2argvdata/smartcard-passthrough-tcp.args @@ -20,8 +20,8 @@ server,nowait \ -rtc base=3Dutc \ -no-shutdown \ -no-acpi \ --device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -usb \ +-device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -chardev socket,id=3Dcharsmartcard0,host=3D127.0.0.1,port=3D2001,server,no= wait \ -device ccid-card-passthru,chardev=3Dcharsmartcard0,id=3Dsmartcard0,bus=3D= ccid0.0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/user-aliases.args b/tests/qemuxml2argvd= ata/user-aliases.args index 089a7d8d4b..7fd3b4a6e1 100644 --- a/tests/qemuxml2argvdata/user-aliases.args +++ b/tests/qemuxml2argvdata/user-aliases.args @@ -35,9 +35,9 @@ server,nowait \ -global PIIX4_PM.disable_s3=3D0 \ -global PIIX4_PM.disable_s4=3D0 \ -device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x8 \ +-usb \ -device usb-ccid,id=3Dua-myCCID,bus=3Dua-SomeWeirdController.0,port=3D1 \ -device usb-ccid,id=3Dua-myCCID2,bus=3Dua-SomeWeirdController.0,port=3D2 \ --usb \ -drive file=3D/var/lib/libvirt/images/fd.img,format=3Draw,if=3Dnone,\ id=3Ddrive-ua-myDisk1,cache=3Dnone \ -drive file=3D/var/lib/libvirt/images/gentoo.qcow2,format=3Dqcow2,if=3Dnon= e,\ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547625393574325.83527701576156; Tue, 15 Jan 2019 23:56:33 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 73F77C0586B2; Wed, 16 Jan 2019 07:56:31 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39ACE17AC7; Wed, 16 Jan 2019 07:56:31 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D9C803F606; Wed, 16 Jan 2019 07:56:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7uG05015973 for ; Wed, 16 Jan 2019 02:56:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3F2BD5D96E; Wed, 16 Jan 2019 07:56:16 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id B63455D967 for ; Wed, 16 Jan 2019 07:56:15 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:14 +0100 Message-Id: <19cc54b4196d44a17293635dd7e39ee3c5d5cb8d.1547625223.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/11] qemuBuildControllersByTypeCommandLine: free devstr in the cleanup section X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 16 Jan 2019 07:56:32 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7aafe235e2..5c7e53bb6a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3117,12 +3117,12 @@ qemuBuildControllersByTypeCommandLine(virCommandPtr= cmd, virQEMUCapsPtr qemuCaps, virDomainControllerType type) { + char *devstr =3D NULL; int ret =3D -1; size_t i; =20 for (i =3D 0; i < def->ncontrollers; i++) { virDomainControllerDefPtr cont =3D def->controllers[i]; - char *devstr; =20 if (cont->type !=3D type) continue; @@ -3155,23 +3155,22 @@ qemuBuildControllersByTypeCommandLine(virCommandPtr= cmd, continue; } =20 + VIR_FREE(devstr); if (qemuBuildControllerDevStr(def, cont, qemuCaps, &devstr) < 0) goto cleanup; =20 if (devstr) { - if (qemuCommandAddExtDevice(cmd, &cont->info) < 0) { - VIR_FREE(devstr); + if (qemuCommandAddExtDevice(cmd, &cont->info) < 0) goto cleanup; - } =20 virCommandAddArg(cmd, "-device"); virCommandAddArg(cmd, devstr); - VIR_FREE(devstr); } } =20 ret =3D 0; cleanup: + VIR_FREE(devstr); return ret; } =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547625397937899.4387719401153; Tue, 15 Jan 2019 23:56:37 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03089C057E1B; Wed, 16 Jan 2019 07:56:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BBFB2601A5; Wed, 16 Jan 2019 07:56:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6B4D23F60C; Wed, 16 Jan 2019 07:56:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7uH1W016122 for ; Wed, 16 Jan 2019 02:56:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 12EE95D96E; Wed, 16 Jan 2019 07:56:17 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C6475D967 for ; Wed, 16 Jan 2019 07:56:16 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:15 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/11] rename qemuBuildControllerDevCommandLine X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 16 Jan 2019 07:56:36 +0000 (UTC) Use qemuBuildControllersCommandLine since it builds the command line for (nearly) all controllers, not just one. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 5c7e53bb6a..214d4068e9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3176,9 +3176,9 @@ qemuBuildControllersByTypeCommandLine(virCommandPtr c= md, =20 =20 static int -qemuBuildControllerDevCommandLine(virCommandPtr cmd, - const virDomainDef *def, - virQEMUCapsPtr qemuCaps) +qemuBuildControllersCommandLine(virCommandPtr cmd, + const virDomainDef *def, + virQEMUCapsPtr qemuCaps) { size_t j; int contOrder[] =3D { @@ -10597,7 +10597,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildGlobalControllerCommandLine(cmd, def, qemuCaps) < 0) goto error; =20 - if (qemuBuildControllerDevCommandLine(cmd, def, qemuCaps) < 0) + if (qemuBuildControllersCommandLine(cmd, def, qemuCaps) < 0) goto error; =20 if (qemuBuildHubCommandLine(cmd, def, qemuCaps) < 0) --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 11:34:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547625406988461.5927446247615; Tue, 15 Jan 2019 23:56:46 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7551C89ACB; Wed, 16 Jan 2019 07:56:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29DC0101963A; Wed, 16 Jan 2019 07:56:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B20FE180339E; Wed, 16 Jan 2019 07:56:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0G7uHef016129 for ; Wed, 16 Jan 2019 02:56:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id D9ED95D96E; Wed, 16 Jan 2019 07:56:17 +0000 (UTC) Received: from lpt.brq.redhat.com (unknown [10.43.2.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EEF65D967 for ; Wed, 16 Jan 2019 07:56:17 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Jan 2019 08:56:16 +0100 Message-Id: <064c23ca819f3de1fc30a7313b73205af6c2954e.1547625223.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 11/11] qemuBuildControllersCommandLine: use i instead of j as the counter X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 16 Jan 2019 07:56:45 +0000 (UTC) Now that the nested loop is gone. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 214d4068e9..093a528bec 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3180,7 +3180,7 @@ qemuBuildControllersCommandLine(virCommandPtr cmd, const virDomainDef *def, virQEMUCapsPtr qemuCaps) { - size_t j; + size_t i; int contOrder[] =3D { /* * List of controller types that we add commandline args for, @@ -3209,8 +3209,8 @@ qemuBuildControllersCommandLine(virCommandPtr cmd, }; int ret =3D -1; =20 - for (j =3D 0; j < ARRAY_CARDINALITY(contOrder); j++) { - if (qemuBuildControllersByTypeCommandLine(cmd, def, qemuCaps, cont= Order[j]) < 0) + for (i =3D 0; i < ARRAY_CARDINALITY(contOrder); i++) { + if (qemuBuildControllersByTypeCommandLine(cmd, def, qemuCaps, cont= Order[i]) < 0) goto cleanup; } =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list