From nobody Fri May 3 06:19:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1612333177; cv=none; d=zohomail.com; s=zohoarc; b=MSNsdk0YFLrCtxHAL2K01XYasLaTvc/rx0bHyB/XVanl3H3jR3PLZyXHBnaSJt+vkT2SonqVTlFoINAw1ethuhDN8qdPzoZBAYMwVFrCtp2SfoQfzRVi2H2SjAOqPpoInU5BiWkfH04w9L5pZ3b5ePl2GrrV7HDLuQ9UT/uIR30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612333177; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ROgAtj3CnzJplxM8hArqoEztQipLNXgV+dMUjccx3hE=; b=bDVXRuXhbiaZsHzWxMnnd/5XJu0doA9IS8yyWbLWuxuDhz6RtxVlglrNKbd4XpbCRHv+Mf/GSUdIjeZ3ngoI0GZ8ufmPutJVUca4z8e3wpmH7gyQw0MPhXpiuFJt2bZYzNlzVccDp/buZJTRdMvAoGpCSAq4Srs1kl5W95Ul8+M= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1612333175200352.0147841441077; Tue, 2 Feb 2021 22:19:35 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-169-pHbAOmk2N6WK2V5w-60Kbg-1; Wed, 03 Feb 2021 01:19:27 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 74C68100C661; Wed, 3 Feb 2021 06:19:20 +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 26C8B5F9C9; Wed, 3 Feb 2021 06:19:20 +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 E23A04BB7B; Wed, 3 Feb 2021 06:19:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1136IrXT015740 for ; Wed, 3 Feb 2021 01:18:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id CB39F2026D49; Wed, 3 Feb 2021 06:18:53 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C63F52026D12 for ; Wed, 3 Feb 2021 06:18:51 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 31F5C101A562 for ; Wed, 3 Feb 2021 06:18:51 +0000 (UTC) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.70.202]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-349-e0_F0NW7NYq2E_Fc3wwiDA-1; Wed, 03 Feb 2021 01:18:48 -0500 Received: from localhost (unknown [192.168.167.69]) by regular1.263xmail.com (Postfix) with ESMTP id E2E22735 for ; Wed, 3 Feb 2021 14:18:42 +0800 (CST) Received: from localhost.localdomain (unknown [14.18.236.70]) by smtp.263.net (postfix) whith ESMTP id P17144T139832101689088S1612333116169861_; Wed, 03 Feb 2021 14:18:42 +0800 (CST) X-MC-Unique: pHbAOmk2N6WK2V5w-60Kbg-1 X-MC-Unique: e0_F0NW7NYq2E_Fc3wwiDA-1 X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 X-IP-DOMAINF: 1 X-UNIQUE-TAG: <1e58198bcfa144a901e3cc71b8e7f71e> X-RL-SENDER: yili@winhong.com X-SENDER: yili@winhong.com X-LOGIN-NAME: yili@winhong.com X-FST-TO: libvir-list@redhat.com X-SENDER-IP: 14.18.236.70 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Yi Li To: libvir-list@redhat.com Subject: [PATCH] qemuDomainAttachRedirdevDevice: Remove need_release variable Date: Wed, 3 Feb 2021 14:18:34 +0800 Message-Id: <20210203061834.1429758-1-yili@winhong.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 1136IrXT015740 X-loop: libvir-list@redhat.com Cc: Yi Li 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Get rid of the 'need_release' variable. Signed-off-by: Yi Li Reviewed-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 882e5d2384..e07dba3c5e 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1921,18 +1921,16 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr= driver, bool chardevAdded =3D false; g_autofree char *tlsAlias =3D NULL; const char *secAlias =3D NULL; - bool need_release =3D false; virErrorPtr orig_err; =20 if (qemuAssignDeviceRedirdevAlias(def, redirdev, -1) < 0) - goto cleanup; + return -1; =20 if (!(charAlias =3D qemuAliasChardevFromDevAlias(redirdev->info.alias)= )) - goto cleanup; + return -1; =20 if ((virDomainUSBAddressEnsure(priv->usbaddrs, &redirdev->info)) < 0) - goto cleanup; - need_release =3D true; + return -1; =20 if (!(devstr =3D qemuBuildRedirdevDevStr(def, redirdev, priv->qemuCaps= ))) goto cleanup; @@ -1964,7 +1962,7 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr d= river, audit: virDomainAuditRedirdev(vm, redirdev, "attach", ret =3D=3D 0); cleanup: - if (ret < 0 && need_release) + if (ret < 0) qemuDomainReleaseDeviceAddress(vm, &redirdev->info); return ret; =20 --=20 2.25.3