From nobody Mon May 6 02:01:32 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571227768; cv=none; d=zoho.com; s=zohoarc; b=fkcnQ8aM5URYc5AD7FEMs7Zzr2/o86Il7KVPTSA4VXEOhQ5dPPlBJbu0LTHYJhV7N3ya8wzJIFXPuMgaYI37hlADtINmpf04+1AQw2sarAPuYD8/OyatP5VAOB+pwMDfl7PHXkLhFTR48ju6O7T1y9DJ4mPkCozoWWWa2mX3fr0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571227768; h=Content-Type:Content-Transfer-Encoding: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=9ocdhHZ2SBpPEcvj3ZXhAhIUziOnmEgbSKLctCFYygw=; b=oZgPhuG7i9+rBBWNNlbx85YyAXyVGGPfGPJGUiBHw5LxBBx0Tk0UCwBhtjxY2EpRqwn4MhhyyVmVzCXdG5foIgVH0qpWPLXkfLS+f/hFhPvOQymN3YrUtTWuaq9iGiz8VmUH9sZoivE+dR3mOHq464x4Lfq3YL9tpIkuKqwoJYU= ARC-Authentication-Results: i=1; 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; dmarc=pass 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 1571227768279850.9670273692202; Wed, 16 Oct 2019 05:09:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E93230860BE; Wed, 16 Oct 2019 12:09:26 +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 6925C19D70; Wed, 16 Oct 2019 12:09:26 +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 26D34180B536; Wed, 16 Oct 2019 12:09:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GC9Gnp020916 for ; Wed, 16 Oct 2019 08:09:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id D29B2601AC; Wed, 16 Oct 2019 12:09:16 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59F6A60166 for ; Wed, 16 Oct 2019 12:09:16 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 14:09:02 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/9] util: delete VIR_AUTOFREE 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-Type: text/plain; charset="utf-8" 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 16 Oct 2019 12:09:27 +0000 (UTC) Commit 1e2ae2e311c7453e7894e93688f8785736aa0618 deleted the last use of VIR_AUTOFREE but forgot to delete the macro definition. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/util/viralloc.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/util/viralloc.h b/src/util/viralloc.h index c503bbe19b..d7862d6127 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -488,17 +488,3 @@ void virDisposeString(char **strptr) */ #define VIR_DISPOSE(ptr) virDispose(1 ? (void *) &(ptr) : (ptr), 1, \ sizeof(*(ptr)), NULL) - - -/** - * VIR_AUTOFREE: - * @type: type of the variable to be freed automatically - * - * DEPRECATED: use g_autofree for new code. See HACKING - * for further guidance. - * - * Macro to automatically free the memory allocated to - * the variable declared with it by calling virFree - * when the variable goes out of scope. - */ -#define VIR_AUTOFREE(type) g_autofree type --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:01:32 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571227772; cv=none; d=zoho.com; s=zohoarc; b=AGO7En7QCUfj25b0stA/a/KLYWE6idwqxpxg07/2BBCx6sew4tSdNao19h/YhPM/f/hzs7KjE6NtEl3ChW4jtnRLgb1DZnJOwUfHUPraYHpZ+3JRHlqDq+UG32tqF9U5WRtqIgWvdscAALHYyAZe1nQMUaVmfOaHdF3mdfwRmRQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571227772; h=Content-Type:Content-Transfer-Encoding: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=38bx6Pr80AzHLWuD7zNOXOq/4srAzcT/1Whs4rpOUek=; b=KVw881MMI1YD8ipn/06OjwpsZy1U8QctVJawxBj+2T8lEbdMVEjCd7PHKCnKtIOfsGoL6lHnZ6x8XPG0P7Eah4rOtfpSTdbEkgdRa6JKk9HRF8X0FDzKSsLW+q8Lhplc7QYVGyf3nX/JtHNkjzA1tiL0m2f6loyMl1qo27LW1Ek= ARC-Authentication-Results: i=1; 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; dmarc=pass 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 1571227772158862.3922888827194; Wed, 16 Oct 2019 05:09:32 -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 43728A3CD82; Wed, 16 Oct 2019 12:09:30 +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 0E75160C5E; Wed, 16 Oct 2019 12:09:30 +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 B4753180BA9E; Wed, 16 Oct 2019 12:09:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GC9Hm1020924 for ; Wed, 16 Oct 2019 08:09:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id CA153601AC; Wed, 16 Oct 2019 12:09:17 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C63B60166 for ; Wed, 16 Oct 2019 12:09:17 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 14:09:03 +0200 Message-Id: <592d09237501eb9ea3a045faebd814fe8a115fea.1571227709.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/9] Remove all usage of VIR_RETURN_PTR 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-Type: text/plain; charset="utf-8" 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.6.2 (mx1.redhat.com [10.5.110.68]); Wed, 16 Oct 2019 12:09:30 +0000 (UTC) Prefer: return g_steal_pointer(&ptr); Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 8 ++++---- src/conf/secret_conf.c | 2 +- src/conf/storage_conf.c | 2 +- src/conf/virnetworkportdef.c | 2 +- src/libxl/xen_xl.c | 2 +- src/libxl/xen_xm.c | 2 +- src/qemu/qemu_block.c | 30 +++++++++++++++--------------- src/qemu/qemu_blockjob.c | 12 ++++++------ src/qemu/qemu_command.c | 10 +++++----- src/qemu/qemu_conf.c | 6 +++--- src/qemu/qemu_dbus.c | 2 +- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_interface.c | 2 +- src/qemu/qemu_monitor_json.c | 2 +- src/qemu/qemu_qapi.c | 2 +- src/qemu/qemu_slirp.c | 4 ++-- src/util/virhostdev.c | 4 ++-- src/util/virpci.c | 2 +- tools/virsh-completer.c | 2 +- 19 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8616f820fc..8b56ff3458 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16560,7 +16560,7 @@ virDomainDeviceDefParse(const char *xmlStr, if (virDomainDeviceDefValidate(dev, def, flags, xmlopt) < 0) return NULL; =20 - VIR_RETURN_PTR(dev); + return g_steal_pointer(&dev); } =20 =20 @@ -21681,7 +21681,7 @@ virDomainDefParseNode(xmlDocPtr xml, if (virDomainDefValidate(def, caps, flags, xmlopt) < 0) return NULL; =20 - VIR_RETURN_PTR(def); + return g_steal_pointer(&def); } =20 =20 @@ -30672,7 +30672,7 @@ virDomainNetDefToNetworkPort(virDomainDefPtr dom, =20 port->trustGuestRxFilters =3D iface->trustGuestRxFilters; =20 - VIR_RETURN_PTR(port); + return g_steal_pointer(&port); } =20 int @@ -30925,7 +30925,7 @@ virDomainNetDefActualToNetworkPort(virDomainDefPtr = dom, port->class_id =3D actual->class_id; port->trustGuestRxFilters =3D actual->trustGuestRxFilters; =20 - VIR_RETURN_PTR(port); + return g_steal_pointer(&port); } =20 =20 diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c index 6ee9315933..3716d5731f 100644 --- a/src/conf/secret_conf.c +++ b/src/conf/secret_conf.c @@ -193,7 +193,7 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root) && virSecretDefParseUsage(ctxt, def) < 0) return NULL; =20 - VIR_RETURN_PTR(def); + return g_steal_pointer(&def); } =20 static virSecretDefPtr diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 4c7e7b3f4d..bddede0934 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -718,7 +718,7 @@ virStoragePoolDefParseSourceString(const char *srcSpec, node) < 0) return NULL; =20 - VIR_RETURN_PTR(def); + return g_steal_pointer(&def); } =20 =20 diff --git a/src/conf/virnetworkportdef.c b/src/conf/virnetworkportdef.c index 32834e41d4..459384611c 100644 --- a/src/conf/virnetworkportdef.c +++ b/src/conf/virnetworkportdef.c @@ -253,7 +253,7 @@ virNetworkPortDefParseXML(xmlXPathContextPtr ctxt) return NULL; } =20 - VIR_RETURN_PTR(def); + return g_steal_pointer(&def); } =20 =20 diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 8ae0dbbbd5..cbd3364fe9 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -2247,5 +2247,5 @@ xenFormatXL(virDomainDefPtr def, virConnectPtr conn) if (xenFormatXLDomainChannels(conf, def) < 0) return NULL; =20 - VIR_RETURN_PTR(conf); + return g_steal_pointer(&conf); } diff --git a/src/libxl/xen_xm.c b/src/libxl/xen_xm.c index 65882b7c0b..e368482cac 100644 --- a/src/libxl/xen_xm.c +++ b/src/libxl/xen_xm.c @@ -616,5 +616,5 @@ xenFormatXM(virConnectPtr conn, if (xenFormatXMInputDevs(conf, def) < 0) return NULL; =20 - VIR_RETURN_PTR(conf); + return g_steal_pointer(&conf); } diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 46584f2f1b..8841006c96 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -255,7 +255,7 @@ qemuBlockNodeNameGetBackingChain(virJSONValuePtr namedn= odes, &data) < 0) return NULL; =20 - VIR_RETURN_PTR(disks); + return g_steal_pointer(&disks); } =20 =20 @@ -380,7 +380,7 @@ qemuBlockGetNodeData(virJSONValuePtr data) qemuBlockNamedNodesArrayToHash, node= data) < 0) return NULL; =20 - VIR_RETURN_PTR(nodedata); + return g_steal_pointer(&nodedata); } =20 =20 @@ -449,7 +449,7 @@ qemuBlockStorageSourceGetURI(virStorageSourcePtr src) if (VIR_STRDUP(uri->server, src->hosts->name) < 0) return NULL; =20 - VIR_RETURN_PTR(uri); + return g_steal_pointer(&uri); } =20 =20 @@ -514,7 +514,7 @@ qemuBlockStorageSourceBuildJSONSocketAddress(virStorage= NetHostDefPtr host, return NULL; } =20 - VIR_RETURN_PTR(server); + return g_steal_pointer(&server); } =20 =20 @@ -550,7 +550,7 @@ qemuBlockStorageSourceBuildHostsJSONSocketAddress(virSt= orageSourcePtr src, server =3D NULL; } =20 - VIR_RETURN_PTR(servers); + return g_steal_pointer(&servers); } =20 =20 @@ -617,7 +617,7 @@ qemuBlockStorageSourceBuildHostsJSONInetSocketAddress(v= irStorageSourcePtr src) server =3D NULL; } =20 - VIR_RETURN_PTR(servers); + return g_steal_pointer(&servers); } =20 =20 @@ -649,7 +649,7 @@ qemuBlockStorageSourceGetGlusterProps(virStorageSourceP= tr src, virJSONValueObjectAdd(props, "u:debug", src->debugLevel, NULL) < 0) return NULL; =20 - VIR_RETURN_PTR(props); + return g_steal_pointer(&props); } =20 =20 @@ -989,7 +989,7 @@ qemuBlockStorageSourceGetVvfatProps(virStorageSourcePtr= src, virJSONValueObjectAdd(ret, "b:rw", !src->readonly, NULL) < 0) return NULL; =20 - VIR_RETURN_PTR(ret); + return g_steal_pointer(&ret); } =20 =20 @@ -1162,7 +1162,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourc= ePtr src, } } =20 - VIR_RETURN_PTR(fileprops); + return g_steal_pointer(&fileprops); } =20 =20 @@ -1315,7 +1315,7 @@ qemuBlockStorageSourceGetBlockdevFormatCommonProps(vi= rStorageSourcePtr src) if (qemuBlockStorageSourceGetBlockdevGetCacheProps(src, props) < 0) return NULL; =20 - VIR_RETURN_PTR(props); + return g_steal_pointer(&props); } =20 =20 @@ -1387,7 +1387,7 @@ qemuBlockStorageSourceGetBlockdevFormatProps(virStora= geSourcePtr src) virJSONValueObjectAdd(props, "s:driver", driver, NULL) < 0) return NULL; =20 - VIR_RETURN_PTR(props); + return g_steal_pointer(&props); } =20 =20 @@ -1435,7 +1435,7 @@ qemuBlockStorageSourceGetBlockdevProps(virStorageSour= cePtr src, } } =20 - VIR_RETURN_PTR(props); + return g_steal_pointer(&props); } =20 =20 @@ -1496,7 +1496,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorag= eSourcePtr src, data->storageNodeName =3D src->nodestorage; data->formatNodeName =3D src->nodeformat; =20 - VIR_RETURN_PTR(data); + return g_steal_pointer(&data); } =20 =20 @@ -1753,7 +1753,7 @@ qemuBlockStorageSourceChainDetachPrepareBlockdev(virS= torageSourcePtr src) return NULL; } =20 - VIR_RETURN_PTR(data); + return g_steal_pointer(&data); } =20 =20 @@ -1781,7 +1781,7 @@ qemuBlockStorageSourceChainDetachPrepareDrive(virStor= ageSourcePtr src, if (VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, backend) < 0) return NULL; =20 - VIR_RETURN_PTR(data); + return g_steal_pointer(&data); } =20 =20 diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index cda31f8719..6b2c370d9f 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -118,7 +118,7 @@ qemuBlockJobDataNew(qemuBlockJobType type, job->newstate =3D -1; job->type =3D type; =20 - VIR_RETURN_PTR(job); + return g_steal_pointer(&job); } =20 =20 @@ -214,7 +214,7 @@ qemuBlockJobDiskNew(virDomainObjPtr vm, if (qemuBlockJobRegister(job, vm, disk, true) < 0) return NULL; =20 - VIR_RETURN_PTR(job); + return g_steal_pointer(&job); } =20 =20 @@ -243,7 +243,7 @@ qemuBlockJobDiskNewPull(virDomainObjPtr vm, if (qemuBlockJobRegister(job, vm, disk, true) < 0) return NULL; =20 - VIR_RETURN_PTR(job); + return g_steal_pointer(&job); } =20 =20 @@ -280,7 +280,7 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, if (qemuBlockJobRegister(job, vm, disk, true) < 0) return NULL; =20 - VIR_RETURN_PTR(job); + return g_steal_pointer(&job); } =20 =20 @@ -311,7 +311,7 @@ qemuBlockJobNewCreate(virDomainObjPtr vm, if (qemuBlockJobRegister(job, vm, NULL, true) < 0) return NULL; =20 - VIR_RETURN_PTR(job); + return g_steal_pointer(&job); } =20 =20 @@ -345,7 +345,7 @@ qemuBlockJobDiskNewCopy(virDomainObjPtr vm, if (qemuBlockJobRegister(job, vm, disk, true) < 0) return NULL; =20 - VIR_RETURN_PTR(job); + return g_steal_pointer(&job); } =20 =20 diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index d5f29ba5d4..3991ea3234 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10535,7 +10535,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, cfg->logTimestamp) virCommandAddArgList(cmd, "-msg", "timestamp=3Don", NULL); =20 - VIR_RETURN_PTR(cmd); + return g_steal_pointer(&cmd); } =20 =20 @@ -10724,7 +10724,7 @@ qemuBuildHotpluggableCPUProps(const virDomainVcpuDe= f *vcpu) virJSONValueObjectPrependString(ret, "driver", vcpupriv->type) < 0) return NULL; =20 - VIR_RETURN_PTR(ret); + return g_steal_pointer(&ret); } =20 =20 @@ -10824,7 +10824,7 @@ qemuBuildStorageSourceChainAttachPrepareDrive(virDo= mainDiskDefPtr disk, if (VIR_APPEND_ELEMENT(data->srcdata, data->nsrcdata, elem) < 0) return NULL; =20 - VIR_RETURN_PTR(data); + return g_steal_pointer(&data); } =20 =20 @@ -10874,7 +10874,7 @@ qemuBuildStorageSourceChainAttachPrepareBlockdev(vi= rStorageSourcePtr top, return NULL; } =20 - VIR_RETURN_PTR(data); + return g_steal_pointer(&data); } =20 =20 @@ -10901,5 +10901,5 @@ qemuBuildStorageSourceChainAttachPrepareBlockdevTop= (virStorageSourcePtr top, qemuCaps) < 0) return NULL; =20 - VIR_RETURN_PTR(data); + return g_steal_pointer(&data); } diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 10d06d7e1c..01ac6faed8 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -302,7 +302,7 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool priv= ileged) &cfg->nfirmwares) < 0) return NULL; =20 - VIR_RETURN_PTR(cfg); + return g_steal_pointer(&cfg); } =20 =20 @@ -1292,7 +1292,7 @@ virCapsPtr virQEMUDriverCreateCapabilities(virQEMUDri= verPtr driver) "DOI \"%s\"", model, doi); } =20 - VIR_RETURN_PTR(caps); + return g_steal_pointer(&caps); } =20 =20 @@ -1411,7 +1411,7 @@ virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr d= river, } =20 virObjectRef(domCaps); - VIR_RETURN_PTR(domCaps); + return g_steal_pointer(&domCaps); } =20 =20 diff --git a/src/qemu/qemu_dbus.c b/src/qemu/qemu_dbus.c index d0f25dd0d4..f4205a74bb 100644 --- a/src/qemu/qemu_dbus.c +++ b/src/qemu/qemu_dbus.c @@ -48,7 +48,7 @@ qemuDBusVMStateNew(const char *id, const char *addr) if (VIR_STRDUP(self->addr, addr) < 0) return NULL; =20 - VIR_RETURN_PTR(self); + return g_steal_pointer(&self); } =20 =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 1bda2f5159..e8f8749b94 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3039,7 +3039,7 @@ qemuDomainObjPrivateXMLParseBlockjobChain(xmlNodePtr = node, if (virDomainDiskBackingStoreParse(ctxt, src, xmlflags, xmlopt) < 0) return NULL; =20 - VIR_RETURN_PTR(src); + return g_steal_pointer(&src); } =20 =20 diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index 11d21837ea..6e3e634b30 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -662,7 +662,7 @@ qemuInterfacePrepareSlirp(virQEMUDriverPtr driver, return NULL; } =20 - VIR_RETURN_PTR(slirp); + return g_steal_pointer(&slirp); } =20 =20 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 5ca7c592dc..70edd04773 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2568,7 +2568,7 @@ qemuMonitorJSONBlockStatsCollectData(virJSONValuePtr = dev, bstats->wr_highest_offset_valid =3D true; } =20 - VIR_RETURN_PTR(bstats); + return g_steal_pointer(&bstats); } =20 =20 diff --git a/src/qemu/qemu_qapi.c b/src/qemu/qemu_qapi.c index 41179f72ec..484f274c63 100644 --- a/src/qemu/qemu_qapi.c +++ b/src/qemu/qemu_qapi.c @@ -512,5 +512,5 @@ virQEMUQAPISchemaConvert(virJSONValuePtr schemareply) schema) < 0) return NULL; =20 - VIR_RETURN_PTR(schema); + return g_steal_pointer(&schema); } diff --git a/src/qemu/qemu_slirp.c b/src/qemu/qemu_slirp.c index 6e6393f49d..0b45315a0b 100644 --- a/src/qemu/qemu_slirp.c +++ b/src/qemu/qemu_slirp.c @@ -90,7 +90,7 @@ qemuSlirpNew(void) slirp->pid =3D (pid_t)-1; slirp->fd[0] =3D slirp->fd[1] =3D -1; =20 - VIR_RETURN_PTR(slirp); + return g_steal_pointer(&slirp); } =20 =20 @@ -141,7 +141,7 @@ qemuSlirpNewForHelper(const char *helper) qemuSlirpSetFeature(slirp, tmp); } =20 - VIR_RETURN_PTR(slirp); + return g_steal_pointer(&slirp); } =20 =20 diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 5ceadc6026..2a4a095347 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -200,7 +200,7 @@ virHostdevManagerNew(void) umask(old_umask); } =20 - VIR_RETURN_PTR(hostdevMgr); + return g_steal_pointer(&hostdevMgr); } =20 virHostdevManagerPtr @@ -285,7 +285,7 @@ virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *= hostdevs, int nhostdevs) pci =3D NULL; } =20 - VIR_RETURN_PTR(pcidevs); + return g_steal_pointer(&pcidevs); } =20 static int diff --git a/src/util/virpci.c b/src/util/virpci.c index fa1c67b4cb..d173b29476 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -1419,7 +1419,7 @@ virPCIDeviceNew(unsigned int domain, =20 VIR_DEBUG("%s %s: initialized", dev->id, dev->name); =20 - VIR_RETURN_PTR(dev); + return g_steal_pointer(&dev); } =20 =20 diff --git a/tools/virsh-completer.c b/tools/virsh-completer.c index b7d347b389..dd03c98a16 100644 --- a/tools/virsh-completer.c +++ b/tools/virsh-completer.c @@ -126,5 +126,5 @@ virshCommaStringListComplete(const char *input, nret++; } =20 - VIR_RETURN_PTR(ret); + return g_steal_pointer(&ret); } --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:01:32 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571227775; cv=none; d=zoho.com; s=zohoarc; b=E89sgh3QG+JMj0hBYCyNEJI1QEa2zpxtV7vEwuM52ZNgLoUlbQug3+ura347YlgikCzFQRxWYSgl6y2//7f32qUWl+isr7mq/S0Z79rlkfS/EY00fd7Fx5L8eRRpz2gLLIIcjuM6WVLLh6B1wMvhTW1I/JRgQMWuqx//fGRd8WU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571227775; h=Content-Type:Content-Transfer-Encoding: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=N3MkrUzHJbAcRWcTYJAhczVj0UPndhdR4euTttMZDJE=; b=nHF/uzkg3uiBtFHis3esqvFgzfFGIWEDW89QTYZ1/VvUOIiPtKsLwAOIqzoxnLaj6h0cNeohEsVY+C6CYUNKZHOmLAMizYPeG2y1gAvEKpb7twDAHX06xcNtHXagx3SSWFwNp137uVmIHaVrYlJuzwSuHHP9oo15MfL6DH1wN+k= ARC-Authentication-Results: i=1; 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; dmarc=pass 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 1571227775357304.9555282715462; Wed, 16 Oct 2019 05:09:35 -0700 (PDT) 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 BA0F9C053FDC; Wed, 16 Oct 2019 12:09:33 +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 959B65C541; Wed, 16 Oct 2019 12:09:33 +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 535B983735; Wed, 16 Oct 2019 12:09:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GC9IX6020931 for ; Wed, 16 Oct 2019 08:09:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9A03A601AC; Wed, 16 Oct 2019 12:09:18 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22EB260166 for ; Wed, 16 Oct 2019 12:09:17 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 14:09:04 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/9] internal: delete VIR_RETURN_PTR 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-Type: text/plain; charset="utf-8" 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.32]); Wed, 16 Oct 2019 12:09:34 +0000 (UTC) Remove the macro definition to prevent its usage in new code. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/internal.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/internal.h b/src/internal.h index 25df0560af..722cdbc57c 100644 --- a/src/internal.h +++ b/src/internal.h @@ -225,21 +225,6 @@ (b) =3D NULL; \ } while (0) =20 -/** - * VIR_RETURN_PTR: - * @ret: pointer to return - * - * Returns value of @ret while clearing @ret. This ensures that pointers - * freed by using VIR_AUTOPTR can be easily passed back to the caller with= out - * any temporary variable. @ptr is evaluated more than once. - */ -#define VIR_RETURN_PTR(ptr) \ - do { \ - typeof(ptr) virTemporaryReturnPointer =3D (ptr); \ - (ptr) =3D NULL; \ - return virTemporaryReturnPointer; \ - } while (0) - /** * virCheckFlags: * @supported: an OR'ed set of supported flags --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:01:32 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571227764; cv=none; d=zoho.com; s=zohoarc; b=KSV+3fMeyk8nj/3hBL/dWA63+sGkB0jWdFLIYSVGaz1wJfIc7cCNgTONxo6puZAYriZJRErb39IkHp+5hLgIh3VyBRsU/irDhbDDuHQ0xRLY5YWUUhZ2esuUd9yXJnStgcqMAaCHmcY+z3+gqiArkqOAOScOL+MC8NGoz38Oy8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571227764; h=Content-Type:Content-Transfer-Encoding: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=dFIeyoJP4Uwd9MDA/JQ6n4WHAP8jJb6Xj9NMS/U5OP4=; b=JIf9D2FK6uF1DTwyk22sX6FcCqBmgkZJ4GpJVS6Dtl9PfMdC+f6L2pQQ89n7KE0mbiTLGCghH202CbY/UzNHQLvUeMhf8qNljbACjDbqp4jERMQsY18zp5rb/tfUqIm3lUNPu4y5opV/5B03sO/guERSMiFN8F8Tj6xD+ht3Zt8= ARC-Authentication-Results: i=1; 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; dmarc=pass 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 1571227764224953.0208362885598; Wed, 16 Oct 2019 05:09:24 -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 436573003A49; Wed, 16 Oct 2019 12:09:22 +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 F153D5D9CD; Wed, 16 Oct 2019 12:09:21 +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 ABAAC180B536; Wed, 16 Oct 2019 12:09:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GC9JMP020939 for ; Wed, 16 Oct 2019 08:09:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9263760166; Wed, 16 Oct 2019 12:09:19 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6C0C60470 for ; Wed, 16 Oct 2019 12:09:18 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 14:09:05 +0200 Message-Id: <8a97cfa9c5fdab4d16ff102a74b2f102e2eedb80.1571227709.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/9] conf: use g_steal_pointer instead of VIR_STEAL_PTR 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-Type: text/plain; charset="utf-8" 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.42]); Wed, 16 Oct 2019 12:09:22 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/conf/checkpoint_conf.c | 2 +- src/conf/cpu_conf.c | 18 ++-- src/conf/domain_addr.c | 4 +- src/conf/domain_capabilities.c | 4 +- src/conf/domain_conf.c | 138 +++++++++++++++---------------- src/conf/node_device_conf.c | 12 +-- src/conf/snapshot_conf.c | 8 +- src/conf/storage_conf.c | 8 +- src/conf/virnetworkobj.c | 2 +- src/conf/virnwfilterbindingobj.c | 2 +- src/conf/virsecretobj.c | 2 +- src/conf/virstorageobj.c | 4 +- 12 files changed, 102 insertions(+), 102 deletions(-) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index e7b204a4d2..b254dce7fd 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -197,7 +197,7 @@ virDomainCheckpointDefParse(xmlXPathContextPtr ctxt, return NULL; } =20 - VIR_STEAL_PTR(ret, def); + ret =3D g_steal_pointer(&def); return ret; } =20 diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index a6bb9ea263..80b7687b86 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -185,14 +185,14 @@ virCPUDefStealModel(virCPUDefPtr dst, char *vendor_id =3D NULL; =20 if (keepVendor) { - VIR_STEAL_PTR(vendor, dst->vendor); - VIR_STEAL_PTR(vendor_id, dst->vendor_id); + vendor =3D g_steal_pointer(&dst->vendor); + vendor_id =3D g_steal_pointer(&dst->vendor_id); } =20 virCPUDefFreeModel(dst); =20 - VIR_STEAL_PTR(dst->model, src->model); - VIR_STEAL_PTR(dst->features, src->features); + dst->model =3D g_steal_pointer(&src->model); + dst->features =3D g_steal_pointer(&src->features); dst->microcodeVersion =3D src->microcodeVersion; dst->nfeatures_max =3D src->nfeatures_max; src->nfeatures_max =3D 0; @@ -203,8 +203,8 @@ virCPUDefStealModel(virCPUDefPtr dst, dst->vendor =3D vendor; dst->vendor_id =3D vendor_id; } else { - VIR_STEAL_PTR(dst->vendor, src->vendor); - VIR_STEAL_PTR(dst->vendor_id, src->vendor_id); + dst->vendor =3D g_steal_pointer(&src->vendor); + dst->vendor_id =3D g_steal_pointer(&src->vendor_id); } } =20 @@ -465,7 +465,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, tsc->scaling =3D scaling; } =20 - VIR_STEAL_PTR(def->tsc, tsc); + def->tsc =3D g_steal_pointer(&tsc); } } =20 @@ -644,7 +644,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, def->cache->mode =3D mode; } =20 - VIR_STEAL_PTR(*cpu, def); + *cpu =3D g_steal_pointer(&def); ret =3D 0; =20 cleanup: @@ -987,7 +987,7 @@ virCPUDefCheckFeatures(virCPUDefPtr cpu, } } =20 - VIR_STEAL_PTR(*features, list); + *features =3D g_steal_pointer(&list); return n; } =20 diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index fc612ee6a2..d0026942aa 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -1757,7 +1757,7 @@ virDomainVirtioSerialAddrSetCreateFromDomain(virDomai= nDefPtr def) addrs) < 0) goto cleanup; =20 - VIR_STEAL_PTR(ret, addrs); + ret =3D g_steal_pointer(&addrs); cleanup: virDomainVirtioSerialAddrSetFree(addrs); return ret; @@ -2094,7 +2094,7 @@ virDomainUSBAddressHubNew(size_t nports) goto cleanup; hub->nports =3D nports; =20 - VIR_STEAL_PTR(ret, hub); + ret =3D g_steal_pointer(&hub); cleanup: virDomainUSBAddressHubFree(hub); return ret; diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index b0fdd15d6c..43a778a505 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -229,10 +229,10 @@ virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModels= Ptr cpuModels, return -1; =20 cpuModels->models[cpuModels->nmodels].usable =3D usable; - VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].name, *name); + cpuModels->models[cpuModels->nmodels].name =3D g_steal_pointer(&*name); =20 if (blockers) - VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].blockers, *blo= ckers); + cpuModels->models[cpuModels->nmodels].blockers =3D g_steal_pointer= (&*blockers); =20 cpuModels->nmodels++; return 0; diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8b56ff3458..69464a3345 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1379,7 +1379,7 @@ virDomainKeyWrapDefParseXML(virDomainDefPtr def, xmlX= PathContextPtr ctxt) } =20 if (keywrap->aes || keywrap->dea) - VIR_STEAL_PTR(def->keywrap, keywrap); + def->keywrap =3D g_steal_pointer(&keywrap); =20 return 0; } @@ -1794,7 +1794,7 @@ virDomainVcpuDefNew(virDomainXMLOptionPtr xmlopt) if (VIR_ALLOC(ret) < 0) return NULL; =20 - VIR_STEAL_PTR(ret->privateData, priv); + ret->privateData =3D g_steal_pointer(&priv); =20 return ret; } @@ -2362,7 +2362,7 @@ virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt) !(vsock->privateData =3D xmlopt->privateData.vsockNew())) goto cleanup; =20 - VIR_STEAL_PTR(ret, vsock); + ret =3D g_steal_pointer(&vsock); cleanup: virDomainVsockDefFree(vsock); return ret; @@ -4938,7 +4938,7 @@ virDomainPostParseCheckISCSIPath(char **srcpath) if (virAsprintf(&path, "%s/0", *srcpath) < 0) return -1; VIR_FREE(*srcpath); - VIR_STEAL_PTR(*srcpath, path); + *srcpath =3D g_steal_pointer(&path); return 0; } =20 @@ -5660,10 +5660,10 @@ virDomainDefPostParseVideo(virDomainDefPtr def, /* we don't want to format any values we automatically fill in for * videos into the XML, so clear them, but retain any user-assigned * alias */ - VIR_STEAL_PTR(alias, def->videos[0]->info.alias); + alias =3D g_steal_pointer(&def->videos[0]->info.alias); virDomainVideoDefClear(def->videos[0]); def->videos[0]->type =3D VIR_DOMAIN_VIDEO_TYPE_NONE; - VIR_STEAL_PTR(def->videos[0]->info.alias, alias); + def->videos[0]->info.alias =3D g_steal_pointer(&alias); } else { virDomainDeviceDef device =3D { .type =3D VIR_DOMAIN_DEVICE_VIDEO, @@ -6527,7 +6527,7 @@ virDomainDefValidateAliases(const virDomainDef *def, goto cleanup; =20 if (aliases) - VIR_STEAL_PTR(*aliases, data.aliases); + *aliases =3D g_steal_pointer(&data.aliases); =20 ret =3D 0; cleanup: @@ -7511,7 +7511,7 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xml= opt G_GNUC_UNUSED, (xmlopt->config.features & VIR_DOMAIN_DEF_FEATURE_USER_ALIAS && virDomainDeviceAliasIsUserAlias(aliasStr) && strspn(aliasStr, USER_ALIAS_CHARS) =3D=3D strlen(aliasStr))) - VIR_STEAL_PTR(info->alias, aliasStr); + info->alias =3D g_steal_pointer(&aliasStr); } =20 if (master) { @@ -8030,7 +8030,7 @@ virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr= sourcenode, authdef->secrettype); return -1; } - VIR_STEAL_PTR(iscsisrc->src->auth, authdef); + iscsisrc->src->auth =3D g_steal_pointer(&authdef); } cur =3D cur->next; } @@ -8096,7 +8096,7 @@ virDomainHostdevSubsysSCSIVHostDefParseXML(xmlNodePtr= sourcenode, virReportError(VIR_ERR_XML_ERROR, "%s", _("malformed 'wwpn' va= lue")); return -1; } - VIR_STEAL_PTR(hostsrc->wwpn, wwpn); + hostsrc->wwpn =3D g_steal_pointer(&wwpn); break; case VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_NONE: case VIR_DOMAIN_HOSTDEV_SUBSYS_SCSI_HOST_PROTOCOL_TYPE_LAST: @@ -8389,7 +8389,7 @@ virDomainNetIPParseXML(xmlNodePtr node) return NULL; } =20 - VIR_STEAL_PTR(ret, ip); + ret =3D g_steal_pointer(&ip); return ret; } =20 @@ -8803,7 +8803,7 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt, goto error; } =20 - VIR_STEAL_PTR(seclabel->label, p); + seclabel->label =3D g_steal_pointer(&p); } =20 /* Only parse imagelabel, if requested live XML with relabeling */ @@ -8817,14 +8817,14 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt, "%s", _("security imagelabel is missing")); goto error; } - VIR_STEAL_PTR(seclabel->imagelabel, p); + seclabel->imagelabel =3D g_steal_pointer(&p); } =20 /* Only parse baselabel for dynamic label type */ if (seclabel->type =3D=3D VIR_DOMAIN_SECLABEL_DYNAMIC) { p =3D virXPathStringLimit("string(./baselabel[1])", VIR_SECURITY_LABEL_BUFLEN-1, ctxt); - VIR_STEAL_PTR(seclabel->baselabel, p); + seclabel->baselabel =3D g_steal_pointer(&p); } =20 return seclabel; @@ -9105,9 +9105,9 @@ virDomainLeaseDefParseXML(xmlNodePtr node) goto error; } =20 - VIR_STEAL_PTR(def->key, key); - VIR_STEAL_PTR(def->lockspace, lockspace); - VIR_STEAL_PTR(def->path, path); + def->key =3D g_steal_pointer(&key); + def->lockspace =3D g_steal_pointer(&lockspace); + def->path =3D g_steal_pointer(&path); =20 cleanup: return def; @@ -9156,7 +9156,7 @@ virDomainDiskSourcePoolDefParse(xmlNodePtr node, goto cleanup; } =20 - VIR_STEAL_PTR(*srcpool, source); + *srcpool =3D g_steal_pointer(&source); ret =3D 0; =20 cleanup: @@ -9305,7 +9305,7 @@ virDomainStorageSourceParseBase(const char *type, return NULL; } =20 - VIR_STEAL_PTR(ret, src); + ret =3D g_steal_pointer(&src); return ret; } =20 @@ -9442,7 +9442,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctx= t, virDomainDiskBackingStoreParse(ctxt, backingStore, flags, xmlopt) = < 0) return -1; =20 - VIR_STEAL_PTR(src->backingStore, backingStore); + src->backingStore =3D g_steal_pointer(&backingStore); =20 return 0; } @@ -10343,16 +10343,16 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xm= lopt, def->startupPolicy =3D val; } =20 - VIR_STEAL_PTR(def->dst, target); + def->dst =3D g_steal_pointer(&target); if (authdef) - VIR_STEAL_PTR(def->src->auth, authdef); + def->src->auth =3D g_steal_pointer(&authdef); if (encryption) - VIR_STEAL_PTR(def->src->encryption, encryption); - VIR_STEAL_PTR(def->domain_name, domain_name); - VIR_STEAL_PTR(def->serial, serial); - VIR_STEAL_PTR(def->wwn, wwn); - VIR_STEAL_PTR(def->vendor, vendor); - VIR_STEAL_PTR(def->product, product); + def->src->encryption =3D g_steal_pointer(&encryption); + def->domain_name =3D g_steal_pointer(&domain_name); + def->serial =3D g_steal_pointer(&serial); + def->wwn =3D g_steal_pointer(&wwn); + def->vendor =3D g_steal_pointer(&vendor); + def->product =3D g_steal_pointer(&product); =20 if (virDomainDiskBackingStoreParse(ctxt, def->src, flags, xmlopt) < 0) goto error; @@ -11179,8 +11179,8 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt, goto error; } =20 - VIR_STEAL_PTR(def->src->path, source); - VIR_STEAL_PTR(def->dst, target); + def->src->path =3D g_steal_pointer(&source); + def->dst =3D g_steal_pointer(&target); =20 if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0) goto error; @@ -11358,7 +11358,7 @@ virDomainActualNetDefParseXML(xmlNodePtr node, if (vlanNode && virNetDevVlanParse(vlanNode, ctxt, &actual->vlan) < 0) goto error; =20 - VIR_STEAL_PTR(*def, actual); + *def =3D g_steal_pointer(&actual); ret =3D 0; error: virDomainActualNetDefFree(actual); @@ -11762,9 +11762,9 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, goto error; } =20 - VIR_STEAL_PTR(def->data.network.name, network); - VIR_STEAL_PTR(def->data.network.portgroup, portgroup); - VIR_STEAL_PTR(def->data.network.actual, actual); + def->data.network.name =3D g_steal_pointer(&network); + def->data.network.portgroup =3D g_steal_pointer(&portgroup); + def->data.network.actual =3D g_steal_pointer(&actual); break; =20 case VIR_DOMAIN_NET_TYPE_VHOSTUSER: @@ -11810,7 +11810,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, goto error; =20 def->data.vhostuser->type =3D VIR_DOMAIN_CHR_TYPE_UNIX; - VIR_STEAL_PTR(def->data.vhostuser->data.nix.path, vhostuser_path); + def->data.vhostuser->data.nix.path =3D g_steal_pointer(&vhostuser_= path); =20 if (STREQ(vhostuser_mode, "server")) { def->data.vhostuser->data.nix.listen =3D true; @@ -11839,7 +11839,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, "specified with "= )); goto error; } - VIR_STEAL_PTR(def->data.bridge.brname, bridge); + def->data.bridge.brname =3D g_steal_pointer(&bridge); break; =20 case VIR_DOMAIN_NET_TYPE_CLIENT: @@ -11869,7 +11869,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, goto error; } } else { - VIR_STEAL_PTR(def->data.socket.address, address); + def->data.socket.address =3D g_steal_pointer(&address); } =20 if (def->type !=3D VIR_DOMAIN_NET_TYPE_UDP) @@ -11894,7 +11894,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, "specified with socket interface")); goto error; } else { - VIR_STEAL_PTR(def->data.socket.localaddr, localaddr); + def->data.socket.localaddr =3D g_steal_pointer(&localaddr); } break; =20 @@ -11905,7 +11905,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, "with ")); goto error; } - VIR_STEAL_PTR(def->data.internal.name, internal); + def->data.internal.name =3D g_steal_pointer(&internal); break; =20 case VIR_DOMAIN_NET_TYPE_DIRECT: @@ -11927,7 +11927,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, def->data.direct.mode =3D VIR_NETDEV_MACVLAN_MODE_VEPA; } =20 - VIR_STEAL_PTR(def->data.direct.linkdev, dev); + def->data.direct.linkdev =3D g_steal_pointer(&dev); =20 if (ifname && flags & VIR_DOMAIN_DEF_PARSE_INACTIVE && @@ -11990,15 +11990,15 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xml= opt, } =20 if (script !=3D NULL) - VIR_STEAL_PTR(def->script, script); + def->script =3D g_steal_pointer(&script); if (domain_name !=3D NULL) - VIR_STEAL_PTR(def->domain_name, domain_name); + def->domain_name =3D g_steal_pointer(&domain_name); if (ifname !=3D NULL) - VIR_STEAL_PTR(def->ifname, ifname); + def->ifname =3D g_steal_pointer(&ifname); if (ifname_guest !=3D NULL) - VIR_STEAL_PTR(def->ifname_guest, ifname_guest); + def->ifname_guest =3D g_steal_pointer(&ifname_guest); if (ifname_guest_actual !=3D NULL) - VIR_STEAL_PTR(def->ifname_guest_actual, ifname_guest_actual); + def->ifname_guest_actual =3D g_steal_pointer(&ifname_guest_actual); =20 if (def->type !=3D VIR_DOMAIN_NET_TYPE_HOSTDEV && virDomainNetIsVirtioModel(def)) { @@ -12198,7 +12198,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, def->driver.virtio.guest.ufo =3D val; } } - VIR_STEAL_PTR(def->backend.vhost, vhost_path); + def->backend.vhost =3D g_steal_pointer(&vhost_path); } =20 def->linkstate =3D VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT; @@ -12216,8 +12216,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlop= t, case VIR_DOMAIN_NET_TYPE_ETHERNET: case VIR_DOMAIN_NET_TYPE_NETWORK: case VIR_DOMAIN_NET_TYPE_BRIDGE: - VIR_STEAL_PTR(def->filter, filter); - VIR_STEAL_PTR(def->filterparams, filterparams); + def->filter =3D g_steal_pointer(&filter); + def->filterparams =3D g_steal_pointer(&filterparams); break; case VIR_DOMAIN_NET_TYPE_USER: case VIR_DOMAIN_NET_TYPE_VHOSTUSER: @@ -13213,7 +13213,7 @@ virDomainTPMDefParseXML(virDomainXMLOptionPtr xmlop= t, path =3D virXPathString("string(./backend/device/@path)", ctxt); if (!path && VIR_STRDUP(path, VIR_DOMAIN_TPM_DEFAULT_DEVICE) < 0) goto error; - VIR_STEAL_PTR(def->data.passthrough.source.data.file.path, path); + def->data.passthrough.source.data.file.path =3D g_steal_pointer(&p= ath); def->data.passthrough.source.type =3D VIR_DOMAIN_CHR_TYPE_DEV; break; case VIR_DOMAIN_TPM_TYPE_EMULATOR: @@ -13751,7 +13751,7 @@ virDomainGraphicsListenDefParseXML(virDomainGraphic= sListenDefPtr def, } =20 if (!address) - VIR_STEAL_PTR(address, addressCompat); + address =3D g_steal_pointer(&addressCompat); } =20 if (def->type =3D=3D VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET) { @@ -13764,14 +13764,14 @@ virDomainGraphicsListenDefParseXML(virDomainGraph= icsListenDefPtr def, } =20 if (!socketPath) - VIR_STEAL_PTR(socketPath, socketCompat); + socketPath =3D g_steal_pointer(&socketCompat); } =20 if (address && address[0] && (def->type =3D=3D VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS || (def->type =3D=3D VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK && !(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE)))) { - VIR_STEAL_PTR(def->address, address); + def->address =3D g_steal_pointer(&address); } =20 if (network && network[0]) { @@ -13781,7 +13781,7 @@ virDomainGraphicsListenDefParseXML(virDomainGraphic= sListenDefPtr def, "type 'network'")); goto error; } - VIR_STEAL_PTR(def->network, network); + def->network =3D g_steal_pointer(&network); } =20 if (socketPath && socketPath[0]) { @@ -13791,7 +13791,7 @@ virDomainGraphicsListenDefParseXML(virDomainGraphic= sListenDefPtr def, "type 'socket'")); goto error; } - VIR_STEAL_PTR(def->socket, socketPath); + def->socket =3D g_steal_pointer(&socketPath); } =20 if (fromConfig && @@ -13870,7 +13870,7 @@ virDomainGraphicsListensParseXML(virDomainGraphicsD= efPtr def, =20 if (socketPath) { newListen.type =3D VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET; - VIR_STEAL_PTR(newListen.socket, socketPath); + newListen.socket =3D g_steal_pointer(&socketPath); } else { newListen.type =3D VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS; newListen.address =3D virXMLPropString(node, "listen"); @@ -14348,7 +14348,7 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphics= DefPtr def, } =20 def->data.spice.gl =3D enableVal; - VIR_STEAL_PTR(def->data.spice.rendernode, rendernode); + def->data.spice.rendernode =3D g_steal_pointer(&rendernode= ); =20 } else if (virXMLNodeNameEqual(cur, "mouse")) { int modeVal; @@ -14921,7 +14921,7 @@ virDomainShmemDefParseXML(virDomainXMLOptionPtr xml= opt, goto cleanup; =20 =20 - VIR_STEAL_PTR(ret, def); + ret =3D g_steal_pointer(&def); cleanup: virDomainShmemDefFree(def); return ret; @@ -14981,7 +14981,7 @@ virSysinfoBIOSParseXML(xmlNodePtr node, def =3D NULL; } =20 - VIR_STEAL_PTR(*bios, def); + *bios =3D g_steal_pointer(&def); ret =3D 0; cleanup: virSysinfoBIOSDefFree(def); @@ -15057,7 +15057,7 @@ virSysinfoSystemParseXML(xmlNodePtr node, def =3D NULL; } =20 - VIR_STEAL_PTR(*sysdef, def); + *sysdef =3D g_steal_pointer(&def); ret =3D 0; cleanup: virSysinfoSystemDefFree(def); @@ -15108,7 +15108,7 @@ virSysinfoBaseBoardParseXML(xmlXPathContextPtr ctxt, } } =20 - VIR_STEAL_PTR(*baseBoard, boards); + *baseBoard =3D g_steal_pointer(&boards); *nbaseBoard =3D nboards; ret =3D 0; cleanup: @@ -15146,7 +15146,7 @@ virSysinfoOEMStringsParseXML(xmlNodePtr node, for (i =3D 0; i < nstrings; i++) def->values[i] =3D virXMLNodeContentString(strings[i]); =20 - VIR_STEAL_PTR(*oem, def); + *oem =3D g_steal_pointer(&def); ret =3D 0; cleanup: virSysinfoOEMStringsDefFree(def); @@ -15191,7 +15191,7 @@ virSysinfoChassisParseXML(xmlNodePtr node, def =3D NULL; } =20 - VIR_STEAL_PTR(*chassisdef, def); + *chassisdef =3D g_steal_pointer(&def); ret =3D 0; cleanup: virSysinfoChassisDefFree(def); @@ -16315,7 +16315,7 @@ virDomainIOMMUDefParseXML(xmlNodePtr node, } } =20 - VIR_STEAL_PTR(ret, iommu); + ret =3D g_steal_pointer(&iommu); =20 cleanup: return ret; @@ -16378,7 +16378,7 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xml= opt, if (virDomainDeviceInfoParseXML(xmlopt, node, &vsock->info, flags) < 0) goto cleanup; =20 - VIR_STEAL_PTR(ret, vsock); + ret =3D g_steal_pointer(&vsock); =20 cleanup: return ret; @@ -18372,7 +18372,7 @@ virDomainIOThreadPinDefParseXML(xmlNodePtr node, return -1; } =20 - VIR_STEAL_PTR(iothrid->cpumask, cpumask); + iothrid->cpumask =3D g_steal_pointer(&cpumask); return 0; } =20 @@ -18403,7 +18403,7 @@ virDomainEmulatorPinDefParseXML(xmlNodePtr node) return NULL; } =20 - VIR_STEAL_PTR(ret, def); + ret =3D g_steal_pointer(&def); return ret; } =20 @@ -18738,7 +18738,7 @@ virDomainEmulatorSchedParse(xmlNodePtr node, &sched->priority) < 0) return -1; =20 - VIR_STEAL_PTR(def->cputune.emulatorsched, sched); + def->cputune.emulatorsched =3D g_steal_pointer(&sched); return 0; } =20 @@ -19506,7 +19506,7 @@ virDomainResctrlNew(xmlNodePtr node, =20 resctrl->alloc =3D virObjectRef(alloc); =20 - VIR_STEAL_PTR(ret, resctrl); + ret =3D g_steal_pointer(&resctrl); cleanup: virDomainResctrlDefFree(resctrl); return ret; @@ -30529,7 +30529,7 @@ virDomainDiskSetBlockIOTune(virDomainDiskDefPtr dis= k, =20 VIR_FREE(disk->blkdeviotune.group_name); disk->blkdeviotune =3D *info; - VIR_STEAL_PTR(disk->blkdeviotune.group_name, tmp_group); + disk->blkdeviotune.group_name =3D g_steal_pointer(&tmp_group); =20 return 0; } diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index d33f6736ab..5b4bb34a5a 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -2354,7 +2354,7 @@ virNodeDeviceCapsListExport(virNodeDeviceDefPtr def, #undef MAYBE_ADD_CAP =20 if (want_list) - VIR_STEAL_PTR(*list, tmp); + *list =3D g_steal_pointer(&tmp); ret =3D ncaps; cleanup: VIR_FREE(tmp); @@ -2386,18 +2386,18 @@ virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostP= tr scsi_host) goto cleanup; } VIR_FREE(scsi_host->wwpn); - VIR_STEAL_PTR(scsi_host->wwpn, tmp); + scsi_host->wwpn =3D g_steal_pointer(&tmp); =20 if (!(tmp =3D virVHBAGetConfig(NULL, scsi_host->host, "node_name")= )) { VIR_WARN("Failed to read WWNN for host%d", scsi_host->host); goto cleanup; } VIR_FREE(scsi_host->wwnn); - VIR_STEAL_PTR(scsi_host->wwnn, tmp); + scsi_host->wwnn =3D g_steal_pointer(&tmp); =20 if ((tmp =3D virVHBAGetConfig(NULL, scsi_host->host, "fabric_name"= ))) { VIR_FREE(scsi_host->fabric_wwn); - VIR_STEAL_PTR(scsi_host->fabric_wwn, tmp); + scsi_host->fabric_wwn =3D g_steal_pointer(&tmp); } } =20 @@ -2466,7 +2466,7 @@ virNodeDeviceGetSCSITargetCaps(const char *sysfsPath, goto cleanup; =20 VIR_FREE(scsi_target->rport); - VIR_STEAL_PTR(scsi_target->rport, rport); + scsi_target->rport =3D g_steal_pointer(&rport); =20 if (virFCReadRportValue(scsi_target->rport, "port_name", &scsi_target->wwpn) < 0) { @@ -2591,7 +2591,7 @@ virNodeDeviceGetPCIMdevTypesCaps(const char *sysfspat= h, if (rc <=3D 0) return rc; =20 - VIR_STEAL_PTR(pci_dev->mdev_types, types); + pci_dev->mdev_types =3D g_steal_pointer(&types); pci_dev->nmdev_types =3D rc; pci_dev->flags |=3D VIR_NODE_DEV_CAP_FLAG_PCI_MDEV; =20 diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 9628a8df62..0e9d307321 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -362,7 +362,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, "disk-only snapshot")); goto cleanup; } - VIR_STEAL_PTR(def->file, memoryFile); + def->file =3D g_steal_pointer(&memoryFile); =20 /* verify that memory path is absolute */ if (def->file && def->file[0] !=3D '/') { @@ -407,7 +407,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, if (!offline && virSaveCookieParse(ctxt, &def->cookie, saveCookie) < 0) goto cleanup; =20 - VIR_STEAL_PTR(ret, def); + ret =3D g_steal_pointer(&def); =20 cleanup: VIR_FREE(creation); @@ -543,7 +543,7 @@ virDomainSnapshotRedefineValidate(virDomainSnapshotDefP= tr def, return -1; } else { /* Transfer the domain def */ - VIR_STEAL_PTR(def->parent.dom, otherdef->parent.dom); + def->parent.dom =3D g_steal_pointer(&otherdef->parent.dom); } } } @@ -1008,7 +1008,7 @@ virDomainSnapshotRedefinePrep(virDomainObjPtr vm, flags) < 0) { /* revert any stealing of the snapshot domain definition */ if (check_if_stolen && def->parent.dom && !otherdef->parent.dom) - VIR_STEAL_PTR(otherdef->parent.dom, def->parent.dom); + otherdef->parent.dom =3D g_steal_pointer(&def->parent.dom); return -1; } if (other) { diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index bddede0934..9e4978b560 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -659,7 +659,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, goto cleanup; } =20 - VIR_STEAL_PTR(source->auth, authdef); + source->auth =3D g_steal_pointer(&authdef); } =20 /* Option protocol version string (NFSvN) */ @@ -822,7 +822,7 @@ virStoragePoolDefRefreshParse(xmlXPathContextPtr ctxt, return -1; =20 refresh->volume.allocation =3D tmp; - VIR_STEAL_PTR(def->refresh, refresh); + def->refresh =3D g_steal_pointer(&refresh); return 0; } =20 @@ -998,7 +998,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) return NULL; } =20 - VIR_STEAL_PTR(ret, def); + ret =3D g_steal_pointer(&def); return ret; } =20 @@ -1433,7 +1433,7 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool, VIR_FREE(nodes); } =20 - VIR_STEAL_PTR(ret, def); + ret =3D g_steal_pointer(&def); return ret; } =20 diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index 560839ea7d..435f3611e9 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -620,7 +620,7 @@ virNetworkObjAssignDefLocked(virNetworkObjListPtr nets, obj->persistent =3D !(flags & VIR_NETWORK_OBJ_LIST_ADD_LIVE); } =20 - VIR_STEAL_PTR(ret, obj); + ret =3D g_steal_pointer(&obj); =20 cleanup: virNetworkObjEndAPI(&obj); diff --git a/src/conf/virnwfilterbindingobj.c b/src/conf/virnwfilterbinding= obj.c index 06dd66a5d1..48d53fafb1 100644 --- a/src/conf/virnwfilterbindingobj.c +++ b/src/conf/virnwfilterbindingobj.c @@ -93,7 +93,7 @@ virNWFilterBindingObjStealDef(virNWFilterBindingObjPtr ob= j) { virNWFilterBindingDefPtr def; =20 - VIR_STEAL_PTR(def, obj->def); + def =3D g_steal_pointer(&obj->def); return def; } =20 diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c index f9f222dcd3..ebf6ca7680 100644 --- a/src/conf/virsecretobj.c +++ b/src/conf/virsecretobj.c @@ -393,7 +393,7 @@ virSecretObjListAdd(virSecretObjListPtr secrets, virObjectRef(obj); } =20 - VIR_STEAL_PTR(ret, obj); + ret =3D g_steal_pointer(&obj); =20 cleanup: virSecretObjEndAPI(&obj); diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c index b9717b2fa2..e5ef9c8a68 100644 --- a/src/conf/virstorageobj.c +++ b/src/conf/virstorageobj.c @@ -1115,7 +1115,7 @@ virStoragePoolObjIsDuplicate(virStoragePoolObjListPtr= pools, } } =20 - VIR_STEAL_PTR(*objRet, obj); + *objRet =3D g_steal_pointer(&obj); ret =3D 1; } else { /* UUID does not match, but if a name matches, refuse it */ @@ -1540,7 +1540,7 @@ virStoragePoolObjAssignDef(virStoragePoolObjPtr obj, } else { if (!obj->newDef && flags & VIR_STORAGE_POOL_OBJ_LIST_ADD_LIVE) - VIR_STEAL_PTR(obj->newDef, obj->def); + obj->newDef =3D g_steal_pointer(&obj->def); =20 virStoragePoolDefFree(obj->def); obj->def =3D def; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:01:32 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571227780; cv=none; d=zoho.com; s=zohoarc; b=PnF9gOxyC8IYk9T9KKhrF5024oaoyYd14kTlROP+XWkV5THhviwnTUrQw7OkEhNj3Am3zwc7zVcSzdiqzla5aAO0ahV73qLA6ywj5tm8rmVwa3QUMmUYf2ytMcOwjAbdP62ogZuH1eejNzOuzvVw3bj6PPtcX7Y2BGsQhEyDDxY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571227780; h=Content-Type:Content-Transfer-Encoding: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=INb8VX4b8GPWZtF1vRPKbWRwyQ7PzyUBoTlFCthg01E=; b=neyPvn3vQh2GWRC4N8HNR8uFi8EialqEtmnRW2G7dyJ26sh2jky1f8zmz3ykdI+jsWNxKNj4E5m9moRbWYZwZQRg9wxqK0PJrukr6mhnpnuGyOLYychMti6JDm6VCcXmU9PAgIYaZYbutT3FCcLlJ2Rs2ldzBd8G5XFuIqM1nRg= ARC-Authentication-Results: i=1; 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; dmarc=pass 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 1571227780791426.85158502031845; Wed, 16 Oct 2019 05:09:40 -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 C71C24FCDB; Wed, 16 Oct 2019 12:09:37 +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 9D3E5413C; Wed, 16 Oct 2019 12:09:37 +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 46406180BAA0; Wed, 16 Oct 2019 12:09:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GC9K7m020953 for ; Wed, 16 Oct 2019 08:09:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 88BC860166; Wed, 16 Oct 2019 12:09:20 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF0DA601AC for ; Wed, 16 Oct 2019 12:09:19 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 14:09:06 +0200 Message-Id: <9ca2758202d1d9e262a3f06dd2b784b8ee9561cb.1571227709.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/9] qemu: use g_steal_pointer instead of VIR_STEAL_PTR 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-Type: text/plain; charset="utf-8" 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.30]); Wed, 16 Oct 2019 12:09:38 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/qemu/qemu_agent.c | 6 ++-- src/qemu/qemu_block.c | 20 ++++++------ src/qemu/qemu_blockjob.c | 6 ++-- src/qemu/qemu_capabilities.c | 14 ++++----- src/qemu/qemu_cgroup.c | 2 +- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_domain.c | 26 ++++++++-------- src/qemu/qemu_driver.c | 52 ++++++++++++++++---------------- src/qemu/qemu_firmware.c | 16 +++++----- src/qemu/qemu_hotplug.c | 4 +-- src/qemu/qemu_migration.c | 14 ++++----- src/qemu/qemu_migration_cookie.c | 2 +- src/qemu/qemu_migration_params.c | 4 +-- src/qemu/qemu_monitor.c | 16 +++++----- src/qemu/qemu_monitor_json.c | 16 +++++----- src/qemu/qemu_process.c | 10 +++--- src/qemu/qemu_vhost_user.c | 8 ++--- 17 files changed, 109 insertions(+), 109 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index ccd076d540..bd5b8035ca 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -2163,7 +2163,7 @@ qemuAgentGetFSInfoInternal(qemuAgentPtr mon, goto cleanup; } =20 - VIR_STEAL_PTR(*info, info_ret); + *info =3D g_steal_pointer(&info_ret); ret =3D ndata; =20 cleanup: @@ -2200,7 +2200,7 @@ qemuAgentGetFSInfo(qemuAgentPtr mon, goto cleanup; } =20 - VIR_STEAL_PTR(*info, info_ret); + *info =3D g_steal_pointer(&info_ret); ret =3D nfs; =20 cleanup: @@ -2485,7 +2485,7 @@ qemuAgentGetInterfaces(qemuAgentPtr mon, iface->naddrs =3D addrs_count; } =20 - VIR_STEAL_PTR(*ifaces, ifaces_ret); + *ifaces =3D g_steal_pointer(&ifaces_ret); ret =3D ifaces_count; =20 cleanup: diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 8841006c96..4dc4f2922d 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -184,8 +184,8 @@ qemuBlockNodeNameGetBackingChainBacking(virJSONValuePtr= next, &backingdata) < 0) return -1; =20 - VIR_STEAL_PTR(data->backing, backingdata); - VIR_STEAL_PTR(*nodenamedata, data); + data->backing =3D g_steal_pointer(&backingdata); + *nodenamedata =3D g_steal_pointer(&data); =20 return 0; } @@ -1675,7 +1675,7 @@ qemuBlockStorageSourceDetachPrepare(virStorageSourceP= tr src, goto cleanup; =20 if (driveAlias) { - VIR_STEAL_PTR(data->driveAlias, driveAlias); + data->driveAlias =3D g_steal_pointer(&driveAlias); data->driveAdded =3D true; } else { data->formatNodeName =3D src->nodeformat; @@ -1704,7 +1704,7 @@ qemuBlockStorageSourceDetachPrepare(virStorageSourceP= tr src, goto cleanup; } =20 - VIR_STEAL_PTR(ret, data); + ret =3D g_steal_pointer(&data); =20 cleanup: VIR_FREE(driveAlias); @@ -2035,7 +2035,7 @@ qemuBlockStorageSourceCreateGetFormatPropsGeneric(vir= StorageSourcePtr src, qemuBlockStorageSourceCreateAddBacking(backing, props, false) < 0) return -1; =20 - VIR_STEAL_PTR(*retprops, props); + *retprops =3D g_steal_pointer(&props); return 0; } =20 @@ -2076,7 +2076,7 @@ qemuBlockStorageSourceCreateGetEncryptionLUKS(virStor= ageSourcePtr src, return -1; } =20 - VIR_STEAL_PTR(*luksProps, props); + *luksProps =3D g_steal_pointer(&props); return 0; } =20 @@ -2097,7 +2097,7 @@ qemuBlockStorageSourceCreateGetFormatPropsLUKS(virSto= rageSourcePtr src, NULL) < 0) return -1; =20 - VIR_STEAL_PTR(*props, luksprops); + *props =3D g_steal_pointer(&luksprops); return 0; } =20 @@ -2155,7 +2155,7 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow2(virSt= orageSourcePtr src, qemuBlockStorageSourceCreateAddEncryptionQcow(src, qcow2props) < 0) return -1; =20 - VIR_STEAL_PTR(*props, qcow2props); + *props =3D g_steal_pointer(&qcow2props); return 0; } =20 @@ -2178,7 +2178,7 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow(virSto= rageSourcePtr src, qemuBlockStorageSourceCreateAddEncryptionQcow(src, qcowprops) < 0) return -1; =20 - VIR_STEAL_PTR(*props, qcowprops); + *props =3D g_steal_pointer(&qcowprops); return 0; } =20 @@ -2200,7 +2200,7 @@ qemuBlockStorageSourceCreateGetFormatPropsQed(virStor= ageSourcePtr src, if (qemuBlockStorageSourceCreateAddBacking(backing, qedprops, true) < = 0) return -1; =20 - VIR_STEAL_PTR(*props, qedprops); + *props =3D g_steal_pointer(&qedprops); return 0; } =20 diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 6b2c370d9f..3506fa165b 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -627,7 +627,7 @@ qemuBlockJobRewriteConfigDiskSource(virDomainObjPtr vm, } =20 virObjectUnref(persistDisk->src); - VIR_STEAL_PTR(persistDisk->src, copy); + persistDisk->src =3D g_steal_pointer(©); } =20 =20 @@ -1148,13 +1148,13 @@ qemuBlockJobProcessEventConcludedCopyPivot(virQEMUD= riverPtr driver, * inherit the rest of the chain */ if (job->data.copy.shallownew && !virStorageSourceIsBacking(job->disk->mirror->backingStore)) - VIR_STEAL_PTR(job->disk->mirror->backingStore, job->disk->src->bac= kingStore); + job->disk->mirror->backingStore =3D g_steal_pointer(&job->disk->sr= c->backingStore); =20 qemuBlockJobRewriteConfigDiskSource(vm, job->disk, job->disk->mirror); =20 qemuBlockJobEventProcessConcludedRemoveChain(driver, vm, asyncJob, job= ->disk->src); virObjectUnref(job->disk->src); - VIR_STEAL_PTR(job->disk->src, job->disk->mirror); + job->disk->src =3D g_steal_pointer(&job->disk->mirror); } =20 =20 diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b8f5153cbc..3ce1556fc2 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1590,7 +1590,7 @@ virQEMUCapsSEVInfoCopy(virSEVCapabilityPtr *dst, tmp->cbitpos =3D src->cbitpos; tmp->reduced_phys_bits =3D src->reduced_phys_bits; =20 - VIR_STEAL_PTR(*dst, tmp); + *dst =3D g_steal_pointer(&tmp); return 0; } =20 @@ -2666,7 +2666,7 @@ virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps, goto cleanup; } =20 - VIR_STEAL_PTR(*features, list); + *features =3D g_steal_pointer(&list); if (migratable && !modelInfo->migratability) ret =3D 1; else @@ -3105,7 +3105,7 @@ virQEMUCapsGetCPUModelX86Data(virQEMUCapsPtr qemuCaps, if (virCPUx86DataSetSignature(data, sigFamily, sigModel, sigStepping) = < 0) goto cleanup; =20 - VIR_STEAL_PTR(ret, data); + ret =3D g_steal_pointer(&data); =20 cleanup: virCPUDataFree(data); @@ -3620,7 +3620,7 @@ virQEMUCapsParseSEVInfo(virQEMUCapsPtr qemuCaps, xmlX= PathContextPtr ctxt) return -1; } =20 - VIR_STEAL_PTR(qemuCaps->sevCapabilities, sev); + qemuCaps->sevCapabilities =3D g_steal_pointer(&sev); return 0; } =20 @@ -4561,7 +4561,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, } =20 qemuCaps->version =3D major * 1000000 + minor * 1000 + micro; - VIR_STEAL_PTR(qemuCaps->package, package); + qemuCaps->package =3D g_steal_pointer(&package); qemuCaps->usedQMP =3D true; =20 if (virQEMUCapsInitQMPArch(qemuCaps, mon) < 0) @@ -5112,7 +5112,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache, if (retMachine) *retMachine =3D machine; =20 - VIR_STEAL_PTR(ret, qemuCaps); + ret =3D g_steal_pointer(&qemuCaps); =20 cleanup: virObjectUnref(qemuCaps); @@ -5599,7 +5599,7 @@ virQEMUCapsFillDomainFeatureSEVCaps(virQEMUCapsPtr qe= muCaps, =20 sev->cbitpos =3D cap->cbitpos; sev->reduced_phys_bits =3D cap->reduced_phys_bits; - VIR_STEAL_PTR(domCaps->sev, sev); + domCaps->sev =3D g_steal_pointer(&sev); =20 return 0; } diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index f1776a7c0b..dacbb603b0 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -1335,7 +1335,7 @@ qemuCgroupEmulatorAllNodesAllow(virCgroupPtr cgroup, virCgroupSetCpusetMems(data->emulatorCgroup, all_nodes_str) < 0) goto cleanup; =20 - VIR_STEAL_PTR(*retData, data); + *retData =3D g_steal_pointer(&data); ret =3D 0; =20 cleanup: diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3991ea3234..7b6cc725f4 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10751,7 +10751,7 @@ qemuBuildStorageSourceAttachPrepareDrive(virDomainD= iskDefPtr disk, !(data->driveAlias =3D qemuAliasDiskDriveFromDisk(disk))) return NULL; =20 - VIR_STEAL_PTR(ret, data); + ret =3D g_steal_pointer(&data); =20 return ret; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e8f8749b94..fb008fcbb0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -392,7 +392,7 @@ qemuDomainObjRestoreJob(virDomainObjPtr obj, job->asyncJob =3D priv->job.asyncJob; job->asyncOwner =3D priv->job.asyncOwner; job->phase =3D priv->job.phase; - VIR_STEAL_PTR(job->migParams, priv->job.migParams); + job->migParams =3D g_steal_pointer(&priv->job.migParams); job->apiFlags =3D priv->job.apiFlags; =20 qemuDomainObjResetJob(priv); @@ -2230,7 +2230,7 @@ qemuStorageSourcePrivateDataAssignSecinfo(qemuDomainS= ecretInfoPtr *secinfo, } =20 if ((*secinfo)->type =3D=3D VIR_DOMAIN_SECRET_INFO_TYPE_AES) - VIR_STEAL_PTR((*secinfo)->s.aes.alias, *alias); + (*secinfo)->s.aes.alias =3D g_steal_pointer(&*alias); =20 return 0; } @@ -3345,7 +3345,7 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr n= ode, VIR_DOMAIN_DEF_PARSE_STATUS, xmlopt) <= 0) return -1; =20 - VIR_STEAL_PTR(diskPriv->migrSource, migrSource); + diskPriv->migrSource =3D g_steal_pointer(&migrSource); return 0; } =20 @@ -3608,7 +3608,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, } } =20 - VIR_STEAL_PTR(priv->qemuCaps, qemuCaps); + priv->qemuCaps =3D g_steal_pointer(&qemuCaps); } VIR_FREE(nodes); =20 @@ -3665,7 +3665,7 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, if (qemuDomainObjPrivateXMLParseSlirpFeatures(nodes[i], ctxt, slir= p) < 0) goto error; =20 - VIR_STEAL_PTR(QEMU_DOMAIN_NETWORK_PRIVATE(dev.data.net)->slirp, sl= irp); + QEMU_DOMAIN_NETWORK_PRIVATE(dev.data.net)->slirp =3D g_steal_point= er(&slirp); } VIR_FREE(nodes); =20 @@ -3920,7 +3920,7 @@ qemuDomainDefNamespaceParse(xmlXPathContextPtr ctxt, =20 if (nsdata->num_args > 0 || nsdata->num_env > 0 || nsdata->ncapsadd > 0 || nsdata->ncapsdel > 0) - VIR_STEAL_PTR(*data, nsdata); + *data =3D g_steal_pointer(&nsdata); =20 ret =3D 0; =20 @@ -12206,11 +12206,11 @@ qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver, vcpupriv->node_id =3D info[i].node_id; vcpupriv->vcpus =3D info[i].vcpus; VIR_FREE(vcpupriv->type); - VIR_STEAL_PTR(vcpupriv->type, info[i].type); + vcpupriv->type =3D g_steal_pointer(&info[i].type); VIR_FREE(vcpupriv->alias); - VIR_STEAL_PTR(vcpupriv->alias, info[i].alias); + vcpupriv->alias =3D g_steal_pointer(&info[i].alias); virJSONValueFree(vcpupriv->props); - VIR_STEAL_PTR(vcpupriv->props, info[i].props); + vcpupriv->props =3D g_steal_pointer(&info[i].props); vcpupriv->enable_id =3D info[i].id; vcpupriv->qemu_id =3D info[i].qemu_id; =20 @@ -13178,7 +13178,7 @@ qemuDomainCreateDeviceRecursive(const char *device, } VIR_FREE(devTmp); VIR_FREE(target); - VIR_STEAL_PTR(target, tmp); + target =3D g_steal_pointer(&tmp); } =20 if (qemuDomainCreateDeviceRecursive(target, data, @@ -14157,7 +14157,7 @@ qemuDomainAttachDeviceMknodRecursive(virQEMUDriverP= tr driver, } VIR_FREE(fileTmp); VIR_FREE(target); - VIR_STEAL_PTR(target, tmp); + target =3D g_steal_pointer(&tmp); } =20 data.target =3D target; @@ -14944,12 +14944,12 @@ qemuDomainFixupCPUs(virDomainObjPtr vm, =20 if (fixedCPU) { virCPUDefFree(vm->def->cpu); - VIR_STEAL_PTR(vm->def->cpu, fixedCPU); + vm->def->cpu =3D g_steal_pointer(&fixedCPU); } =20 if (fixedOrig) { virCPUDefFree(*origCPU); - VIR_STEAL_PTR(*origCPU, fixedOrig); + *origCPU =3D g_steal_pointer(&fixedOrig); } =20 ret =3D 0; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 86d7647628..2e422b5882 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2903,7 +2903,7 @@ virQEMUSaveDataNew(char *domXML, if (VIR_ALLOC(data) < 0) return NULL; =20 - VIR_STEAL_PTR(data->xml, domXML); + data->xml =3D g_steal_pointer(&domXML); =20 if (cookieObj && !(data->cookie =3D virSaveCookieFormat((virObjectPtr) cookieObj, @@ -5732,7 +5732,7 @@ qemuDomainGetIOThreadsLive(virQEMUDriverPtr driver, virBitmapFree(map); } =20 - VIR_STEAL_PTR(*info, info_ret); + *info =3D g_steal_pointer(&info_ret); ret =3D niothreads; =20 endjob: @@ -6745,9 +6745,9 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver, virFreeError(err); =20 /* use the user provided XML */ - VIR_STEAL_PTR(ret, newdef); + ret =3D g_steal_pointer(&newdef); } else { - VIR_STEAL_PTR(ret, newdef_migr); + ret =3D g_steal_pointer(&newdef_migr); } =20 cleanup: @@ -8425,7 +8425,7 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef, _("domain already has a watchdog")); return -1; } - VIR_STEAL_PTR(vmdef->watchdog, dev->data.watchdog); + vmdef->watchdog =3D g_steal_pointer(&dev->data.watchdog); break; =20 case VIR_DOMAIN_DEVICE_INPUT: @@ -8439,7 +8439,7 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef, _("domain already has a vsock device")); return -1; } - VIR_STEAL_PTR(vmdef->vsock, dev->data.vsock); + vmdef->vsock =3D g_steal_pointer(&dev->data.vsock); break; =20 case VIR_DOMAIN_DEVICE_SOUND: @@ -12765,7 +12765,7 @@ qemuDomainMigratePerform(virDomainPtr dom, goto cleanup; =20 if (flags & VIR_MIGRATE_PEER2PEER) - VIR_STEAL_PTR(dconnuri, uri); + dconnuri =3D g_steal_pointer(&uri); =20 /* Do not output cookies in v2 protocol, since the cookie * length was not sufficiently large, causing failures @@ -13819,8 +13819,8 @@ qemuConnectStealCPUModelFromInfo(virCPUDefPtr dst, =20 virCPUDefFreeModel(dst); =20 - VIR_STEAL_PTR(info, *src); - VIR_STEAL_PTR(dst->model, info->name); + info =3D g_steal_pointer(&*src); + dst->model =3D g_steal_pointer(&info->name); =20 for (i =3D 0; i < info->nprops; i++) { char *name =3D info->props[i].name; @@ -13888,7 +13888,7 @@ qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCaps, goto cleanup; } =20 - VIR_STEAL_PTR(ret, baseline); + ret =3D g_steal_pointer(&baseline); =20 cleanup: qemuProcessQMPFree(proc); @@ -15506,7 +15506,7 @@ qemuDomainSnapshotDiskPrepareOne(virQEMUDriverPtr d= river, return -1; if (backingStoreStr !=3D NULL) { if (virStorageIsRelative(backingStoreStr)) - VIR_STEAL_PTR(dd->relPath, backingStoreStr); + dd->relPath =3D g_steal_pointer(&backingStoreStr); else VIR_FREE(backingStoreStr); } @@ -15609,7 +15609,7 @@ qemuDomainSnapshotDiskPrepare(virQEMUDriverPtr driv= er, goto cleanup; } =20 - VIR_STEAL_PTR(*rdata, data); + *rdata =3D g_steal_pointer(&data); *rndata =3D ndata; ret =3D 0; =20 @@ -15662,17 +15662,17 @@ qemuDomainSnapshotDiskUpdateSource(virQEMUDriverP= tr driver, /* the old disk image is now readonly */ dd->disk->src->readonly =3D true; =20 - VIR_STEAL_PTR(dd->disk->src->relPath, dd->relPath); - VIR_STEAL_PTR(dd->src->backingStore, dd->disk->src); - VIR_STEAL_PTR(dd->disk->src, dd->src); + dd->disk->src->relPath =3D g_steal_pointer(&dd->relPath); + dd->src->backingStore =3D g_steal_pointer(&dd->disk->src); + dd->disk->src =3D g_steal_pointer(&dd->src); =20 /* fix numbering of disks */ if (!blockdev) qemuDomainSnapshotDiskUpdateSourceRenumber(dd->disk->src); =20 if (dd->persistdisk) { - VIR_STEAL_PTR(dd->persistsrc->backingStore, dd->persistdisk->src); - VIR_STEAL_PTR(dd->persistdisk->src, dd->persistsrc); + dd->persistsrc->backingStore =3D g_steal_pointer(&dd->persistdisk-= >src); + dd->persistdisk->src =3D g_steal_pointer(&dd->persistsrc); } } =20 @@ -16765,7 +16765,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, if (!inactiveConfig) goto endjob; } else { - VIR_STEAL_PTR(inactiveConfig, config); + inactiveConfig =3D g_steal_pointer(&config); } } =20 @@ -16872,7 +16872,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sna= pshot, } if (config) { virCPUDefFree(priv->origCPU); - VIR_STEAL_PTR(priv->origCPU, origCPU); + priv->origCPU =3D g_steal_pointer(&origCPU); } =20 if (cookie && !cookie->slirpHelper) @@ -18462,7 +18462,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, /* Update vm in place to match changes. */ need_unlink =3D false; virStorageFileDeinit(mirror); - VIR_STEAL_PTR(disk->mirror, mirror); + disk->mirror =3D g_steal_pointer(&mirror); disk->mirrorJob =3D VIR_DOMAIN_BLOCK_JOB_TYPE_COPY; qemuBlockJobStarted(job, vm); =20 @@ -18634,7 +18634,7 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *d= isk, const char *destxml, VIR_DOMAIN_DEF_PARSE_DISK_SOURCE= ))) goto cleanup; =20 - VIR_STEAL_PTR(dest, diskdef->src); + dest =3D g_steal_pointer(&diskdef->src); =20 ret =3D qemuDomainBlockCopyCommon(vm, dom->conn, disk, dest, bandwidth, granularity, buf_size, flags, false); @@ -18890,7 +18890,7 @@ qemuDomainBlockCommit(virDomainPtr dom, } =20 if (mirror) { - VIR_STEAL_PTR(disk->mirror, mirror); + disk->mirror =3D g_steal_pointer(&mirror); disk->mirrorJob =3D VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT; } qemuBlockJobStarted(job, vm); @@ -21608,7 +21608,7 @@ qemuDomainGetStats(virConnectPtr conn, return -1; =20 tmp->nparams =3D virTypedParamListStealParams(params, &tmp->params); - VIR_STEAL_PTR(*record, tmp); + *record =3D g_steal_pointer(&tmp); return 0; } =20 @@ -21916,7 +21916,7 @@ qemuGetDHCPInterfaces(virDomainPtr dom, VIR_FREE(leases); } =20 - VIR_STEAL_PTR(*ifaces, ifaces_ret); + *ifaces =3D g_steal_pointer(&ifaces_ret); rv =3D ifaces_count; =20 cleanup: @@ -21984,7 +21984,7 @@ qemuARPGetInterfaces(virDomainObjPtr vm, } } =20 - VIR_STEAL_PTR(*ifaces, ifaces_ret); + *ifaces =3D g_steal_pointer(&ifaces_ret); ret =3D ifaces_count; =20 cleanup: @@ -22700,7 +22700,7 @@ qemuGetSEVInfoToParams(virQEMUCapsPtr qemuCaps, sev->reduced_phys_bits) < 0) goto cleanup; =20 - VIR_STEAL_PTR(*params, sevParams); + *params =3D g_steal_pointer(&sevParams); *nparams =3D n; return 0; =20 diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 313c909aed..f614be6d14 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -325,7 +325,7 @@ qemuFirmwareInterfaceParse(const char *path, VIR_DEBUG("firmware description path '%s' supported interfaces: %s", path, NULLSTR_MINUS(virBufferCurrentContent(&buf))); =20 - VIR_STEAL_PTR(fw->interfaces, interfaces); + fw->interfaces =3D g_steal_pointer(&interfaces); fw->ninterfaces =3D ninterfaces; return 0; } @@ -553,10 +553,10 @@ qemuFirmwareTargetParse(const char *path, VIR_APPEND_ELEMENT_INPLACE(t->machines, t->nmachines, machineS= tr); } =20 - VIR_STEAL_PTR(targets[i], t); + targets[i] =3D g_steal_pointer(&t); } =20 - VIR_STEAL_PTR(fw->targets, targets); + fw->targets =3D g_steal_pointer(&targets); fw->ntargets =3D ntargets; ntargets =3D 0; ret =3D 0; @@ -606,7 +606,7 @@ qemuFirmwareFeatureParse(const char *path, features[i] =3D tmp; } =20 - VIR_STEAL_PTR(fw->features, features); + fw->features =3D g_steal_pointer(&features); fw->nfeatures =3D nfeatures; return 0; } @@ -648,7 +648,7 @@ qemuFirmwareParse(const char *path) if (qemuFirmwareFeatureParse(path, doc, fw) < 0) return NULL; =20 - VIR_STEAL_PTR(ret, fw); + ret =3D g_steal_pointer(&fw); return ret; } =20 @@ -698,7 +698,7 @@ qemuFirmwareFlashFileFormat(qemuFirmwareFlashFile flash) flash.format) < 0) return NULL; =20 - VIR_STEAL_PTR(ret, json); + ret =3D g_steal_pointer(&json); return ret; } =20 @@ -1203,9 +1203,9 @@ qemuFirmwareFetchParsedConfigs(bool privileged, goto error; } =20 - VIR_STEAL_PTR(*firmwaresRet, firmwares); + *firmwaresRet =3D g_steal_pointer(&firmwares); if (pathsRet) - VIR_STEAL_PTR(*pathsRet, paths); + *pathsRet =3D g_steal_pointer(&paths); return npaths; =20 error: diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index df6f3f9b55..bf301919cc 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3274,7 +3274,7 @@ qemuDomainAttachVsockDevice(virQEMUDriverPtr driver, goto cleanup; } =20 - VIR_STEAL_PTR(vm->def->vsock, vsock); + vm->def->vsock =3D g_steal_pointer(&vsock); =20 ret =3D 0; =20 @@ -6444,7 +6444,7 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr d= ef, } } =20 - VIR_STEAL_PTR(ret, map); + ret =3D g_steal_pointer(&map); =20 cleanup: virBitmapFree(map); diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index b34e47e473..882c6810a0 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -854,7 +854,7 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr= driver, if (qemuDomainObjExitMonitor(driver, vm) < 0 || mon_ret < 0) return -1; =20 - VIR_STEAL_PTR(diskPriv->migrSource, copysrc); + diskPriv->migrSource =3D g_steal_pointer(©src); =20 return 0; } @@ -3671,7 +3671,7 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, if (iothread) { qemuMigrationIOThreadPtr io; =20 - VIR_STEAL_PTR(io, iothread); + io =3D g_steal_pointer(&iothread); if (qemuMigrationSrcStopTunnel(io, false) < 0) goto error; } @@ -4150,7 +4150,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr dr= iver, VIR_MIGRATE_AUTO_CONVERGE); =20 VIR_DEBUG("Prepare3 %p", dconn); - VIR_STEAL_PTR(cookiein, cookieout); + cookiein =3D g_steal_pointer(&cookieout); cookieinlen =3D cookieoutlen; cookieoutlen =3D 0; if (flags & VIR_MIGRATE_TUNNELLED) { @@ -4218,7 +4218,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr dr= iver, VIR_DEBUG("Perform3 %p uri=3D%s", sconn, NULLSTR(uri)); qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_PERFORM3); VIR_FREE(cookiein); - VIR_STEAL_PTR(cookiein, cookieout); + cookiein =3D g_steal_pointer(&cookieout); cookieinlen =3D cookieoutlen; cookieoutlen =3D 0; if (flags & VIR_MIGRATE_TUNNELLED) { @@ -4259,7 +4259,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr dr= iver, */ VIR_DEBUG("Finish3 %p ret=3D%d", dconn, ret); VIR_FREE(cookiein); - VIR_STEAL_PTR(cookiein, cookieout); + cookiein =3D g_steal_pointer(&cookieout); cookieinlen =3D cookieoutlen; cookieoutlen =3D 0; =20 @@ -4339,7 +4339,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr dr= iver, */ VIR_DEBUG("Confirm3 %p cancelled=3D%d vm=3D%p", sconn, cancelled, vm); VIR_FREE(cookiein); - VIR_STEAL_PTR(cookiein, cookieout); + cookiein =3D g_steal_pointer(&cookieout); cookieinlen =3D cookieoutlen; cookieoutlen =3D 0; ret =3D qemuMigrationSrcConfirmPhase(driver, vm, @@ -5170,7 +5170,7 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver, =20 if (dom) { if (jobInfo) { - VIR_STEAL_PTR(priv->job.completed, jobInfo); + priv->job.completed =3D g_steal_pointer(&jobInfo); priv->job.completed->status =3D QEMU_DOMAIN_JOB_STATUS_COMPLET= ED; priv->job.completed->statsType =3D QEMU_DOMAIN_JOB_STATS_TYPE_= MIGRATION; } diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index e7556889cc..244ad4fdf3 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -1183,7 +1183,7 @@ qemuMigrationCookieCapsXMLParse(xmlXPathContextPtr ct= xt) VIR_FREE(automatic); } =20 - VIR_STEAL_PTR(ret, caps); + ret =3D g_steal_pointer(&caps); =20 cleanup: qemuMigrationCookieCapsFree(caps); diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 85fa8f8de5..159205527e 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -1335,7 +1335,7 @@ qemuMigrationParamsParse(xmlXPathContextPtr ctxt, break; =20 case QEMU_MIGRATION_PARAM_TYPE_STRING: - VIR_STEAL_PTR(pv->value.s, value); + pv->value.s =3D g_steal_pointer(&value); break; } =20 @@ -1351,7 +1351,7 @@ qemuMigrationParamsParse(xmlXPathContextPtr ctxt, VIR_FREE(value); } =20 - VIR_STEAL_PTR(*migParams, params); + *migParams =3D g_steal_pointer(¶ms); ret =3D 0; =20 cleanup: diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 33dae75e41..333acbe9b9 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1826,10 +1826,10 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQuer= yHotpluggableCpusEntry *hotpl vcpus[mastervcpu].thread_id =3D hotplugvcpus[i].thread_id; vcpus[mastervcpu].node_id =3D hotplugvcpus[i].node_id; vcpus[mastervcpu].vcpus =3D hotplugvcpus[i].vcpus; - VIR_STEAL_PTR(vcpus[mastervcpu].qom_path, hotplugvcpus[i].qom_path= ); - VIR_STEAL_PTR(vcpus[mastervcpu].alias, hotplugvcpus[i].alias); - VIR_STEAL_PTR(vcpus[mastervcpu].type, hotplugvcpus[i].type); - VIR_STEAL_PTR(vcpus[mastervcpu].props, hotplugvcpus[i].props); + vcpus[mastervcpu].qom_path =3D g_steal_pointer(&hotplugvcpus[i].qo= m_path); + vcpus[mastervcpu].alias =3D g_steal_pointer(&hotplugvcpus[i].alias= ); + vcpus[mastervcpu].type =3D g_steal_pointer(&hotplugvcpus[i].type); + vcpus[mastervcpu].props =3D g_steal_pointer(&hotplugvcpus[i].props= ); vcpus[mastervcpu].id =3D hotplugvcpus[i].enable_id; =20 /* copy state information to slave vcpus */ @@ -1922,7 +1922,7 @@ qemuMonitorGetCPUInfo(qemuMonitorPtr mon, =20 if (rc < 0) { if (!hotplug && rc =3D=3D -2) { - VIR_STEAL_PTR(*vcpus, info); + *vcpus =3D g_steal_pointer(&info); ret =3D 0; } =20 @@ -1939,7 +1939,7 @@ qemuMonitorGetCPUInfo(qemuMonitorPtr mon, qemuMonitorGetCPUInfoLegacy(cpuentries, ncpuentries, info, maxvcpu= s); } =20 - VIR_STEAL_PTR(*vcpus, info); + *vcpus =3D g_steal_pointer(&info); ret =3D 0; =20 cleanup: @@ -2997,7 +2997,7 @@ qemuMonitorAddObject(qemuMonitorPtr mon, *props =3D NULL; =20 if (alias) - VIR_STEAL_PTR(*alias, tmp); + *alias =3D g_steal_pointer(&tmp); =20 cleanup: VIR_FREE(tmp); @@ -4447,7 +4447,7 @@ qemuMonitorGetPRManagerInfo(qemuMonitorPtr mon, if (qemuMonitorJSONGetPRManagerInfo(mon, info) < 0) goto cleanup; =20 - VIR_STEAL_PTR(*retinfo, info); + *retinfo =3D g_steal_pointer(&info); ret =3D 0; cleanup: virHashFree(info); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 70edd04773..02308dffe6 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -1940,7 +1940,7 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr data, qemuMonitorJSONExtractCPUS390Info(entry, cpus + i); } =20 - VIR_STEAL_PTR(*entries, cpus); + *entries =3D g_steal_pointer(&cpus); *nentries =3D ncpus; ret =3D 0; =20 @@ -5791,7 +5791,7 @@ qemuMonitorJSONParseCPUModel(const char *cpu_name, goto cleanup; } =20 - VIR_STEAL_PTR(*model_info, machine_model); + *model_info =3D g_steal_pointer(&machine_model); ret =3D 0; =20 cleanup: @@ -6508,7 +6508,7 @@ qemuMonitorJSONGetStringListProperty(qemuMonitorPtr m= on, return -1; } =20 - VIR_STEAL_PTR(*strList, list); + *strList =3D g_steal_pointer(&list); return n; } =20 @@ -7021,7 +7021,7 @@ qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon, =20 capability->cbitpos =3D cbitpos; capability->reduced_phys_bits =3D reduced_phys_bits; - VIR_STEAL_PTR(*capabilities, capability); + *capabilities =3D g_steal_pointer(&capability); ret =3D 1; cleanup: virJSONValueFree(cmd); @@ -7867,9 +7867,9 @@ qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon, qemuMonitorJSONGetCPUDataDisabled(mon, translate, opaque, cpuDisab= led) < 0) goto cleanup; =20 - VIR_STEAL_PTR(*enabled, cpuEnabled); + *enabled =3D g_steal_pointer(&cpuEnabled); if (disabled) - VIR_STEAL_PTR(*disabled, cpuDisabled); + *disabled =3D g_steal_pointer(&cpuDisabled); =20 ret =3D 0; =20 @@ -8571,7 +8571,7 @@ qemuMonitorJSONGetHotpluggableCPUs(qemuMonitorPtr mon, =20 qsort(info, ninfo, sizeof(*info), qemuMonitorQueryHotpluggableCpusEntr= ySort); =20 - VIR_STEAL_PTR(*entries, info); + *entries =3D g_steal_pointer(&info); *nentries =3D ninfo; ret =3D 0; =20 @@ -9312,7 +9312,7 @@ qemuMonitorJSONGetJobInfoOne(virJSONValuePtr data) VIR_STRDUP(job->error, errmsg) < 0) return NULL; =20 - VIR_STEAL_PTR(ret, job); + ret =3D g_steal_pointer(&job); return ret; } =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b2d07cf279..724e950101 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1852,7 +1852,7 @@ qemuProcessHandleRdmaGidStatusChanged(qemuMonitorPtr = mon G_GNUC_UNUSED, =20 processEvent->eventType =3D QEMU_PROCESS_EVENT_RDMA_GID_STATUS_CHANGED; processEvent->vm =3D virObjectRef(vm); - VIR_STEAL_PTR(processEvent->data, info); + processEvent->data =3D g_steal_pointer(&info); =20 if (virThreadPoolSendJob(driver->workerPool, 0, processEvent) < 0) { qemuProcessEventFree(processEvent); @@ -4313,7 +4313,7 @@ qemuProcessUpdateLiveGuestCPU(virDomainObjPtr vm, * get the original CPU via migration, restore, or snapshot revert. */ if (!priv->origCPU && !virCPUDefIsEqual(def->cpu, orig, false)) - VIR_STEAL_PTR(priv->origCPU, orig); + priv->origCPU =3D g_steal_pointer(&orig); =20 def->cpu->check =3D VIR_CPU_CHECK_FULL; } @@ -5680,7 +5680,7 @@ qemuProcessInit(virQEMUDriverPtr driver, if (qemuDomainSetPrivatePaths(driver, vm) < 0) goto stop; =20 - VIR_STEAL_PTR(priv->origCPU, origCPU); + priv->origCPU =3D g_steal_pointer(&origCPU); } =20 ret =3D 0; @@ -6187,7 +6187,7 @@ qemuProcessPrepareDomainNUMAPlacement(virDomainObjPtr= vm, =20 virBitmapIntersect(numadNodeset, hostMemoryNodeset); =20 - VIR_STEAL_PTR(priv->autoNodeset, numadNodeset); + priv->autoNodeset =3D g_steal_pointer(&numadNodeset); =20 ret =3D 0; =20 @@ -8488,7 +8488,7 @@ qemuProcessQMPNew(const char *binary, proc->runGid =3D runGid; proc->forceTCG =3D forceTCG; =20 - VIR_STEAL_PTR(ret, proc); + ret =3D g_steal_pointer(&proc); =20 cleanup: qemuProcessQMPFree(proc); diff --git a/src/qemu/qemu_vhost_user.c b/src/qemu/qemu_vhost_user.c index 5bab7ff5fa..dfef6f20a3 100644 --- a/src/qemu/qemu_vhost_user.c +++ b/src/qemu/qemu_vhost_user.c @@ -206,7 +206,7 @@ qemuVhostUserParse(const char *path) if (qemuVhostUserBinaryParse(path, doc, vu) < 0) return NULL; =20 - VIR_STEAL_PTR(ret, vu); + ret =3D g_steal_pointer(&vu); return ret; } =20 @@ -264,9 +264,9 @@ qemuVhostUserFetchParsedConfigs(bool privileged, goto error; } =20 - VIR_STEAL_PTR(*vhostuserRet, vus); + *vhostuserRet =3D g_steal_pointer(&vus); if (pathsRet) - VIR_STEAL_PTR(*pathsRet, paths); + *pathsRet =3D g_steal_pointer(&paths); return npaths; =20 error: @@ -313,7 +313,7 @@ qemuVhostUserGPUFillCapabilities(qemuVhostUserPtr vu, features[i] =3D tmp; } =20 - VIR_STEAL_PTR(gpu->features, features); + gpu->features =3D g_steal_pointer(&features); gpu->nfeatures =3D nfeatures; =20 return 0; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:01:32 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571227783; cv=none; d=zoho.com; s=zohoarc; b=LzvcQoudHqNmXlB73p8n3jyzyCO+d7Jl770Eb7Cbp7K5jEwce3x7T7LoXq/webddxgf6/WbIGFxGAIFPOILycFgYSscnZK20Kp/uIp0J+IYwYPGykwwwzLvxabsfvbeeg8TMRq7x+6z+X2FZ1Z9kD1645vw1alZ3a0WI/VS0Ul0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571227783; h=Content-Type:Content-Transfer-Encoding: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=K1Y4zfBnuON99B7bYsAvxEYYnnJWKIXMQ/J43uj1SJU=; b=oWWxixj8LSv/wnu4yqBkq2q2d95bamv5TXyou3kwhtGDHtxvBc+xnCBliy2Ltrm6UgAGY9hC/p9qJ9KMCMUVZQWxCRCuLxHjW0MmiWEmiINCvg7laoqRzlKr4WiXYrTkR6uqNbJ6HrR8Fmu7O0oYdbqtX/Y5If61BLb3zEL+z78= ARC-Authentication-Results: i=1; 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; dmarc=pass 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 1571227783835918.7773453096298; Wed, 16 Oct 2019 05:09:43 -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 0F4A3307D97F; Wed, 16 Oct 2019 12:09:42 +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 D91591001DE4; Wed, 16 Oct 2019 12:09:41 +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 9255083706; Wed, 16 Oct 2019 12:09:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GC9LKB020958 for ; Wed, 16 Oct 2019 08:09:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 589D760166; Wed, 16 Oct 2019 12:09:21 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5495601AC for ; Wed, 16 Oct 2019 12:09:20 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 14:09:07 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/9] tools: use g_steal_pointer instead of VIR_STEAL_PTR 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-Type: text/plain; charset="utf-8" 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.48]); Wed, 16 Oct 2019 12:09:42 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- tools/virsh-completer-domain.c | 12 ++++++------ tools/virsh-completer-host.c | 4 ++-- tools/virsh-completer-interface.c | 2 +- tools/virsh-completer-network.c | 4 ++-- tools/virsh-completer-nodedev.c | 4 ++-- tools/virsh-completer-nwfilter.c | 4 ++-- tools/virsh-completer-pool.c | 4 ++-- tools/virsh-completer-secret.c | 4 ++-- tools/virsh-completer-snapshot.c | 2 +- tools/virsh-completer-volume.c | 2 +- tools/virsh-domain.c | 2 +- tools/virsh-snapshot.c | 2 +- tools/vsh.c | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index 16c209ab36..bb06f468d7 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -66,7 +66,7 @@ virshDomainNameCompleter(vshControl *ctl, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: for (i =3D 0; i < ndomains; i++) @@ -122,7 +122,7 @@ virshDomainInterfaceCompleter(vshControl *ctl, return NULL; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); return ret; } =20 @@ -162,7 +162,7 @@ virshDomainDiskTargetCompleter(vshControl *ctl, return NULL; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); return ret; } =20 @@ -186,7 +186,7 @@ virshDomainEventNameCompleter(vshControl *ctl G_GNUC_UN= USED, return NULL; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); return ret; } =20 @@ -249,7 +249,7 @@ virshDomainInterfaceStateCompleter(vshControl *ctl, return NULL; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); return ret; } =20 @@ -292,7 +292,7 @@ virshDomainDeviceAliasCompleter(vshControl *ctl, return NULL; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); return ret; } =20 diff --git a/tools/virsh-completer-host.c b/tools/virsh-completer-host.c index ce43818be3..42e59a6656 100644 --- a/tools/virsh-completer-host.c +++ b/tools/virsh-completer-host.c @@ -100,7 +100,7 @@ virshAllocpagesPagesizeCompleter(vshControl *ctl, return NULL; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); return ret; } =20 @@ -143,6 +143,6 @@ virshCellnoCompleter(vshControl *ctl, return NULL; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); return ret; } diff --git a/tools/virsh-completer-interface.c b/tools/virsh-completer-inte= rface.c index 24a69d30b9..6fae0f6584 100644 --- a/tools/virsh-completer-interface.c +++ b/tools/virsh-completer-interface.c @@ -57,7 +57,7 @@ virshInterfaceNameCompleter(vshControl *ctl, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: for (i =3D 0; i < nifaces; i++) diff --git a/tools/virsh-completer-network.c b/tools/virsh-completer-networ= k.c index 404260b20c..a3d8b71d19 100644 --- a/tools/virsh-completer-network.c +++ b/tools/virsh-completer-network.c @@ -59,7 +59,7 @@ virshNetworkNameCompleter(vshControl *ctl, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: for (i =3D 0; i < nnets; i++) @@ -88,7 +88,7 @@ virshNetworkEventNameCompleter(vshControl *ctl G_GNUC_UNU= SED, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: return ret; diff --git a/tools/virsh-completer-nodedev.c b/tools/virsh-completer-nodede= v.c index 9bd1d20945..899c199902 100644 --- a/tools/virsh-completer-nodedev.c +++ b/tools/virsh-completer-nodedev.c @@ -57,7 +57,7 @@ virshNodeDeviceNameCompleter(vshControl *ctl, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: for (i =3D 0; i < ndevs; i++) @@ -86,7 +86,7 @@ virshNodeDeviceEventNameCompleter(vshControl *ctl G_GNUC_= UNUSED, return NULL; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); return ret; } =20 diff --git a/tools/virsh-completer-nwfilter.c b/tools/virsh-completer-nwfil= ter.c index 5a86602101..5029becf09 100644 --- a/tools/virsh-completer-nwfilter.c +++ b/tools/virsh-completer-nwfilter.c @@ -55,7 +55,7 @@ virshNWFilterNameCompleter(vshControl *ctl, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: for (i =3D 0; i < nnwfilters; i++) @@ -95,7 +95,7 @@ virshNWFilterBindingNameCompleter(vshControl *ctl, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: for (i =3D 0; i < nbindings; i++) diff --git a/tools/virsh-completer-pool.c b/tools/virsh-completer-pool.c index e646d07e65..ceb73eed06 100644 --- a/tools/virsh-completer-pool.c +++ b/tools/virsh-completer-pool.c @@ -60,7 +60,7 @@ virshStoragePoolNameCompleter(vshControl *ctl, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: for (i =3D 0; i < npools; i++) @@ -89,7 +89,7 @@ virshPoolEventNameCompleter(vshControl *ctl G_GNUC_UNUSED, return NULL; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); return ret; } =20 diff --git a/tools/virsh-completer-secret.c b/tools/virsh-completer-secret.c index 38403f275a..a533ac178f 100644 --- a/tools/virsh-completer-secret.c +++ b/tools/virsh-completer-secret.c @@ -57,7 +57,7 @@ virshSecretUUIDCompleter(vshControl *ctl, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: for (i =3D 0; i < nsecrets; i++) @@ -86,6 +86,6 @@ virshSecretEventNameCompleter(vshControl *ctl G_GNUC_UNUS= ED, return NULL; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); return ret; } diff --git a/tools/virsh-completer-snapshot.c b/tools/virsh-completer-snaps= hot.c index cad56e2fba..14bd7bc6e4 100644 --- a/tools/virsh-completer-snapshot.c +++ b/tools/virsh-completer-snapshot.c @@ -62,7 +62,7 @@ virshSnapshotNameCompleter(vshControl *ctl, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: virshDomainFree(dom); diff --git a/tools/virsh-completer-volume.c b/tools/virsh-completer-volume.c index 2df0077d7a..f14570f23d 100644 --- a/tools/virsh-completer-volume.c +++ b/tools/virsh-completer-volume.c @@ -62,7 +62,7 @@ virshStorageVolNameCompleter(vshControl *ctl, goto cleanup; } =20 - VIR_STEAL_PTR(ret, tmp); + ret =3D g_steal_pointer(&tmp); =20 cleanup: virStoragePoolFree(pool); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index f46d30341d..3ba8451470 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8441,7 +8441,7 @@ cmdDesc(vshControl *ctl, const vshCmd *cmd) } =20 VIR_FREE(desc); - VIR_STEAL_PTR(desc, desc_edited); + desc =3D g_steal_pointer(&desc_edited); } =20 if (virDomainSetMetadata(dom, type, desc, NULL, NULL, flags) < 0) { diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index b5e5c234cc..eae19ecd27 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -1380,7 +1380,7 @@ virshSnapshotListCollect(vshControl *ctl, virDomainPt= r dom, virshSnapSorter); snaplist->nsnaps -=3D deleted; =20 - VIR_STEAL_PTR(ret, snaplist); + ret =3D g_steal_pointer(&snaplist); =20 cleanup: virshSnapshotListFree(snaplist); diff --git a/tools/vsh.c b/tools/vsh.c index a9b2a84122..ee675a63cc 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2796,7 +2796,7 @@ vshCompleterFilter(char ***list, continue; } =20 - VIR_STEAL_PTR(newList[newList_len], (*list)[i]); + newList[newList_len] =3D g_steal_pointer(&(*list)[i]); newList_len++; } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:01:32 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571227767; cv=none; d=zoho.com; s=zohoarc; b=IeCC075LeGJ8Jg5OBR45lIvkF/nLMCU10fZvFPHdgpaVYrTMCbtV5RuE2Taj++SkXLCY7vBARx9GPsV+zDyMlU78meP/ONRl2xgrJU+SwAirOV1ECM/aHh20i3kU6wvodZGmbgw7uPjCKQwXNmQBqlmTDTk8WXxjULy3x+m+geo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571227767; h=Content-Type:Content-Transfer-Encoding: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=3E2LFSImuHO6PumpAg2SED4T1B7HNGtrnx8qmO+lPVw=; b=aH/dFNFfZBjNeRLTBe+5KixsEpuPvFy2KoYHy1C+vNPCCzh4GtiEQu0npLw8E2wsmvcLrcyKCMSDz8h38kehRuBI7P8pIix9BnnDWQHIiCGFWCtMsrl8LnymaXYpcoammtG9S/alBh6YCLII0j65wLvvy+8JTGyI6a44U5PCmgY= ARC-Authentication-Results: i=1; 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; dmarc=pass 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 1571227767592322.0740714094195; Wed, 16 Oct 2019 05:09:27 -0700 (PDT) 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 BADEE85360; Wed, 16 Oct 2019 12:09:25 +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 8C7C15C1D8; Wed, 16 Oct 2019 12:09:25 +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 3D22D83733; Wed, 16 Oct 2019 12:09:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GC9MiY020971 for ; Wed, 16 Oct 2019 08:09:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2A4DF60166; Wed, 16 Oct 2019 12:09:22 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5F286031F for ; Wed, 16 Oct 2019 12:09:21 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 14:09:08 +0200 Message-Id: <6da3a8990c5d93c241c443cdc6d6913110394021.1571227709.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/9] util: use g_steal_pointer instead of VIR_STEAL_PTR 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-Type: text/plain; charset="utf-8" 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.25]); Wed, 16 Oct 2019 12:09:26 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/util/vircgroupv1.c | 4 ++-- src/util/vircgroupv2.c | 2 +- src/util/virdbus.c | 12 +++++------ src/util/virdevmapper.c | 2 +- src/util/virerror.c | 2 +- src/util/virfile.c | 2 +- src/util/virfilecache.c | 2 +- src/util/virhostdev.c | 2 +- src/util/viriscsi.c | 4 ++-- src/util/virjson.c | 4 ++-- src/util/virmdev.c | 6 +++--- src/util/virnetdevtap.c | 2 +- src/util/virnetlink.c | 6 +++--- src/util/virnuma.c | 4 ++-- src/util/virpci.c | 4 ++-- src/util/virresctrl.c | 10 ++++----- src/util/virrotatingfile.c | 2 +- src/util/virscsi.c | 2 +- src/util/virscsivhost.c | 2 +- src/util/virstorageencryption.c | 2 +- src/util/virstoragefile.c | 36 ++++++++++++++++----------------- src/util/virtypedparam.c | 2 +- 22 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c index d23045331e..6ab79a1897 100644 --- a/src/util/vircgroupv1.c +++ b/src/util/vircgroupv1.c @@ -264,7 +264,7 @@ virCgroupV1ResolveMountLink(const char *mntDir, VIR_WARN("Expecting a symlink at %s for controller %s", linkSrc, typeStr); } else { - VIR_STEAL_PTR(controller->linkPoint, linkSrc); + controller->linkPoint =3D g_steal_pointer(&linkSrc); } } =20 @@ -412,7 +412,7 @@ virCgroupV1StealPlacement(virCgroupPtr group) { char *ret =3D NULL; =20 - VIR_STEAL_PTR(ret, group->legacy[VIR_CGROUP_CONTROLLER_SYSTEMD].placem= ent); + ret =3D g_steal_pointer(&group->legacy[VIR_CGROUP_CONTROLLER_SYSTEMD].= placement); =20 return ret; } diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 403b3b145e..621ab71eb5 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -244,7 +244,7 @@ virCgroupV2StealPlacement(virCgroupPtr group) { char *ret; =20 - VIR_STEAL_PTR(ret, group->unified.placement); + ret =3D g_steal_pointer(&group->unified.placement); =20 return ret; } diff --git a/src/util/virdbus.c b/src/util/virdbus.c index f423305e11..f54c917c03 100644 --- a/src/util/virdbus.c +++ b/src/util/virdbus.c @@ -762,7 +762,7 @@ virDBusMessageIterEncode(DBusMessageIter *rootiter, goto cleanup; } VIR_FREE(contsig); - VIR_STEAL_PTR(iter, newiter); + iter =3D g_steal_pointer(&newiter); types =3D t + 1; nstruct =3D skiplen; narray =3D (size_t)va_arg(args, int); @@ -788,7 +788,7 @@ virDBusMessageIterEncode(DBusMessageIter *rootiter, VIR_FREE(newiter); goto cleanup; } - VIR_STEAL_PTR(iter, newiter); + iter =3D g_steal_pointer(&newiter); types =3D vsig; nstruct =3D strlen(types); narray =3D (size_t)-1; @@ -819,7 +819,7 @@ virDBusMessageIterEncode(DBusMessageIter *rootiter, goto cleanup; } VIR_FREE(contsig); - VIR_STEAL_PTR(iter, newiter); + iter =3D g_steal_pointer(&newiter); types =3D t + 1; nstruct =3D skiplen - 2; narray =3D (size_t)-1; @@ -1056,7 +1056,7 @@ virDBusMessageIterDecode(DBusMessageIter *rootiter, nstruct, narray) < 0) goto cleanup; VIR_FREE(contsig); - VIR_STEAL_PTR(iter, newiter); + iter =3D g_steal_pointer(&newiter); types =3D t + 1; nstruct =3D skiplen; if (arrayref) { @@ -1086,7 +1086,7 @@ virDBusMessageIterDecode(DBusMessageIter *rootiter, VIR_DEBUG("Push failed"); goto cleanup; } - VIR_STEAL_PTR(iter, newiter); + iter =3D g_steal_pointer(&newiter); types =3D vsig; nstruct =3D strlen(types); narray =3D (size_t)-1; @@ -1113,7 +1113,7 @@ virDBusMessageIterDecode(DBusMessageIter *rootiter, nstruct, narray) < 0) goto cleanup; VIR_FREE(contsig); - VIR_STEAL_PTR(iter, newiter); + iter =3D g_steal_pointer(&newiter); types =3D t + 1; nstruct =3D skiplen - 2; narray =3D (size_t)-1; diff --git a/src/util/virdevmapper.c b/src/util/virdevmapper.c index 1abd8044e7..a9996b067c 100644 --- a/src/util/virdevmapper.c +++ b/src/util/virdevmapper.c @@ -150,7 +150,7 @@ virDevMapperGetTargetsImpl(const char *path, if (virStringListMerge(&devPaths, &recursiveDevPaths) < 0) goto cleanup; =20 - VIR_STEAL_PTR(*devPaths_ret, devPaths); + *devPaths_ret =3D g_steal_pointer(&devPaths); ret =3D 0; cleanup: virStringListFree(recursiveDevPaths); diff --git a/src/util/virerror.c b/src/util/virerror.c index f02d6f3b8a..b45c53b7df 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -1497,7 +1497,7 @@ virLastErrorPrefixMessage(const char *fmt, ...) goto cleanup; =20 VIR_FREE(err->message); - VIR_STEAL_PTR(err->message, newmsg); + err->message =3D g_steal_pointer(&newmsg); =20 cleanup: va_end(args); diff --git a/src/util/virfile.c b/src/util/virfile.c index e0b6398823..2fb389eeb2 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -4437,7 +4437,7 @@ virFileGetXAttrQuiet(const char *path, break; } =20 - VIR_STEAL_PTR(*value, buf); + *value =3D g_steal_pointer(&buf); ret =3D 0; cleanup: VIR_FREE(buf); diff --git a/src/util/virfilecache.c b/src/util/virfilecache.c index 823d5e15e0..3a99dc210b 100644 --- a/src/util/virfilecache.c +++ b/src/util/virfilecache.c @@ -169,7 +169,7 @@ virFileCacheLoad(virFileCachePtr cache, VIR_DEBUG("Loaded cached data '%s' for '%s'", file, name); =20 ret =3D 1; - VIR_STEAL_PTR(*data, loadData); + *data =3D g_steal_pointer(&loadData); =20 cleanup: virObjectUnref(loadData); diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 2a4a095347..6b29bb1a73 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -257,7 +257,7 @@ virHostdevGetPCIHostDevice(const virDomainHostdevDef *h= ostdev, return -1; } =20 - VIR_STEAL_PTR(*pci, actual); + *pci =3D g_steal_pointer(&actual); return 0; } =20 diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c index 50e8e7afc5..dc553e7752 100644 --- a/src/util/viriscsi.c +++ b/src/util/viriscsi.c @@ -178,7 +178,7 @@ virStorageBackendIQNFound(const char *initiatoriqn, goto cleanup; =20 if (STREQ(iqn, initiatoriqn)) { - VIR_STEAL_PTR(*ifacename, iface); + *ifacename =3D g_steal_pointer(&iface); =20 VIR_DEBUG("Found interface '%s' with IQN '%s'", *ifacename, iq= n); break; @@ -266,7 +266,7 @@ virStorageBackendCreateIfaceIQN(const char *initiatoriq= n, iface_name, initiatoriqn); } =20 - VIR_STEAL_PTR(*ifacename, iface_name); + *ifacename =3D g_steal_pointer(&iface_name); =20 return 0; } diff --git a/src/util/virjson.c b/src/util/virjson.c index c1476bfbbe..d3e6c9e41d 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -880,7 +880,7 @@ virJSONValueObjectSteal(virJSONValuePtr object, =20 for (i =3D 0; i < object->data.object.npairs; i++) { if (STREQ(object->data.object.pairs[i].key, key)) { - VIR_STEAL_PTR(obj, object->data.object.pairs[i].value); + obj =3D g_steal_pointer(&object->data.object.pairs[i].value); VIR_FREE(object->data.object.pairs[i].key); VIR_DELETE_ELEMENT(object->data.object.pairs, i, object->data.object.npairs); @@ -2155,7 +2155,7 @@ virJSONValueObjectDeflatten(virJSONValuePtr json) deflattened) < 0) return NULL; =20 - VIR_STEAL_PTR(ret, deflattened); + ret =3D g_steal_pointer(&deflattened); =20 return ret; } diff --git a/src/util/virmdev.c b/src/util/virmdev.c index 31fd961277..7e70ceb658 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -156,7 +156,7 @@ virMediatedDeviceNew(const char *uuidstr, virMediatedDe= viceModelType model) if (VIR_ALLOC(dev) < 0) return NULL; =20 - VIR_STEAL_PTR(dev->path, sysfspath); + dev->path =3D g_steal_pointer(&sysfspath); =20 /* Check whether the user-provided model corresponds with the actually * supported mediated device's API. @@ -165,7 +165,7 @@ virMediatedDeviceNew(const char *uuidstr, virMediatedDe= viceModelType model) return NULL; =20 dev->model =3D model; - VIR_STEAL_PTR(ret, dev); + ret =3D g_steal_pointer(&dev); =20 return ret; } @@ -521,7 +521,7 @@ virMediatedDeviceTypeReadAttrs(const char *sysfspath, =20 #undef MDEV_GET_SYSFS_ATTR =20 - VIR_STEAL_PTR(*type, tmp); + *type =3D g_steal_pointer(&tmp); =20 return 0; } diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index b4637a91f9..8ca4626a90 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -399,7 +399,7 @@ int virNetDevTapCreate(char **ifname, goto cleanup; =20 if (virNetDevExists(newname) =3D=3D 0) { - VIR_STEAL_PTR(newifname, newname); + newifname =3D g_steal_pointer(&newname); break; } } diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 90049b58a1..ab41b57672 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -317,7 +317,7 @@ int virNetlinkCommand(struct nl_msg *nl_msg, return -1; } =20 - VIR_STEAL_PTR(*resp, temp_resp); + *resp =3D g_steal_pointer(&temp_resp); *respbuflen =3D len; return 0; } @@ -466,7 +466,7 @@ virNetlinkDumpLink(const char *ifname, int ifindex, goto malformed_resp; } =20 - VIR_STEAL_PTR(*nlData, resp); + *nlData =3D g_steal_pointer(&resp); return 0; =20 malformed_resp: @@ -737,7 +737,7 @@ virNetlinkGetNeighbor(void **nlData, uint32_t src_pid, = uint32_t dst_pid) goto malformed_resp; } =20 - VIR_STEAL_PTR(*nlData, resp); + *nlData =3D g_steal_pointer(&resp); return recvbuflen; =20 malformed_resp: diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 6f3f0420d2..8f50634c2a 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -293,7 +293,7 @@ virNumaGetNodeCPUs(int node, } } =20 - VIR_STEAL_PTR(*cpus, cpumap); + *cpus =3D g_steal_pointer(&cpumap); return ncpus; } # undef MASK_CPU_ISSET @@ -337,7 +337,7 @@ virNumaNodesetToCPUset(virBitmapPtr nodeset, return -1; } =20 - VIR_STEAL_PTR(*cpuset, allNodesCPUs); + *cpuset =3D g_steal_pointer(&allNodesCPUs); =20 return 0; } diff --git a/src/util/virpci.c b/src/util/virpci.c index d173b29476..2c54c8baa1 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -489,7 +489,7 @@ virPCIDeviceIterDevices(virPCIDeviceIterPredicate predi= cate, break; } else if (rc =3D=3D 1) { VIR_DEBUG("%s %s: iter matched on %s", dev->id, dev->name, che= ck->name); - VIR_STEAL_PTR(*matched, check); + *matched =3D g_steal_pointer(&check); ret =3D 1; break; } @@ -2648,7 +2648,7 @@ virPCIGetMdevTypes(const char *sysfspath, if (dirret < 0) goto cleanup; =20 - VIR_STEAL_PTR(*types, mdev_types); + *types =3D g_steal_pointer(&mdev_types); ret =3D ntypes; ntypes =3D 0; cleanup: diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 9b50c09221..ab650b59b9 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -610,7 +610,7 @@ virResctrlGetCacheInfo(virResctrlInfoPtr resctrl, goto cleanup; } =20 - VIR_STEAL_PTR(i_level->types[type], i_type); + i_level->types[type] =3D g_steal_pointer(&i_type); } =20 ret =3D 0; @@ -666,7 +666,7 @@ virResctrlGetMemoryBandwidthInfo(virResctrlInfoPtr resc= trl) if (rv < 0) goto cleanup; =20 - VIR_STEAL_PTR(resctrl->membw_info, i_membw); + resctrl->membw_info =3D g_steal_pointer(&i_membw); ret =3D 0; cleanup: VIR_FREE(i_membw); @@ -748,8 +748,8 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl) VIR_DEBUG("Resctrl supported %zd monitoring features", nfeatures); =20 info_monitor->nfeatures =3D nfeatures; - VIR_STEAL_PTR(info_monitor->features, features); - VIR_STEAL_PTR(resctrl->monitor_info, info_monitor); + info_monitor->features =3D g_steal_pointer(&features); + resctrl->monitor_info =3D g_steal_pointer(&info_monitor); =20 ret =3D 0; cleanup: @@ -1025,7 +1025,7 @@ virResctrlInfoGetMonitorPrefix(virResctrlInfoPtr resc= trl, goto cleanup; } =20 - VIR_STEAL_PTR(*monitor, mon); + *monitor =3D g_steal_pointer(&mon); cleanup: virResctrlInfoMonFree(mon); return ret; diff --git a/src/util/virrotatingfile.c b/src/util/virrotatingfile.c index 7a268319a6..1171d3b153 100644 --- a/src/util/virrotatingfile.c +++ b/src/util/virrotatingfile.c @@ -406,7 +406,7 @@ virRotatingFileWriterRollover(virRotatingFileWriterPtr = file) } =20 VIR_FREE(nextpath); - VIR_STEAL_PTR(nextpath, thispath); + nextpath =3D g_steal_pointer(&thispath); } } =20 diff --git a/src/util/virscsi.c b/src/util/virscsi.c index 425d7adfe9..17e8aa1daa 100644 --- a/src/util/virscsi.c +++ b/src/util/virscsi.c @@ -238,7 +238,7 @@ virSCSIDeviceNew(const char *sysfs_prefix, if (virAsprintf(&dev->id, "%s:%s", vendor, model) < 0) return NULL; =20 - VIR_STEAL_PTR(ret, dev); + ret =3D g_steal_pointer(&dev); return ret; } =20 diff --git a/src/util/virscsivhost.c b/src/util/virscsivhost.c index 9ba0d3f2a0..0bcd8902a4 100644 --- a/src/util/virscsivhost.c +++ b/src/util/virscsivhost.c @@ -269,7 +269,7 @@ virSCSIVHostDeviceNew(const char *name) =20 VIR_DEBUG("%s: initialized", dev->name); =20 - VIR_STEAL_PTR(ret, dev); + ret =3D g_steal_pointer(&dev); =20 return ret; } diff --git a/src/util/virstorageencryption.c b/src/util/virstorageencryptio= n.c index 49df7fddd8..14d7dc26e2 100644 --- a/src/util/virstorageencryption.c +++ b/src/util/virstorageencryption.c @@ -310,7 +310,7 @@ virStorageEncryptionParseNode(xmlNodePtr node, } } =20 - VIR_STEAL_PTR(ret, encdef); + ret =3D g_steal_pointer(&encdef); =20 cleanup: VIR_FREE(format_str); diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index ac0c70b21e..e04cc413a4 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1141,7 +1141,7 @@ virStorageFileMetadataNew(const char *path, if (VIR_STRDUP(def->path, path) < 0) return NULL; =20 - VIR_STEAL_PTR(ret, def); + ret =3D g_steal_pointer(&def); return ret; } =20 @@ -1240,7 +1240,7 @@ virStorageFileGetMetadataFromFD(const char *path, * update the metadata.*/ meta->type =3D VIR_STORAGE_TYPE_DIR; meta->format =3D VIR_STORAGE_FILE_DIR; - VIR_STEAL_PTR(ret, meta); + ret =3D g_steal_pointer(&meta); return ret; } =20 @@ -1262,7 +1262,7 @@ virStorageFileGetMetadataFromFD(const char *path, else if (S_ISBLK(sb.st_mode)) meta->type =3D VIR_STORAGE_TYPE_BLOCK; =20 - VIR_STEAL_PTR(ret, meta); + ret =3D g_steal_pointer(&meta); return ret; } =20 @@ -1867,7 +1867,7 @@ virStorageAuthDefCopy(const virStorageAuthDef *src) if (virSecretLookupDefCopy(&authdef->seclookupdef, &src->seclookupdef)= < 0) return NULL; =20 - VIR_STEAL_PTR(ret, authdef); + ret =3D g_steal_pointer(&authdef); return ret; } =20 @@ -1924,7 +1924,7 @@ virStorageAuthDefParse(xmlNodePtr node, if (virSecretLookupParseSecret(secretnode, &authdef->seclookupdef) < 0) goto cleanup; =20 - VIR_STEAL_PTR(ret, authdef); + ret =3D g_steal_pointer(&authdef); =20 cleanup: ctxt->node =3D saveNode; @@ -2028,8 +2028,8 @@ virStoragePRDefParseXML(xmlXPathContextPtr ctxt) goto cleanup; } =20 - VIR_STEAL_PTR(prd->path, path); - VIR_STEAL_PTR(ret, prd); + prd->path =3D g_steal_pointer(&path); + ret =3D g_steal_pointer(&prd); =20 cleanup: virStoragePRDefFree(prd); @@ -2113,7 +2113,7 @@ virStoragePRDefCopy(virStoragePRDefPtr src) VIR_STRDUP(copy->mgralias, src->mgralias) < 0) goto cleanup; =20 - VIR_STEAL_PTR(ret, copy); + ret =3D g_steal_pointer(©); =20 cleanup: virStoragePRDefFree(copy); @@ -2346,7 +2346,7 @@ virStorageSourceCopy(const virStorageSource *src, return NULL; } =20 - VIR_STEAL_PTR(ret, def); + ret =3D g_steal_pointer(&def); return ret; } =20 @@ -2671,7 +2671,7 @@ virStorageSourceNewFromBackingRelative(virStorageSour= cePtr parent, def->type =3D VIR_STORAGE_TYPE_FILE; } =20 - VIR_STEAL_PTR(ret, def); + ret =3D g_steal_pointer(&def); return ret; } =20 @@ -2854,7 +2854,7 @@ virStorageSourceParseRBDColonString(const char *rbdst= r, =20 /* pool vs. image name */ if ((p =3D strchr(src->path, '/'))) { - VIR_STEAL_PTR(src->volume, src->path); + src->volume =3D g_steal_pointer(&src->path); if (VIR_STRDUP(src->path, p + 1) < 0) return -1; *p =3D '\0'; @@ -2897,7 +2897,7 @@ virStorageSourceParseRBDColonString(const char *rbdst= r, if (VIR_STRDUP(authdef->secrettype, virSecretUsageTypeToString(VIR_SECRET_USAGE_TYP= E_CEPH)) < 0) return -1; - VIR_STEAL_PTR(src->auth, authdef); + src->auth =3D g_steal_pointer(&authdef); src->authInherited =3D true; =20 /* Cannot formulate a secretType (eg, usage or uuid) given @@ -3720,7 +3720,7 @@ virStorageSourceNewFromBackingAbsolute(const char *pa= th, } } =20 - VIR_STEAL_PTR(*src, def); + *src =3D g_steal_pointer(&def); return rc; } =20 @@ -3779,7 +3779,7 @@ virStorageSourceNewFromChild(virStorageSourcePtr pare= nt, =20 def->detected =3D true; =20 - VIR_STEAL_PTR(*child, def); + *child =3D g_steal_pointer(&def); return rc; } =20 @@ -4266,7 +4266,7 @@ virStorageFileGetRelativeBackingPath(virStorageSource= Ptr top, return -1; } =20 - VIR_STEAL_PTR(*relpath, path); + *relpath =3D g_steal_pointer(&path); return 0; } =20 @@ -5025,7 +5025,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr = src, goto cleanup; } =20 - VIR_STEAL_PTR(src->backingStore, backingStore); + src->backingStore =3D g_steal_pointer(&backingStore); =20 if (src->externalDataStoreRaw) { g_autoptr(virStorageSource) externalDataStore =3D NULL; @@ -5040,7 +5040,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr = src, goto cleanup; } =20 - VIR_STEAL_PTR(src->externalDataStore, externalDataStore); + src->externalDataStore =3D g_steal_pointer(&externalDataStore); } =20 ret =3D 0; @@ -5150,6 +5150,6 @@ virStorageFileGetBackingStoreStr(virStorageSourcePtr = src, if (virStorageFileGetMetadataInternal(tmp, buf, headerLen, NULL) < 0) return -1; =20 - VIR_STEAL_PTR(*backing, tmp->backingStoreRaw); + *backing =3D g_steal_pointer(&tmp->backingStoreRaw); return 0; } diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index a9dfa85be2..2cd7e81bdd 100644 --- a/src/util/virtypedparam.c +++ b/src/util/virtypedparam.c @@ -761,7 +761,7 @@ virTypedParamListStealParams(virTypedParamListPtr list, { size_t ret =3D list->npar; =20 - VIR_STEAL_PTR(*params, list->par); + *params =3D g_steal_pointer(&list->par); list->npar =3D 0; list->par_alloc =3D 0; =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:01:32 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571227771; cv=none; d=zoho.com; s=zohoarc; b=iz7kzGrK6RPMzZ0nYtgmAyHmxim3Daz3B43wSmHJ0IHvebecV6vW0acWlR9cbFLX8q1kZq7j9kOLaFkTeqoJ/TFKKe12XQAtOXVXgh867z7wT4Dk+RSWhyUsUbsEsuWHRkxbdrcvmfxFmR0+swnxs7D4Req4l72w9sX0wHL0OOk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571227771; h=Content-Type:Content-Transfer-Encoding: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=TV2MKcgKdq4hzBdYE0WRvDgUdciXXRgL0lTnJ/cjs8g=; b=HU8XUI7YsJlYEHz07vrndsO4HL0BiuTOUKOGGAhG9LtxwVIHexoiQdkBP4kh/2gxXS/WNUAYdSY/snpdgEXYCSjNZPP1ah8rZOxkQUvc4fbGts0oMdSHcL5utaVFAK0u4CgREhkkevwyHoBFViR5T54XF677JdXZ3ampiRi2/lo= ARC-Authentication-Results: i=1; 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; dmarc=pass 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 1571227771172359.9756917736737; Wed, 16 Oct 2019 05:09:31 -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 46402801687; Wed, 16 Oct 2019 12:09:29 +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 165C11001B30; Wed, 16 Oct 2019 12:09:29 +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 C67D3180BA9A; Wed, 16 Oct 2019 12:09:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GC9Mcm020981 for ; Wed, 16 Oct 2019 08:09:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id EFA8C60166; Wed, 16 Oct 2019 12:09:22 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77F006031F for ; Wed, 16 Oct 2019 12:09:22 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 14:09:09 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 8/9] Use g_steal_pointer instead of VIR_STEAL_PTR everywhere 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-Type: text/plain; charset="utf-8" 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.6.2 (mx1.redhat.com [10.5.110.67]); Wed, 16 Oct 2019 12:09:29 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/admin/admin_remote.c | 2 +- src/admin/admin_server_dispatch.c | 2 +- src/bhyve/bhyve_domain.c | 2 +- src/cpu/cpu_x86.c | 4 ++-- src/libvirt-domain.c | 8 ++++---- src/libxl/xen_common.c | 2 +- src/locking/lock_driver_lockd.c | 6 +++--- src/network/bridge_driver.c | 2 +- src/phyp/phyp_driver.c | 2 +- src/remote/remote_driver.c | 8 ++++---- src/rpc/virnetlibsshsession.c | 2 +- src/secret/secret_driver.c | 4 ++-- src/security/security_manager.c | 4 ++-- src/security/virt-aa-helper.c | 4 ++-- src/storage/storage_backend_fs.c | 2 +- src/storage/storage_backend_gluster.c | 4 ++-- src/storage/storage_backend_iscsi_direct.c | 4 ++-- src/storage/storage_backend_logical.c | 4 ++-- src/storage/storage_backend_rbd.c | 6 +++--- src/storage/storage_backend_scsi.c | 2 +- src/storage/storage_driver.c | 4 ++-- src/storage/storage_file_gluster.c | 2 +- src/storage/storage_util.c | 8 ++++---- src/test/test_driver.c | 20 ++++++++++---------- src/vbox/vbox_common.c | 6 +++--- src/vmx/vmx.c | 2 +- src/vz/vz_driver.c | 8 ++++---- src/vz/vz_sdk.c | 4 ++-- tests/networkxml2conftest.c | 2 +- tests/qemuagenttest.c | 4 ++-- tests/qemublocktest.c | 2 +- tests/qemusecuritytest.c | 2 +- tests/testutilsqemu.c | 2 +- tests/virstoragetest.c | 2 +- 34 files changed, 71 insertions(+), 71 deletions(-) diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c index 8e0752746c..ca5e0c9fe4 100644 --- a/src/admin/admin_remote.c +++ b/src/admin/admin_remote.c @@ -451,7 +451,7 @@ remoteAdminConnectGetLoggingOutputs(virAdmConnectPtr co= nn, goto done; =20 if (outputs) - VIR_STEAL_PTR(*outputs, ret.outputs); + *outputs =3D g_steal_pointer(&ret.outputs); =20 rv =3D ret.noutputs; xdr_free((xdrproc_t) xdr_admin_connect_get_logging_outputs_ret, (char = *) &ret); diff --git a/src/admin/admin_server_dispatch.c b/src/admin/admin_server_dis= patch.c index 4cc41428ed..e56da3ba9f 100644 --- a/src/admin/admin_server_dispatch.c +++ b/src/admin/admin_server_dispatch.c @@ -490,7 +490,7 @@ adminDispatchConnectGetLoggingOutputs(virNetServerPtr s= erver G_GNUC_UNUSED, return -1; } =20 - VIR_STEAL_PTR(ret->outputs, outputs); + ret->outputs =3D g_steal_pointer(&outputs); ret->noutputs =3D noutputs; =20 return 0; diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index bc506bad66..7d24bb602f 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -223,7 +223,7 @@ bhyveDomainDefNamespaceParse(xmlXPathContextPtr ctxt, cmd->num_args++; } =20 - VIR_STEAL_PTR(*data, cmd); + *data =3D g_steal_pointer(&cmd); ret =3D 0; =20 cleanup: diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 7a52ab5d4f..3de99ca057 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2218,8 +2218,8 @@ x86Decode(virCPUDefPtr cpu, VIR_DEBUG("Using CPU model %s (signatures %s) for CPU with signature %= 06lx", model->name, NULLSTR(sigs), (unsigned long)signature); =20 - VIR_STEAL_PTR(cpu->model, cpuModel->model); - VIR_STEAL_PTR(cpu->features, cpuModel->features); + cpu->model =3D g_steal_pointer(&cpuModel->model); + cpu->features =3D g_steal_pointer(&cpuModel->features); cpu->nfeatures =3D cpuModel->nfeatures; cpuModel->nfeatures =3D 0; cpu->nfeatures_max =3D cpuModel->nfeatures_max; diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 68e8ffff3c..dcab179e6e 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -3047,7 +3047,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, VIR_MIGRATE_AUTO_CONVERGE); =20 VIR_DEBUG("Prepare3 %p flags=3D0x%x", dconn, destflags); - VIR_STEAL_PTR(cookiein, cookieout); + cookiein =3D g_steal_pointer(&cookieout); cookieinlen =3D cookieoutlen; cookieoutlen =3D 0; if (useParams) { @@ -3111,7 +3111,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, */ VIR_DEBUG("Perform3 %p uri=3D%s", domain->conn, uri); VIR_FREE(cookiein); - VIR_STEAL_PTR(cookiein, cookieout); + cookiein =3D g_steal_pointer(&cookieout); cookieinlen =3D cookieoutlen; cookieoutlen =3D 0; /* dconnuri not relevant in non-P2P modes, so left NULL here */ @@ -3149,7 +3149,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, */ VIR_DEBUG("Finish3 %p ret=3D%d", dconn, ret); VIR_FREE(cookiein); - VIR_STEAL_PTR(cookiein, cookieout); + cookiein =3D g_steal_pointer(&cookieout); cookieinlen =3D cookieoutlen; cookieoutlen =3D 0; if (useParams) { @@ -3225,7 +3225,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, if (notify_source) { VIR_DEBUG("Confirm3 %p ret=3D%d domain=3D%p", domain->conn, ret, d= omain); VIR_FREE(cookiein); - VIR_STEAL_PTR(cookiein, cookieout); + cookiein =3D g_steal_pointer(&cookieout); cookieinlen =3D cookieoutlen; cookieoutlen =3D 0; if (useParams) { diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index 88d6189eae..1a36a632aa 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -1306,7 +1306,7 @@ xenParseVif(char *entry, const char *vif_typename) net->bandwidth =3D bandwidth; } =20 - VIR_STEAL_PTR(ret, net); + ret =3D g_steal_pointer(&net); =20 cleanup: virDomainNetDefFree(net); diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lock= d.c index 47b49add66..8277e5ba92 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -463,7 +463,7 @@ static int virLockManagerLockDaemonNew(virLockManagerPt= r lock, goto cleanup; } =20 - VIR_STEAL_PTR(lock->privateData, priv); + lock->privateData =3D g_steal_pointer(&priv); ret =3D 0; cleanup: virLockManagerLockDaemonPrivateFree(priv); @@ -601,8 +601,8 @@ static int virLockManagerLockDaemonAddResource(virLockM= anagerPtr lock, if (VIR_EXPAND_N(priv->resources, priv->nresources, 1) < 0) goto cleanup; =20 - VIR_STEAL_PTR(priv->resources[priv->nresources-1].lockspace, newLocksp= ace); - VIR_STEAL_PTR(priv->resources[priv->nresources-1].name, newName); + priv->resources[priv->nresources-1].lockspace =3D g_steal_pointer(&new= Lockspace); + priv->resources[priv->nresources-1].name =3D g_steal_pointer(&newName); =20 if (flags & VIR_LOCK_MANAGER_RESOURCE_SHARED) priv->resources[priv->nresources-1].flags |=3D diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 901896d775..6862818698 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -194,7 +194,7 @@ networkDnsmasqDefNamespaceParse(xmlXPathContextPtr ctxt, goto cleanup; =20 if (nsdata->noptions > 0) - VIR_STEAL_PTR(*data, nsdata); + *data =3D g_steal_pointer(&nsdata); =20 ret =3D 0; =20 diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index de9f197dae..4527adc670 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1468,7 +1468,7 @@ phypGetBackingDevice(virConnectPtr conn, const char *= managed_system, if (VIR_STRDUP(backing_device, char_ptr) < 0) goto cleanup; } else { - VIR_STEAL_PTR(backing_device, ret); + backing_device =3D g_steal_pointer(&ret); } =20 char_ptr =3D strchr(backing_device, '\n'); diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index a0a0e311e0..9228c7d0ed 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -858,8 +858,8 @@ remoteGetUNIXSocket(remoteDriverTransport transport, =20 switch ((remoteDriverMode)mode) { case REMOTE_DRIVER_MODE_LEGACY: - VIR_STEAL_PTR(sock_name, legacy_sock_name); - VIR_STEAL_PTR(*daemon, legacy_daemon); + sock_name =3D g_steal_pointer(&legacy_sock_name); + *daemon =3D g_steal_pointer(&legacy_daemon); break; =20 case REMOTE_DRIVER_MODE_DIRECT: @@ -876,8 +876,8 @@ remoteGetUNIXSocket(remoteDriverTransport transport, return NULL; } =20 - VIR_STEAL_PTR(sock_name, direct_sock_name); - VIR_STEAL_PTR(*daemon, direct_daemon); + sock_name =3D g_steal_pointer(&direct_sock_name); + *daemon =3D g_steal_pointer(&direct_daemon); break; =20 case REMOTE_DRIVER_MODE_AUTO: diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index 136bb1cc33..cd92329230 100644 --- a/src/rpc/virnetlibsshsession.c +++ b/src/rpc/virnetlibsshsession.c @@ -1063,7 +1063,7 @@ virNetLibsshSessionAuthAddPrivKeyAuth(virNetLibsshSes= sionPtr sess, goto error; } =20 - VIR_STEAL_PTR(auth->password, pass); + auth->password =3D g_steal_pointer(&pass); auth->filename =3D file; auth->method =3D VIR_NET_LIBSSH_AUTH_PRIVKEY; auth->ssh_flags =3D SSH_AUTH_METHOD_PUBLICKEY; diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index ad4a684c16..6d2844f3b7 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -228,7 +228,7 @@ secretDefineXML(virConnectPtr conn, if (!(obj =3D virSecretObjListAdd(driver->secrets, def, driver->configDir, &backup))) goto cleanup; - VIR_STEAL_PTR(objDef, def); + objDef =3D g_steal_pointer(&def); =20 if (!objDef->isephemeral) { if (backup && backup->isephemeral) { @@ -269,7 +269,7 @@ secretDefineXML(virConnectPtr conn, * the backup; otherwise, this is a new secret, thus remove it. */ if (backup) { virSecretObjSetDef(obj, backup); - VIR_STEAL_PTR(def, objDef); + def =3D g_steal_pointer(&objDef); } else { virSecretObjListRemove(driver->secrets, obj); virObjectUnref(obj); diff --git a/src/security/security_manager.c b/src/security/security_manage= r.c index 8ff569e316..952675381d 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -96,7 +96,7 @@ virSecurityManagerNewDriver(virSecurityDriverPtr drv, mgr->drv =3D drv; mgr->flags =3D flags; mgr->virtDriver =3D virtDriver; - VIR_STEAL_PTR(mgr->privateData, privateData); + mgr->privateData =3D g_steal_pointer(&privateData); =20 if (drv->open(mgr) < 0) goto error; @@ -1378,7 +1378,7 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr = mgr G_GNUC_UNUSED, if (VIR_ALLOC(ret) < 0) goto cleanup; =20 - VIR_STEAL_PTR(ret->fds, fds); + ret->fds =3D g_steal_pointer(&fds); ret->nfds =3D nfds; nfds =3D 0; =20 diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index afc5324b77..9157411133 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -358,7 +358,7 @@ create_profile(const char *profile, const char *profile= _name, if (!(tmp =3D virStringReplace(pcontent, template_end, replace_fil= es))) goto clean_all; VIR_FREE(pcontent); - VIR_STEAL_PTR(pcontent, tmp); + pcontent =3D g_steal_pointer(&tmp); } =20 /* write the file */ @@ -778,7 +778,7 @@ vah_add_path(virBufferPtr buf, const char *path, const = char *perms, bool recursi if ((pathtmp =3D mdir_name(pathdir)) =3D=3D NULL) goto cleanup; VIR_FREE(pathdir); - VIR_STEAL_PTR(pathdir, pathtmp); + pathdir =3D g_steal_pointer(&pathtmp); } =20 if (strlen(pathdir) =3D=3D 1) { diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend= _fs.c index a00308bc17..d96f5a5cb5 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -599,7 +599,7 @@ virStoragePoolDefFSNamespaceParse(xmlXPathContextPtr ct= xt, cmdopts->noptions++; } =20 - VIR_STEAL_PTR(*data, cmdopts); + *data =3D g_steal_pointer(&cmdopts); ret =3D 0; =20 cleanup: diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_ba= ckend_gluster.c index 1b87e800ac..23fe0dc226 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -271,7 +271,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlu= sterStatePtr state, if (S_ISDIR(st->st_mode)) { vol->type =3D VIR_STORAGE_VOL_NETDIR; vol->target.format =3D VIR_STORAGE_FILE_DIR; - VIR_STEAL_PTR(*volptr, vol); + *volptr =3D g_steal_pointer(&vol); ret =3D 0; goto cleanup; } @@ -320,7 +320,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlu= sterStatePtr state, vol->target.compat =3D meta->compat; meta->compat =3D NULL; =20 - VIR_STEAL_PTR(*volptr, vol); + *volptr =3D g_steal_pointer(&vol); ret =3D 0; cleanup: if (fd) diff --git a/src/storage/storage_backend_iscsi_direct.c b/src/storage/stora= ge_backend_iscsi_direct.c index 78e347c9b0..7492566099 100644 --- a/src/storage/storage_backend_iscsi_direct.c +++ b/src/storage/storage_backend_iscsi_direct.c @@ -432,7 +432,7 @@ virISCSIDirectUpdateTargets(struct iscsi_context *iscsi, goto cleanup; } =20 - VIR_STEAL_PTR(*targets, tmp_targets); + *targets =3D g_steal_pointer(&tmp_targets); *ntargets =3D tmp_ntargets; tmp_ntargets =3D 0; =20 @@ -574,7 +574,7 @@ virStorageBackendISCSIDirectSetConnection(virStoragePoo= lObjPtr pool, goto error; =20 if (portalRet) - VIR_STEAL_PTR(*portalRet, portal); + *portalRet =3D g_steal_pointer(&portal); =20 cleanup: return iscsi; diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_ba= ckend_logical.c index 04f3decdf3..9be6d61a12 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -482,7 +482,7 @@ virStorageBackendLogicalFindPoolSourcesFunc(char **cons= t groups, if (!(thisSource =3D virStoragePoolSourceListNewSource(sourceList)= )) return -1; =20 - VIR_STEAL_PTR(thisSource->name, vgname); + thisSource->name =3D g_steal_pointer(&vgname); } =20 if (VIR_REALLOC_N(thisSource->devices, thisSource->ndevice + 1) !=3D 0) @@ -493,7 +493,7 @@ virStorageBackendLogicalFindPoolSourcesFunc(char **cons= t groups, thisSource->format =3D VIR_STORAGE_POOL_LOGICAL_LVM2; =20 memset(dev, 0, sizeof(*dev)); - VIR_STEAL_PTR(dev->path, pvname); + dev->path =3D g_steal_pointer(&pvname); =20 return 0; } diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index 485cabb219..e4154479c2 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -129,7 +129,7 @@ virStoragePoolDefRBDNamespaceParse(xmlXPathContextPtr c= txt, cmdopts->noptions++; } =20 - VIR_STEAL_PTR(*data, cmdopts); + *data =3D g_steal_pointer(&cmdopts); ret =3D 0; =20 cleanup: @@ -617,7 +617,7 @@ virStorageBackendRBDGetVolNames(virStorageBackendRBDSta= tePtr ptr) nnames =3D nimages; =20 for (i =3D 0; i < nimages; i++) - VIR_STEAL_PTR(names[i], images[i].name); + names[i] =3D g_steal_pointer(&images[i].name); =20 return names; =20 @@ -725,7 +725,7 @@ virStorageBackendRBDRefreshPool(virStoragePoolObjPtr po= ol) if (VIR_ALLOC(vol) < 0) goto cleanup; =20 - VIR_STEAL_PTR(vol->name, names[i]); + vol->name =3D g_steal_pointer(&names[i]); =20 r =3D volStorageBackendRBDRefreshVolInfo(vol, pool, ptr); =20 diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backe= nd_scsi.c index 14bf1352a6..fd243776f8 100644 --- a/src/storage/storage_backend_scsi.c +++ b/src/storage/storage_backend_scsi.c @@ -335,7 +335,7 @@ createVport(virStoragePoolDefPtr def, */ if (VIR_ALLOC(cbdata) =3D=3D 0) { memcpy(cbdata->pool_uuid, def->uuid, VIR_UUID_BUFLEN); - VIR_STEAL_PTR(cbdata->fchost_name, name); + cbdata->fchost_name =3D g_steal_pointer(&name); =20 if (virThreadCreate(&thread, false, virStoragePoolFCRefreshThread, cbdata) < 0) { diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index d878329a45..981f2a4301 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -2023,7 +2023,7 @@ storageVolCreateXML(virStoragePoolPtr pool, =20 VIR_INFO("Creating volume '%s' in storage pool '%s'", newvol->name, def->name); - VIR_STEAL_PTR(vol, newvol); + vol =3D g_steal_pointer(&newvol); voldef =3D NULL; =20 cleanup: @@ -2215,7 +2215,7 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool, =20 VIR_INFO("Creating volume '%s' in storage pool '%s'", newvol->name, def->name); - VIR_STEAL_PTR(vol, newvol); + vol =3D g_steal_pointer(&newvol); voldef =3D NULL; =20 cleanup: diff --git a/src/storage/storage_file_gluster.c b/src/storage/storage_file_= gluster.c index babb8fbe94..28f9962c0c 100644 --- a/src/storage/storage_file_gluster.c +++ b/src/storage/storage_file_gluster.c @@ -291,7 +291,7 @@ virStorageFileBackendGlusterReadlinkCallback(const char= *path, =20 buf[ret] =3D '\0'; =20 - VIR_STEAL_PTR(*linkpath, buf); + *linkpath =3D g_steal_pointer(&buf); =20 return 0; } diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index e97bd2151a..410d412ef1 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -2862,11 +2862,11 @@ virStorageUtilGlusterExtractPoolSources(const char = *host, =20 if (pooltype =3D=3D VIR_STORAGE_POOL_NETFS) { src->format =3D VIR_STORAGE_POOL_NETFS_GLUSTERFS; - VIR_STEAL_PTR(src->dir, volname); + src->dir =3D g_steal_pointer(&volname); } else if (pooltype =3D=3D VIR_STORAGE_POOL_GLUSTER) { if (VIR_STRDUP(src->dir, "/") < 0) goto cleanup; - VIR_STEAL_PTR(src->name, volname); + src->name =3D g_steal_pointer(&volname); } else { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unsupported gluster lookup")); @@ -3450,11 +3450,11 @@ storageBackendProbeTarget(virStorageSourcePtr targe= t, } =20 virBitmapFree(target->features); - VIR_STEAL_PTR(target->features, meta->features); + target->features =3D g_steal_pointer(&meta->features); =20 if (meta->compat) { VIR_FREE(target->compat); - VIR_STEAL_PTR(target->compat, meta->compat); + target->compat =3D g_steal_pointer(&meta->compat); } =20 return 0; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 42bb3d19f0..ab7e5fc02a 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1229,7 +1229,7 @@ testParseAuthUsers(testDriverPtr privconn, } /* This field is optional. */ privconn->auths[i].password =3D virXMLPropString(nodes[i], "passwo= rd"); - VIR_STEAL_PTR(privconn->auths[i].username, username); + privconn->auths[i].username =3D g_steal_pointer(&username); } =20 return 0; @@ -2304,7 +2304,7 @@ testDomainSaveImageOpen(testDriverPtr driver, VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE= ))) goto error; =20 - VIR_STEAL_PTR(*ret_def, def); + *ret_def =3D g_steal_pointer(&def); return fd; =20 error: @@ -3114,7 +3114,7 @@ testDomainRenameCallback(virDomainObjPtr privdom, =20 /* Switch name in domain definition. */ VIR_FREE(privdom->def->name); - VIR_STEAL_PTR(privdom->def->name, new_dom_name); + privdom->def->name =3D g_steal_pointer(&new_dom_name); =20 event_new =3D virDomainEventLifecycleNewFromObj(privdom, VIR_DOMAIN_EVENT_DEFINED, @@ -3529,18 +3529,18 @@ testDomainSetInterfaceParameters(virDomainPtr dom, VIR_FREE(bandwidth->out); =20 if (!net->bandwidth) { - VIR_STEAL_PTR(net->bandwidth, bandwidth); + net->bandwidth =3D g_steal_pointer(&bandwidth); } else { if (bandwidth->in) { VIR_FREE(net->bandwidth->in); - VIR_STEAL_PTR(net->bandwidth->in, bandwidth->in); + net->bandwidth->in =3D g_steal_pointer(&bandwidth->in); } else if (inboundSpecified) { /* if we got here it means user requested @inbound to be clear= ed */ VIR_FREE(net->bandwidth->in); } if (bandwidth->out) { VIR_FREE(net->bandwidth->out); - VIR_STEAL_PTR(net->bandwidth->out, bandwidth->out); + net->bandwidth->out =3D g_steal_pointer(&bandwidth->out); } else if (outboundSpecified) { /* if we got here it means user requested @outbound to be clea= red */ VIR_FREE(net->bandwidth->out); @@ -4754,7 +4754,7 @@ testDomainGetFSInfo(virDomainPtr dom, =20 info_ret[0]->ndevAlias =3D info_ret[1]->ndevAlias =3D 1; =20 - VIR_STEAL_PTR(*info, info_ret); + *info =3D g_steal_pointer(&info_ret); =20 ret =3D 2; goto cleanup; @@ -4869,7 +4869,7 @@ testDomainGetPerfEvents(virDomainPtr dom, goto cleanup; } =20 - VIR_STEAL_PTR(*params, par); + *params =3D g_steal_pointer(&par); *nparams =3D npar; npar =3D 0; =20 @@ -5130,7 +5130,7 @@ testDomainInterfaceAddresses(virDomainPtr dom, VIR_APPEND_ELEMENT_INPLACE(ifaces_ret, ifaces_count, iface); } =20 - VIR_STEAL_PTR(*ifaces, ifaces_ret); + *ifaces =3D g_steal_pointer(&ifaces_ret); ret =3D ifaces_count; =20 cleanup: @@ -7550,7 +7550,7 @@ testNodeDeviceCreateXML(virConnectPtr conn, if (VIR_STRDUP(dev->parentName, def->parent) < 0) goto cleanup; =20 - VIR_STEAL_PTR(ret, dev); + ret =3D g_steal_pointer(&dev); =20 cleanup: virNodeDeviceObjEndAPI(&obj); diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 7fa9a98a1e..56c3c8d896 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -3696,7 +3696,7 @@ vboxDumpNetwork(vboxDriverPtr data, INetworkAdapter *= adapter) gVBoxAPI.UINetworkAdapter.GetBridgedInterface(adapter, &utf16); =20 VBOX_UTF16_TO_UTF8(utf16, &utf8); - VIR_STEAL_PTR(net->data.bridge.brname, utf8); + net->data.bridge.brname =3D g_steal_pointer(&utf8); VBOX_UTF16_FREE(utf16); break; =20 @@ -3706,7 +3706,7 @@ vboxDumpNetwork(vboxDriverPtr data, INetworkAdapter *= adapter) gVBoxAPI.UINetworkAdapter.GetInternalNetwork(adapter, &utf16); =20 VBOX_UTF16_TO_UTF8(utf16, &utf8); - VIR_STEAL_PTR(net->data.internal.name, utf8); + net->data.internal.name =3D g_steal_pointer(&utf8); VBOX_UTF16_FREE(utf16); break; =20 @@ -3716,7 +3716,7 @@ vboxDumpNetwork(vboxDriverPtr data, INetworkAdapter *= adapter) gVBoxAPI.UINetworkAdapter.GetHostOnlyInterface(adapter, &utf16); =20 VBOX_UTF16_TO_UTF8(utf16, &utf8); - VIR_STEAL_PTR(net->data.network.name, utf8); + net->data.network.name =3D g_steal_pointer(&utf8); VBOX_UTF16_FREE(utf16); break; =20 diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 5396353412..fa7aa79484 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -1486,7 +1486,7 @@ virVMXParseConfig(virVMXContext *ctx, cpu->cores =3D coresPerSocket; cpu->threads =3D 1; =20 - VIR_STEAL_PTR(def->cpu, cpu); + def->cpu =3D g_steal_pointer(&cpu); } =20 /* vmx:sched.cpu.affinity -> def:cpumask */ diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index fe46d6349e..f8c5232018 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -193,8 +193,8 @@ vzDestroyDriverConnection(void) vzConnPtr privconn_list; =20 virMutexLock(&vz_driver_lock); - VIR_STEAL_PTR(driver, vz_driver); - VIR_STEAL_PTR(privconn_list, vz_conn_list); + driver =3D g_steal_pointer(&vz_driver); + privconn_list =3D g_steal_pointer(&vz_conn_list); virMutexUnlock(&vz_driver_lock); =20 while (privconn_list) { @@ -3189,7 +3189,7 @@ vzDomainMigratePerformP2P(virDomainObjPtr dom, VIR_MIGRATE_PARAM_DEST_XML, dom_xml) < 0) goto done; =20 - VIR_STEAL_PTR(cookiein, cookieout); + cookiein =3D g_steal_pointer(&cookieout); cookieinlen =3D cookieoutlen; cookieoutlen =3D 0; virObjectUnlock(dom); @@ -3211,7 +3211,7 @@ vzDomainMigratePerformP2P(virDomainObjPtr dom, } =20 VIR_FREE(cookiein); - VIR_STEAL_PTR(cookiein, cookieout); + cookiein =3D g_steal_pointer(&cookieout); cookieinlen =3D cookieoutlen; cookieoutlen =3D 0; if (vzDomainMigratePerformStep(dom, driver, params, nparams, cookiein, diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index cef840fb9f..68284d53f7 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -928,7 +928,7 @@ prlsdkParseNetAddress(char *addr) goto cleanup; ip->prefix =3D nbits; =20 - VIR_STEAL_PTR(ret, ip); + ret =3D g_steal_pointer(&ip); =20 cleanup: if (!ret) @@ -4760,7 +4760,7 @@ prlsdkParseSnapshotTree(const char *treexml) goto cleanup; } =20 - VIR_STEAL_PTR(ret, snapshots); + ret =3D g_steal_pointer(&snapshots); =20 cleanup: virDomainSnapshotObjListFree(snapshots); diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index dcb99aad6e..098b5eff09 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -55,7 +55,7 @@ testCompareXMLToConfFiles(const char *inxml, const char *= outconf, dnsmasqCapsPtr "except-interface=3Dlo\n"))) goto fail; VIR_FREE(actual); - VIR_STEAL_PTR(actual, tmp); + actual =3D g_steal_pointer(&tmp); #endif =20 if (virTestCompareToFile(actual, outconf) < 0) diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index 58f722cf1b..cef9ae5fee 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -230,8 +230,8 @@ testQemuAgentGetFSInfoCommon(virDomainXMLOptionPtr xmlo= pt, " \"disk\": [], \"type\": \"xfs\"}]}") < = 0) goto cleanup; =20 - VIR_STEAL_PTR(*test, ret_test); - VIR_STEAL_PTR(*def, ret_def); + *test =3D g_steal_pointer(&ret_test); + *def =3D g_steal_pointer(&ret_def); ret =3D 0; =20 cleanup: diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 6d90e2faf5..0f073682ca 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -387,7 +387,7 @@ testQemuImageCreateLoadDiskXML(const char *name, if (virDomainSnapshotDiskDefParseXML(node, ctxt, diskdef, VIR_DOMAIN_DEF_PARSE_STATUS, xmlopt) =3D=3D 0) - VIR_STEAL_PTR(ret, diskdef->src); + ret =3D g_steal_pointer(&diskdef->src); =20 virDomainSnapshotDiskDefFree(diskdef); return ret; diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c index 288718c2a5..1c6cefd705 100644 --- a/tests/qemusecuritytest.c +++ b/tests/qemusecuritytest.c @@ -75,7 +75,7 @@ prepareObjects(virQEMUDriverPtr driver, 0))) return -1; =20 - VIR_STEAL_PTR(*vm_ret, vm); + *vm_ret =3D g_steal_pointer(&vm); return 0; } =20 diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 6eda8daafe..e6eca5cb2e 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -1073,7 +1073,7 @@ testQemuInfoSetArgs(struct testQemuInfo *info, fprintf(stderr, "No qemuCaps generated\n"); goto cleanup; } - VIR_STEAL_PTR(info->qemuCaps, qemuCaps); + info->qemuCaps =3D g_steal_pointer(&qemuCaps); =20 if (gic !=3D GIC_NONE && testQemuCapsSetGIC(info->qemuCaps, gic) < 0) goto cleanup; diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 33ef662115..5d3edbc854 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -108,7 +108,7 @@ testStorageFileGetMetadata(const char *path, if (virStorageFileGetMetadata(def, uid, gid, false) < 0) return NULL; =20 - VIR_STEAL_PTR(ret, def); + ret =3D g_steal_pointer(&def); return ret; } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 02:01:32 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1571227774; cv=none; d=zoho.com; s=zohoarc; b=aD5DUp9BH1FsKPpVibrTp9Xj63MnoBFvYW3rLAGHcpsFSPKHk60dyS+VlAP9mylFtOJs3O9bhBhzcOC4z6uzZ2dwvPVMwjU9lIXzn/CG0cB1ZDsYhW6ieGqfREGRJ9SGFrJURBjdJZXvJ6VZuCKoKYzbyd271l1Lv2LJumjTAtU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571227774; h=Content-Type:Content-Transfer-Encoding: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=9yP+2lseSO9V2Hm539EyrJdKzPZj9VC9Qi5ea63UzrQ=; b=f5cnVu+N/Msr2nDpZimQQuvUGkDSeH+GwfVXWCapolywSoji92vqsQoPZdYWkg+rEGEG230cBCS8IYL9a9U0OWc4vHtiNwq2VbsI20m4zEuNCGjiv06e3wTp8+SFufjChu82UA/G/L7YPtFLgZE6835m8k7xVspK7zWts8U6WPM= ARC-Authentication-Results: i=1; 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; dmarc=pass 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 1571227774633250.91281755819386; Wed, 16 Oct 2019 05:09:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01EBE3172D88; Wed, 16 Oct 2019 12:09:33 +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 CD9FA3DA3; Wed, 16 Oct 2019 12:09:32 +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 8DCBB180BAA1; Wed, 16 Oct 2019 12:09:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9GC9Nwm020988 for ; Wed, 16 Oct 2019 08:09:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id C00BD6046B; Wed, 16 Oct 2019 12:09:23 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 478536031F for ; Wed, 16 Oct 2019 12:09:23 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Wed, 16 Oct 2019 14:09:10 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 9/9] internal: delete VIR_STEAL_PTR 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-Type: text/plain; charset="utf-8" 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 16 Oct 2019 12:09:33 +0000 (UTC) Delete the macro to prevent its usage in new code. The GLib version should be used instead: p =3D g_steal_pointer(&ptr); Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- src/internal.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/internal.h b/src/internal.h index 722cdbc57c..fb17b87baa 100644 --- a/src/internal.h +++ b/src/internal.h @@ -213,18 +213,6 @@ (a) =3D (a) ^ (b); \ } while (0) =20 -/** - * VIR_STEAL_PTR: - * - * Steals pointer passed as second argument into the first argument. Second - * argument must not have side effects. - */ -#define VIR_STEAL_PTR(a, b) \ - do { \ - (a) =3D (b); \ - (b) =3D NULL; \ - } while (0) - /** * virCheckFlags: * @supported: an OR'ed set of supported flags --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list