From nobody Tue Nov 26 13:22:50 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1571327063; cv=none; d=zoho.com; s=zohoarc; b=Ic21Fnqaf/NBH5Oe1QzaM6EyCooTWDatv+9WYk+wSPdT+Nge5yWx9vTEZi0w/SSzOicjsSXfyI3kS3d1Q9hX/Hr23/GplJscZ860xz3HkyDVDW5hEm1Hs/DdT+hKA2WFqgUcC6Le8lc6/ks3a9gx6MRF0Zv1JlosWbdwhqvYrBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571327063; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JMjeAY8ck3gocAvul2yqdKEi1zskPEmDJydUgyvPINo=; b=Q164vPkhCa7O+e87Ea95+cRnTGbTQCBnD2o6Tb7CEkSwmQu3IL3EhC2j1VOnCQpVISggLmZnXPhHroqgQqbSl4U7fG1fMMlqlnPcXU0mKYgsSP4bSe/7hN51fxWurHFxZLRy/SxiYX6Uh9KNy48FhuSEfrzToXyKlXFnActAOVM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571327063467175.51078275986015; Thu, 17 Oct 2019 08:44:23 -0700 (PDT) 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 0FC5B821C1; Thu, 17 Oct 2019 15:44:21 +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 26A8A1001B23; Thu, 17 Oct 2019 15:44: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 94C084EE68; Thu, 17 Oct 2019 15:44:17 +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 x9HFiGSc005380 for ; Thu, 17 Oct 2019 11:44:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B2475D712; Thu, 17 Oct 2019 15:44:16 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1132C5D71C for ; Thu, 17 Oct 2019 15:44:14 +0000 (UTC) Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B6E3E3078468 for ; Thu, 17 Oct 2019 15:44:13 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id t20so4202478qtr.10 for ; Thu, 17 Oct 2019 08:44:13 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:d25e:a983:2b3:2523:a41]) by smtp.gmail.com with ESMTPSA id o5sm51042qtq.10.2019.10.17.08.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 08:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MDCLfpypXa2fyXzH1ukGbLWfgwmpp3CrzeDdWEoTaqE=; b=BxlAhE00dLCgSvWOWBaR+2f6gAP0knhe2puvDSSrtBFgWfhS+1AO0pPJpF6NltDIoO OzgcFbnXwzDmcxcnSYT3NGtJtOQblUSJUYJC6HmjBbw+3N6BpoIctQuIyc5zHWt5lWDy fdBCcVVvTgqyYUE3f0EBBOmAWsiGefJIOGHwzBlvpg3hSiaKzMX9x0M3lpFZvGu9g21Z vl6XkxdSb0bSNn1lyT8l8y9twXoDcLuJN0t7AamFUZCJ21XLyaE3DXYwbY723ex9hYRo roL7+JQmyjsFNKBaYXZhNt50ZMUx+81+2IF6oSbuQyCzGigfmn2RBu2rxz1wRnLHsA/Y SsxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MDCLfpypXa2fyXzH1ukGbLWfgwmpp3CrzeDdWEoTaqE=; b=B9dzp6NNCwPCEjLbKu3HxTXoAT9SsbDYGGPa1FUNabrsRLmXrLvm2u5Y6DqkvTkKu4 YiUJsP/kEy8uZ4atOx4wxbcaAj3Gd46VssN9v+VKG6yUPuUayA74aQRbwm8+G3eVjhiy drVgGQ9NPt/RBqzjphw05RR9WxtI+aGulXXtt3JQ9l7/oVjhtm3JBdSGe2F1t/8Y7fnP jFh9I7Z/Gaqb2sLtP88NAFHwlWeGqDR6sE7CELDxJo/rqSQhFbknKxx6NDy+Y8J8AOKL RUe99gGEpSd7qdb3cvctWichaI2XmZSk2klsyNgDjJHcz8qXOhCcdsO3PYSorfzkgJ7o zZzQ== X-Gm-Message-State: APjAAAVLFDC1u/po522ims2iZxRN8+m8YWxkBAdbljcOmOegMrnQyDce qeeRAJgUcTEPjS58SIZ6G7kxHPQB X-Google-Smtp-Source: APXvYqz+dNN7+0V1DzQASITbRTaympvaDN0E6R8EOi/76iyEiF/zFvU199D6aryX/KBVGrQ2A9ku3g== X-Received: by 2002:ac8:5559:: with SMTP id o25mr4473082qtr.267.1571327052919; Thu, 17 Oct 2019 08:44:12 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Thu, 17 Oct 2019 12:44:01 -0300 Message-Id: <20191017154402.31759-2-danielhb413@gmail.com> In-Reply-To: <20191017154402.31759-1-danielhb413@gmail.com> References: <20191017154402.31759-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 17 Oct 2019 15:44:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 17 Oct 2019 15:44:13 +0000 (UTC) for IP:'209.85.160.195' DOMAIN:'mail-qt1-f195.google.com' HELO:'mail-qt1-f195.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.153 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS) 209.85.160.195 mail-qt1-f195.google.com 209.85.160.195 mail-qt1-f195.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 1/2] qemu_hotplug.c: use g_autoptr() with virConnectPtr 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-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.28]); Thu, 17 Oct 2019 15:44:22 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Cole Robinson --- src/qemu/qemu_hotplug.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index bf301919cc..39b6cade58 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1154,7 +1154,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, bool charDevPlugged =3D false; bool netdevPlugged =3D false; g_autofree char *netdev_name =3D NULL; - virConnectPtr conn =3D NULL; + g_autoptr(virConnect) conn =3D NULL; virErrorPtr save_err =3D NULL; =20 /* preallocate new slot for device */ @@ -1497,7 +1497,6 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, } VIR_FREE(vhostfd); VIR_FREE(vhostfdName); - virObjectUnref(conn); virDomainCCWAddressSetFree(ccwaddrs); VIR_FORCE_CLOSE(slirpfd); =20 @@ -3475,7 +3474,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, bool needVlanUpdate =3D false; int ret =3D -1; int changeidx =3D -1; - virConnectPtr conn =3D NULL; + g_autoptr(virConnect) conn =3D NULL; virErrorPtr save_err =3D NULL; =20 if ((changeidx =3D virDomainNetFindIdx(vm->def, newdev)) < 0) @@ -3919,7 +3918,6 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, */ if (newdev && newdev->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK && conn) virDomainNetReleaseActualDevice(conn, vm->def, newdev); - virObjectUnref(conn); virErrorRestore(&save_err); =20 return ret; @@ -4535,13 +4533,11 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver, =20 if (net) { if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK) { - virConnectPtr conn =3D virGetConnectNetwork(); - if (conn) { + g_autoptr(virConnect) conn =3D virGetConnectNetwork(); + if (conn) virDomainNetReleaseActualDevice(conn, vm->def, net); - virObjectUnref(conn); - } else { + else VIR_WARN("Unable to release network device '%s'", NULLSTR(= net->ifname)); - } } virDomainNetDefFree(net); } @@ -4641,13 +4637,11 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver, qemuDomainNetDeviceVportRemove(net); =20 if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK) { - virConnectPtr conn =3D virGetConnectNetwork(); - if (conn) { + g_autoptr(virConnect) conn =3D virGetConnectNetwork(); + if (conn) virDomainNetReleaseActualDevice(conn, vm->def, net); - virObjectUnref(conn); - } else { + else VIR_WARN("Unable to release network device '%s'", NULLSTR(net-= >ifname)); - } } virDomainNetDefFree(net); return 0; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Nov 26 13:22:50 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1571327790; cv=none; d=zoho.com; s=zohoarc; b=DamuGir422NwWlqfx3IEVzVgez36STHFvnOM0Rir7h5RMrWUIEYR87qC25u68AF/imH/Z5/7Qdfo9DThe6OMCj9yO3n7el12y3yIKsP/gCpsS6PXSv67I6jUOiyt4g+OboYcQZBcznOyF5RMSBAY8f/r0TACKCD5qA+YRjrYTMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571327790; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=697jxP2x7vE+4YNuB9mfFksPzpqrpK+cfHrE1eYIx6Q=; b=ksbXBbZrXLuTgpfNWp8U/sreYFRexj5NMf4M60H/ApsBWWxz/A1ZDVsDDSwDKgLB3XOat7f8Nrym41ib9jO4tg78lo6A0koOKx2DSKumgyGm/iqc40VJIfYbiepBHoFgY3+4RaisQKqrrsUbPJjf67hO1xtnd1v+vB+Ik0un2rg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571327790067366.432429801554; Thu, 17 Oct 2019 08:56:30 -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 E5D6218CB91B; Thu, 17 Oct 2019 15:56:27 +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 B92DF60600; Thu, 17 Oct 2019 15:56:27 +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 7A17D4EA69; Thu, 17 Oct 2019 15:56:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9HFiIBt005403 for ; Thu, 17 Oct 2019 11:44:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 904FE1001B33; Thu, 17 Oct 2019 15:44:18 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B701100EA07 for ; Thu, 17 Oct 2019 15:44:15 +0000 (UTC) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1F8BB307B189 for ; Thu, 17 Oct 2019 15:44:15 +0000 (UTC) Received: by mail-qk1-f169.google.com with SMTP id e66so2256562qkf.13 for ; Thu, 17 Oct 2019 08:44:15 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:d25e:a983:2b3:2523:a41]) by smtp.gmail.com with ESMTPSA id o5sm51042qtq.10.2019.10.17.08.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 08:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dkfRuxcgg6/f6FmZ1yxZeu1Lr0iPdC7wxi+rw4z8OMM=; b=mwORr+IPxfDe1INNeZ6ehjrrvQUWL5GacF3u2FgbiTd5h/VgC/x9MPFRRA7mq7Kg69 3NHxGtrDVgEcFkuj/cVwCDG9UMWRFFOPRAS/aBJmX/m7jeUqd+njlGgMnEn/4h8OMdn3 1Nw08PIAW4kDRa/uY3Oox4f9BhlC9DqaIfeLjvF6jKP4/34zpuostmNx6TguhSWJjX6P 43Ld8NZQIR5aXOhbqC5AX2EofYsWrmOZRr6mPAgi1Vi73o8VoHoEW99LB9FjAhEPJBCK BTP5sAkjZUutlGPOBpujwYSNnULo/8nEnCaBKgUHKkDg+L1l6nV//Pa0IG4rxjdYllnl +lxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dkfRuxcgg6/f6FmZ1yxZeu1Lr0iPdC7wxi+rw4z8OMM=; b=rGTaQasqLBihIgTBDPetJ3HKNU3Sodwp3jJat3olcCWyTrm4JRp/A2sgXUOkK1bx6Y lASIb6JQn7vnObH95eh/7Rb0Oehsxd8xcN3azDPu8+5oo5OQqUawrs1/ZXRfSxXre3nd qmRpq94cnUfu8em5WxOZxd1qMHyndjkvYV45i8AiUMwXxBbDx3g/imSMMe7Nb5S0K3oV VGu/ABLbL7TDgcrDaPQgO87WBoganNaSATidyVPIuhpI5I6jam/AkYbB5/0/5Qw0MK4i VN/3RqDSdlacvuFO4bHhIZzVLVc+2jvZvGGu/4xXEBCYIg6CwR1k107x0yQ/02aCnArM COjA== X-Gm-Message-State: APjAAAWf5MLlTCBXmWhJcdES6S8D8Ox7DMD0EOd2HT+/wwyBIci4Ldld oKMRHb2jydug3TcD9kT67Cxznyfb X-Google-Smtp-Source: APXvYqzadaeqPqYqQXigstvIaiZmsomvIqit6IN1clsycldroiH/EHiONzb/DC2gQvnRqvz9Gij4tQ== X-Received: by 2002:a37:4d8e:: with SMTP id a136mr3786380qkb.109.1571327054096; Thu, 17 Oct 2019 08:44:14 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Thu, 17 Oct 2019 12:44:02 -0300 Message-Id: <20191017154402.31759-3-danielhb413@gmail.com> In-Reply-To: <20191017154402.31759-1-danielhb413@gmail.com> References: <20191017154402.31759-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 17 Oct 2019 15:44:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 17 Oct 2019 15:44:15 +0000 (UTC) for IP:'209.85.222.169' DOMAIN:'mail-qk1-f169.google.com' HELO:'mail-qk1-f169.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.15 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.222.169 mail-qk1-f169.google.com 209.85.222.169 mail-qk1-f169.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 2/2] qemu_process: remove unused cleanup labels 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-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.6.2 (mx1.redhat.com [10.5.110.63]); Thu, 17 Oct 2019 15:56:28 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Cole Robinson --- src/qemu/qemu_hotplug.c | 50 +++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 39b6cade58..8a46df9946 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1546,13 +1546,13 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driv= er, unsigned int flags =3D 0; =20 if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0) - goto cleanup; + return -1; =20 if (!cfg->relaxedACS) flags |=3D VIR_HOSTDEV_STRICT_ACS_CHECK; if (qemuHostdevPreparePCIDevices(driver, vm->def->name, vm->def->uuid, &hostdev, 1, priv->qemuCaps, flags) <= 0) - goto cleanup; + return -1; =20 /* this could have been changed by qemuHostdevPreparePCIDevices */ backend =3D hostdev->source.subsys.u.pci.backend; @@ -1656,7 +1656,6 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, =20 qemuHostdevReAttachPCIDevices(driver, vm->def->name, &hostdev, 1); =20 - cleanup: return -1; } =20 @@ -3299,23 +3298,19 @@ qemuDomainAttachLease(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainLeaseDefPtr lease) { - int ret =3D -1; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); =20 if (virDomainLeaseInsertPreAlloc(vm->def) < 0) - goto cleanup; + return -1; =20 if (virDomainLockLeaseAttach(driver->lockManager, cfg->uri, vm, lease) < 0) { virDomainLeaseInsertPreAlloced(vm->def, NULL); - goto cleanup; + return -1; } =20 virDomainLeaseInsertPreAlloced(vm->def, lease); - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 @@ -3330,7 +3325,7 @@ qemuDomainChangeNetBridge(virDomainObjPtr vm, =20 if (!oldbridge || !newbridge) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing bridge nam= e")); - goto cleanup; + return ret; } =20 VIR_DEBUG("Change bridge for interface %s: %s -> %s", @@ -3339,7 +3334,7 @@ qemuDomainChangeNetBridge(virDomainObjPtr vm, if (virNetDevExists(newbridge) !=3D 1) { virReportError(VIR_ERR_OPERATION_FAILED, _("bridge %s doesn't exist"), newbridge); - goto cleanup; + return ret; } =20 ret =3D virNetDevBridgeRemovePort(oldbridge, olddev->ifname); @@ -3363,12 +3358,10 @@ qemuDomainChangeNetBridge(virDomainObjPtr vm, _("unable to recover former state by adding por= t " "to bridge %s"), oldbridge); } - goto cleanup; + return ret; } /* caller will replace entire olddev with newdev in domain nets list */ - ret =3D 0; - cleanup: - return ret; + return 0; } =20 static int @@ -4019,14 +4012,14 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, virReportError(VIR_ERR_DEVICE_MISSING, _("cannot find existing graphics device to modify o= f " "type '%s'"), type); - goto cleanup; + return ret; } =20 if (dev->nListens !=3D olddev->nListens) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("cannot change the number of listen addresses " "on '%s' graphics"), type); - goto cleanup; + return ret; } =20 for (i =3D 0; i < dev->nListens; i++) { @@ -4037,7 +4030,7 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("cannot change the type of listen address " "on '%s' graphics"), type); - goto cleanup; + return ret; } =20 switch (newlisten->type) { @@ -4046,7 +4039,7 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("cannot change listen address setting " "on '%s' graphics"), type); - goto cleanup; + return ret; } =20 break; @@ -4056,7 +4049,7 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("cannot change listen address setting " "on '%s' graphics"), type); - goto cleanup; + return ret; } =20 break; @@ -4066,7 +4059,7 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("cannot change listen socket setting " "on '%s' graphics"), type); - goto cleanup; + return ret; } break; =20 @@ -4084,12 +4077,12 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, (olddev->data.vnc.port !=3D dev->data.vnc.port))) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot change port settings on vnc graphics"= )); - goto cleanup; + return ret; } if (STRNEQ_NULLABLE(olddev->data.vnc.keymap, dev->data.vnc.keymap)= ) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot change keymap setting on vnc graphics= ")); - goto cleanup; + return ret; } =20 /* If a password lifetime was, or is set, or action if connected h= as @@ -4108,7 +4101,7 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, cfg->vncPassword, QEMU_ASYNC_JOB_NONE); if (ret < 0) - goto cleanup; + return ret; =20 /* Steal the new dev's char * reference */ VIR_FREE(olddev->data.vnc.auth.passwd); @@ -4130,13 +4123,13 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, (olddev->data.spice.tlsPort !=3D dev->data.spice.tlsPort))) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot change port settings on spice graphic= s")); - goto cleanup; + return ret; } if (STRNEQ_NULLABLE(olddev->data.spice.keymap, dev->data.spice.keymap)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("cannot change keymap setting on spice graph= ics")); - goto cleanup; + return ret; } =20 /* We must reset the password if it has changed but also if: @@ -4160,7 +4153,7 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, QEMU_ASYNC_JOB_NONE); =20 if (ret < 0) - goto cleanup; + return ret; =20 /* Steal the new dev's char * reference */ VIR_FREE(olddev->data.spice.auth.passwd); @@ -4188,7 +4181,6 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, break; } =20 - cleanup: return ret; } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list