From nobody Thu May 15 01:50:56 2025 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1517353536679479.3231090411555; Tue, 30 Jan 2018 15:05:36 -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 BE094A342A; Tue, 30 Jan 2018 23:05:34 +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 9187B5C582; Tue, 30 Jan 2018 23:05:34 +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 4A82D5FBDB; Tue, 30 Jan 2018 23:05:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0UN5Ieu006261 for ; Tue, 30 Jan 2018 18:05:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id F377D5C20B; Tue, 30 Jan 2018 23:05:17 +0000 (UTC) Received: from unknown54ee7586bd10.attlocal.net.com (ovpn-116-232.phx2.redhat.com [10.3.116.232]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF7295C25E for ; Tue, 30 Jan 2018 23:05:17 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 30 Jan 2018 18:05:02 -0500 Message-Id: <20180130230503.3820-9-jferlan@redhat.com> In-Reply-To: <20180130230503.3820-1-jferlan@redhat.com> References: <20180130230503.3820-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 8/9] qemu: Reduce need to call qemuDomainGetSCSIControllerModel 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: , MIME-Version: 1.0 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.39]); Tue, 30 Jan 2018 23:05:35 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Now that post parse processing handles setting the SCSI controller model, there's no need to call qemuDomainGetSCSIControllerModel to get the "default controller" when building the command line controller string or when assigning the spaprvio address since the controller model value will already be filled in. Signed-off-by: John Ferlan --- src/qemu/qemu_command.c | 11 +++-------- src/qemu/qemu_domain_address.c | 14 +++----------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1142f302a..f82a78155 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2717,22 +2717,17 @@ qemuBuildControllerDevStr(const virDomainDef *domai= nDef, int *nusbcontroller) { virBuffer buf =3D VIR_BUFFER_INITIALIZER; - int model =3D def->model; const char *modelName =3D NULL; =20 *devstr =3D NULL; =20 if (def->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { - model =3D qemuDomainGetSCSIControllerModel(domainDef, def, qemuCap= s); - if (model < 0) - return -1; - - if (!qemuBuildCheckSCSIControllerModel(qemuCaps, model)) + if (!qemuBuildCheckSCSIControllerModel(qemuCaps, def->model)) return -1; } =20 if (!(def->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_SCSI && - model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI)) { + def->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI))= { if (def->queues) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("'queues' is only supported by virtio-scsi co= ntroller")); @@ -2757,7 +2752,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainD= ef, =20 switch ((virDomainControllerType) def->type) { case VIR_DOMAIN_CONTROLLER_TYPE_SCSI: - switch (model) { + switch (def->model) { case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI: if (def->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { virBufferAddLit(&buf, "virtio-scsi-ccw"); diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 75c263015..aa736131e 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -225,12 +225,10 @@ qemuDomainAssignSpaprVIOAddress(virDomainDefPtr def, =20 =20 static int -qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def) { size_t i; int ret =3D -1; - int model; =20 /* Default values match QEMU. See spapr_(llan|vscsi|vty).c */ =20 @@ -249,13 +247,7 @@ qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def, for (i =3D 0; i < def->ncontrollers; i++) { virDomainControllerDefPtr cont =3D def->controllers[i]; =20 - if (cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { - model =3D qemuDomainGetSCSIControllerModel(def, cont, qemuCaps= ); - if (model < 0) - goto cleanup; - } - - if (model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI && + if (cont->model =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI && cont->type =3D=3D VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { cont->info.type =3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; } @@ -2864,7 +2856,7 @@ qemuDomainAssignAddresses(virDomainDefPtr def, if (qemuDomainAssignVirtioSerialAddresses(def) < 0) return -1; =20 - if (qemuDomainAssignSpaprVIOAddresses(def, qemuCaps) < 0) + if (qemuDomainAssignSpaprVIOAddresses(def) < 0) return -1; =20 if (qemuDomainAssignS390Addresses(def, qemuCaps) < 0) --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list