From nobody Wed Feb 11 04:39:49 2026 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.zoho.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 149823025796563.78347085062194; Fri, 23 Jun 2017 08:04:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B5AAC04F4A8; Fri, 23 Jun 2017 15:04:11 +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 D616E6C93C; Fri, 23 Jun 2017 15:04:10 +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 7086F1853E36; Fri, 23 Jun 2017 15:04:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v5NF3mMa004160 for ; Fri, 23 Jun 2017 11:03:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 46D016F9C8; Fri, 23 Jun 2017 15:03:48 +0000 (UTC) Received: from inaba.usersys.redhat.com (ovpn-12-57.pek2.redhat.com [10.72.12.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 562E76F9CF for ; Fri, 23 Jun 2017 15:03:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0B5AAC04F4A8 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0B5AAC04F4A8 From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 23 Jun 2017 23:03:07 +0800 Message-Id: <1498230208-14144-6-git-send-email-abologna@redhat.com> In-Reply-To: <1498230208-14144-1-git-send-email-abologna@redhat.com> References: <1498230208-14144-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 05/26] qemu: Clean up qemuDomainAttachHostPCIDevice() 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 23 Jun 2017 15:04:11 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We use hostdev->info frequently enough that having a shorter name for it makes the code more readable. We will also be adding even more uses later on. Signed-off-by: Andrea Bolognani Reviewed-by: Laine Stump --- src/qemu/qemu_hotplug.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index a486fb4..d9259ab 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1390,6 +1390,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, qemuDomainObjPrivatePtr priv =3D vm->privateData; virDomainDeviceDef dev =3D { VIR_DOMAIN_DEVICE_HOSTDEV, { .hostdev =3D hostdev } }; + virDomainDeviceInfoPtr info =3D hostdev->info; int ret; char *devstr =3D NULL; int configfd =3D -1; @@ -1462,7 +1463,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, if (backend !=3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) teardownlabel =3D true; =20 - if (qemuAssignDeviceHostdevAlias(vm->def, &hostdev->info->alias, -1) <= 0) + if (qemuAssignDeviceHostdevAlias(vm->def, &info->alias, -1) < 0) goto error; if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0) goto error; @@ -1471,8 +1472,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_PCI_CONFIGFD)) { configfd =3D qemuOpenPCIConfig(hostdev); if (configfd >=3D 0) { - if (virAsprintf(&configfd_name, "fd-%s", - hostdev->info->alias) < 0) + if (virAsprintf(&configfd_name, "fd-%s", info->alias) < 0) goto error; } } @@ -1517,7 +1517,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, VIR_WARN("Unable to remove host device from /dev"); =20 if (releaseaddr) - qemuDomainReleaseDeviceAddress(vm, hostdev->info, NULL); + qemuDomainReleaseDeviceAddress(vm, info, NULL); =20 qemuHostdevReAttachPCIDevices(driver, vm->def->name, &hostdev, 1); =20 --=20 2.7.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list