From nobody Mon Apr 29 14:45:33 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15085010297071009.5047549651706; Fri, 20 Oct 2017 05:03:49 -0700 (PDT) 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 88F99552EA; Fri, 20 Oct 2017 12:03:48 +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 48D9018C48; Fri, 20 Oct 2017 12:03:48 +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 E8BAD4EE4F; Fri, 20 Oct 2017 12:03:47 +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 v9KC3cR5002637 for ; Fri, 20 Oct 2017 08:03:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E5435D963; Fri, 20 Oct 2017 12:03:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-118.phx2.redhat.com [10.3.116.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id ECA415D9CA for ; Fri, 20 Oct 2017 12:03:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 88F99552EA Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: John Ferlan To: libvir-list@redhat.com Date: Fri, 20 Oct 2017 08:03:27 -0400 Message-Id: <20171020120330.2188-2-jferlan@redhat.com> In-Reply-To: <20171020120330.2188-1-jferlan@redhat.com> References: <20171020120330.2188-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] conf, qemu: Check for NULL addrs in virDomainUSBAddressRelease 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 20 Oct 2017 12:03:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Rather than having the caller check, if the input @addrs is NULL (e.g. priv->usbaddrs), then just return 0. Signed-off-by: John Ferlan --- src/conf/domain_addr.c | 2 +- src/conf/domain_addr.h | 2 +- src/qemu/qemu_domain_address.c | 7 ++----- src/qemu/qemu_hotplug.c | 10 +++------- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 6422682391..a44f964701 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -2177,7 +2177,7 @@ virDomainUSBAddressRelease(virDomainUSBAddressSetPtr = addrs, int targetPort; int ret =3D -1; =20 - if (info->type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB || + if (!addrs || info->type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB || !virDomainUSBAddressPortIsValid(info->addr.usb.port)) return 0; =20 diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 1731014656..7565322bd2 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -330,5 +330,5 @@ virDomainUSBAddressEnsure(virDomainUSBAddressSetPtr add= rs, int virDomainUSBAddressRelease(virDomainUSBAddressSetPtr addrs, virDomainDeviceInfoPtr info) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + ATTRIBUTE_NONNULL(2); #endif /* __DOMAIN_ADDR_H__ */ diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 7f4ac0f45a..7d2e2e75d9 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2895,11 +2895,8 @@ qemuDomainReleaseDeviceAddress(virDomainObjPtr vm, if (virDeviceInfoPCIAddressPresent(info)) virDomainPCIAddressReleaseAddr(priv->pciaddrs, &info->addr.pci); =20 - if (info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB && - priv->usbaddrs && - virDomainUSBAddressRelease(priv->usbaddrs, info) < 0) - VIR_WARN("Unable to release USB address on %s", - NULLSTR(devstr)); + if (virDomainUSBAddressRelease(priv->usbaddrs, info) < 0) + VIR_WARN("Unable to release USB address on %s", NULLSTR(devstr)); } =20 =20 diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 91f7f9ed62..10cdba436b 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2181,7 +2181,6 @@ qemuDomainAttachHostUSBDevice(virQEMUDriverPtr driver, { qemuDomainObjPrivatePtr priv =3D vm->privateData; char *devstr =3D NULL; - bool releaseaddr =3D false; bool added =3D false; bool teardowncgroup =3D false; bool teardownlabel =3D false; @@ -2190,8 +2189,7 @@ qemuDomainAttachHostUSBDevice(virQEMUDriverPtr driver, =20 if (priv->usbaddrs) { if (virDomainUSBAddressEnsure(priv->usbaddrs, hostdev->info) < 0) - goto cleanup; - releaseaddr =3D true; + return -1; } =20 if (qemuHostdevPrepareUSBDevices(driver, vm->def->name, &hostdev, 1, 0= ) < 0) @@ -2244,8 +2242,7 @@ qemuDomainAttachHostUSBDevice(virQEMUDriverPtr driver, VIR_WARN("Unable to remove host device from /dev"); if (added) qemuHostdevReAttachUSBDevices(driver, vm->def->name, &hostdev,= 1); - if (releaseaddr) - virDomainUSBAddressRelease(priv->usbaddrs, hostdev->info); + virDomainUSBAddressRelease(priv->usbaddrs, hostdev->info); } VIR_FREE(devstr); return ret; @@ -3684,8 +3681,7 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver, dev.type =3D VIR_DOMAIN_DEVICE_DISK; dev.data.disk =3D disk; ignore_value(qemuRemoveSharedDevice(driver, &dev, vm->def->name)); - if (priv->usbaddrs) - virDomainUSBAddressRelease(priv->usbaddrs, &disk->info); + virDomainUSBAddressRelease(priv->usbaddrs, &disk->info); =20 virDomainDiskDefFree(disk); return 0; --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 14:45:33 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150850105183165.76152898465136; Fri, 20 Oct 2017 05:04:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04DBB7E422; Fri, 20 Oct 2017 12:04:10 +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 C0154609B2; Fri, 20 Oct 2017 12:04:09 +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 945E6180BAEC; Fri, 20 Oct 2017 12:03:42 +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 v9KC3duI002647 for ; Fri, 20 Oct 2017 08:03:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 79CD35D9C7; Fri, 20 Oct 2017 12:03:39 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-118.phx2.redhat.com [10.3.116.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4346C5DD6A for ; Fri, 20 Oct 2017 12:03:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 04DBB7E422 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: John Ferlan To: libvir-list@redhat.com Date: Fri, 20 Oct 2017 08:03:28 -0400 Message-Id: <20171020120330.2188-3-jferlan@redhat.com> In-Reply-To: <20171020120330.2188-1-jferlan@redhat.com> References: <20171020120330.2188-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] conf, qemu: Check for NULL addrs in virDomainUSBAddressEnsure 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 20 Oct 2017 12:04:10 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Rather than having the caller check, if the input @addrs is NULL (e.g. priv->usbaddrs), then just return 0. Signed-off-by: John Ferlan --- src/conf/domain_addr.c | 3 +++ src/conf/domain_addr.h | 2 +- src/qemu/qemu_hotplug.c | 23 ++++++++--------------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index a44f964701..78ff7a9cc6 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -2154,6 +2154,9 @@ int virDomainUSBAddressEnsure(virDomainUSBAddressSetPtr addrs, virDomainDeviceInfoPtr info) { + if (!addrs) + return 0; + if (info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE || (info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB && !virDomainUSBAddressPortIsValid(info->addr.usb.port))) { diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 7565322bd2..d3541bab09 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -325,7 +325,7 @@ virDomainUSBAddressAssign(virDomainUSBAddressSetPtr add= rs, int virDomainUSBAddressEnsure(virDomainUSBAddressSetPtr addrs, virDomainDeviceInfoPtr info) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + ATTRIBUTE_NONNULL(2); =20 int virDomainUSBAddressRelease(virDomainUSBAddressSetPtr addrs, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 10cdba436b..51a7a68f84 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -664,10 +664,8 @@ qemuDomainAttachUSBMassStorageDevice(virConnectPtr con= n, { qemuDomainObjPrivatePtr priv =3D vm->privateData; =20 - if (priv->usbaddrs) { - if (virDomainUSBAddressEnsure(priv->usbaddrs, &disk->info) < 0) - return -1; - } + if (virDomainUSBAddressEnsure(priv->usbaddrs, &disk->info) < 0) + return -1; =20 if (qemuDomainAttachDiskGeneric(conn, driver, vm, disk) < 0) { virDomainUSBAddressRelease(priv->usbaddrs, &disk->info); @@ -1772,8 +1770,7 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr v= m, return -1; return 1; =20 - } else if (priv->usbaddrs && - chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && + } else if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && chr->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_US= B) { if (virDomainUSBAddressEnsure(priv->usbaddrs, &chr->info) < 0) return -1; @@ -2187,10 +2184,8 @@ qemuDomainAttachHostUSBDevice(virQEMUDriverPtr drive= r, bool teardowndevice =3D false; int ret =3D -1; =20 - if (priv->usbaddrs) { - if (virDomainUSBAddressEnsure(priv->usbaddrs, hostdev->info) < 0) - return -1; - } + if (virDomainUSBAddressEnsure(priv->usbaddrs, hostdev->info) < 0) + return -1; =20 if (qemuHostdevPrepareUSBDevices(driver, vm->def->name, &hostdev, 1, 0= ) < 0) goto cleanup; @@ -2750,11 +2745,9 @@ qemuDomainAttachInputDevice(virQEMUDriverPtr driver, if (qemuDomainEnsureVirtioAddress(&releaseaddr, vm, &dev, "input")= < 0) return -1; } else if (input->bus =3D=3D VIR_DOMAIN_INPUT_BUS_USB) { - if (priv->usbaddrs) { - if (virDomainUSBAddressEnsure(priv->usbaddrs, &input->info) < = 0) - goto cleanup; - releaseaddr =3D true; - } + if (virDomainUSBAddressEnsure(priv->usbaddrs, &input->info) < 0) + goto cleanup; + releaseaddr =3D true; } =20 if (qemuAssignDeviceInputAlias(vm->def, input, -1) < 0) --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 14:45:33 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150850105617970.91809702912815; Fri, 20 Oct 2017 05:04:16 -0700 (PDT) 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 930047F7AB; Fri, 20 Oct 2017 12:04:14 +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 6C8035D763; Fri, 20 Oct 2017 12:04:14 +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 0F193181A001; Fri, 20 Oct 2017 12:03:52 +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 v9KC3eWY002663 for ; Fri, 20 Oct 2017 08:03:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5A2855E7A1; Fri, 20 Oct 2017 12:03:40 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-118.phx2.redhat.com [10.3.116.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id 253555D9CA for ; Fri, 20 Oct 2017 12:03:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 930047F7AB Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: John Ferlan To: libvir-list@redhat.com Date: Fri, 20 Oct 2017 08:03:29 -0400 Message-Id: <20171020120330.2188-4-jferlan@redhat.com> In-Reply-To: <20171020120330.2188-1-jferlan@redhat.com> References: <20171020120330.2188-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] qemu: Remove unnecessary virtio disk detach info.alias check 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 20 Oct 2017 12:04:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since qemuAssignDeviceDiskAlias checks whether the input info.alias is already present, no need to check here as well. Signed-off-by: John Ferlan --- src/qemu/qemu_hotplug.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 51a7a68f84..9fbb3a0712 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4447,10 +4447,8 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr dr= iver, goto cleanup; } =20 - if (!detach->info.alias) { - if (qemuAssignDeviceDiskAlias(vm->def, detach, priv->qemuCaps) < 0) - goto cleanup; - } + if (qemuAssignDeviceDiskAlias(vm->def, detach, priv->qemuCaps) < 0) + goto cleanup; =20 qemuDomainMarkDeviceForRemoval(vm, &detach->info); =20 --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 14:45:33 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1508501054434537.2796676729145; Fri, 20 Oct 2017 05:04:14 -0700 (PDT) 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 4923B400ED; Fri, 20 Oct 2017 12:04:13 +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 26FD35D763; Fri, 20 Oct 2017 12:04:13 +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 3D92A1800C9C; Fri, 20 Oct 2017 12:03:49 +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 v9KC3eSN002672 for ; Fri, 20 Oct 2017 08:03:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id D85B85DC1E; Fri, 20 Oct 2017 12:03:40 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-118.phx2.redhat.com [10.3.116.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id A14AF5D9CA for ; Fri, 20 Oct 2017 12:03:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4923B400ED Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: John Ferlan To: libvir-list@redhat.com Date: Fri, 20 Oct 2017 08:03:30 -0400 Message-Id: <20171020120330.2188-5-jferlan@redhat.com> In-Reply-To: <20171020120330.2188-1-jferlan@redhat.com> References: <20171020120330.2188-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] qemu: Remove unnecessary controller detach info.alias check 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 20 Oct 2017 12:04:13 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since qemuAssignDeviceControllerAlias checks whether the input info.alias is already present, no need to check here as well. Signed-off-by: John Ferlan --- src/qemu/qemu_hotplug.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 9fbb3a0712..0415584b55 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4662,10 +4662,8 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPt= r driver, goto cleanup; } =20 - if (!detach->info.alias) { - if (qemuAssignDeviceControllerAlias(vm->def, priv->qemuCaps, detac= h) < 0) - goto cleanup; - } + if (qemuAssignDeviceControllerAlias(vm->def, priv->qemuCaps, detach) <= 0) + goto cleanup; =20 qemuDomainMarkDeviceForRemoval(vm, &detach->info); =20 --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list