From nobody Mon Feb 9 12:29:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1550234559436486.0017628442928; Fri, 15 Feb 2019 04:42:39 -0800 (PST) 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 D1BA5AC609; Fri, 15 Feb 2019 12:42:36 +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 98D911001944; Fri, 15 Feb 2019 12:42:36 +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 4F527181A12B; Fri, 15 Feb 2019 12:42:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1FCgN3P012040 for ; Fri, 15 Feb 2019 07:42:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1C41626350; Fri, 15 Feb 2019 12:42:23 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C4CE16E20; Fri, 15 Feb 2019 12:42:22 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 15 Feb 2019 13:42:12 +0100 Message-Id: <6e5e454b44ac575cdf4779e9a9ac1ba6abb13f6c.1550234476.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 4/5] util: Remove the AUTOPTR func for virStorageSource X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 15 Feb 2019 12:42:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Since virStorageSource is now a subclass of virObject, we can use VIR_AUTOUNREF instead. Signed-off-by: Peter Krempa Reviewed-by: Erik Skultety --- src/conf/domain_conf.c | 2 +- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_driver.c | 6 +++--- src/qemu/qemu_migration.c | 2 +- src/storage/storage_backend_gluster.c | 2 +- src/storage/storage_util.c | 4 ++-- src/util/virstoragefile.h | 1 - tests/qemublocktest.c | 4 ++-- tests/virstoragetest.c | 8 ++++---- 9 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 52cec5cd3d..91ee35391b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9071,7 +9071,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctx= t, char *format =3D NULL; char *idx =3D NULL; int ret =3D -1; - VIR_AUTOPTR(virStorageSource) backingStore =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) backingStore =3D NULL; if (!(ctxt->node =3D virXPathNode("./backingStore", ctxt))) { ret =3D 0; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0c8feb25be..a96a4f4049 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2733,7 +2733,7 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr n= ode, char *format =3D NULL; char *type =3D NULL; int ret =3D -1; - VIR_AUTOPTR(virStorageSource) migrSource =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) migrSource =3D NULL; ctxt->node =3D node; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f94955a22f..5a77afa1b4 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -279,7 +279,7 @@ qemuSecurityChownCallback(const virStorageSource *src, int save_errno =3D 0; int ret =3D -1; int rv; - VIR_AUTOPTR(virStorageSource) cpy =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) cpy =3D NULL; rv =3D virStorageFileSupportsSecurityDriver(src); if (rv <=3D 0) @@ -17962,7 +17962,7 @@ qemuDomainBlockRebase(virDomainPtr dom, const char = *path, const char *base, virDomainObjPtr vm; int ret =3D -1; unsigned long long speed =3D bandwidth; - VIR_AUTOPTR(virStorageSource) dest =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) dest =3D NULL; virCheckFlags(VIR_DOMAIN_BLOCK_REBASE_SHALLOW | VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT | @@ -18156,7 +18156,7 @@ qemuDomainBlockCommit(virDomainPtr dom, unsigned long long speed =3D bandwidth; qemuBlockJobDataPtr job =3D NULL; qemuBlockJobType jobtype =3D QEMU_BLOCKJOB_TYPE_COMMIT; - VIR_AUTOPTR(virStorageSource) mirror =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) mirror =3D NULL; /* XXX Add support for COMMIT_DELETE */ virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW | diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 8a9dbb5e63..b10f55f80c 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -790,7 +790,7 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr= driver, qemuDomainDiskPrivatePtr diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); int mon_ret =3D 0; int ret =3D -1; - VIR_AUTOPTR(virStorageSource) copysrc =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) copysrc =3D NULL; VIR_DEBUG("starting blockdev mirror for disk=3D%s to host=3D%s", diskA= lias, host); diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_ba= ckend_gluster.c index 854ecf2b67..819993439a 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -239,7 +239,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlu= sterStatePtr state, ssize_t len; int backingFormat; VIR_AUTOPTR(virStorageVolDef) vol =3D NULL; - VIR_AUTOPTR(virStorageSource) meta =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) meta =3D NULL; VIR_AUTOFREE(char *) header =3D NULL; *volptr =3D NULL; diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 3a6cc34b68..1c5d4d14be 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -3359,7 +3359,7 @@ storageBackendProbeTarget(virStorageSourcePtr target, int backingStoreFormat; int rc; struct stat sb; - VIR_AUTOPTR(virStorageSource) meta =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) meta =3D NULL; VIR_AUTOCLOSE fd =3D -1; if (encryption) @@ -3529,7 +3529,7 @@ virStorageBackendRefreshLocal(virStoragePoolObjPtr po= ol) int ret =3D -1; VIR_AUTOPTR(virStorageVolDef) vol =3D NULL; VIR_AUTOCLOSE fd =3D -1; - VIR_AUTOPTR(virStorageSource) target =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) target =3D NULL; if (virDirOpen(&dir, def->target.path) < 0) goto cleanup; diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index dc75d2d36f..17eea6dc6b 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -547,6 +547,5 @@ void virStorageFileReportBrokenChain(int errcode, virStorageSourcePtr parent); VIR_DEFINE_AUTOPTR_FUNC(virStorageAuthDef, virStorageAuthDefFree); -VIR_DEFINE_AUTOPTR_FUNC(virStorageSource, virStorageSourceFree); #endif /* LIBVIRT_VIRSTORAGEFILE_H */ diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 813b20a08d..4cd15a1dff 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -52,8 +52,8 @@ testBackingXMLjsonXML(const void *args) char *protocolwrapper =3D NULL; char *actualxml =3D NULL; int ret =3D -1; - VIR_AUTOPTR(virStorageSource) xmlsrc =3D NULL; - VIR_AUTOPTR(virStorageSource) jsonsrc =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) xmlsrc =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) jsonsrc =3D NULL; if (!(xmlsrc =3D virStorageSourceNew())) return -1; diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index da70beb1f7..830d4fb08e 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -96,7 +96,7 @@ testStorageFileGetMetadata(const char *path, { struct stat st; virStorageSourcePtr ret =3D NULL; - VIR_AUTOPTR(virStorageSource) def =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) def =3D NULL; if (!(def =3D virStorageSourceNew())) return NULL; @@ -308,7 +308,7 @@ testStorageChain(const void *args) const struct testChainData *data =3D args; virStorageSourcePtr elt; size_t i =3D 0; - VIR_AUTOPTR(virStorageSource) meta =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) meta =3D NULL; VIR_AUTOFREE(char *) broken =3D NULL; meta =3D testStorageFileGetMetadata(data->start, data->format, -1, -1); @@ -642,7 +642,7 @@ testBackingParse(const void *args) virBuffer buf =3D VIR_BUFFER_INITIALIZER; int ret =3D -1; VIR_AUTOFREE(char *) xml =3D NULL; - VIR_AUTOPTR(virStorageSource) src =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) src =3D NULL; if (!(src =3D virStorageSourceNewFromBackingAbsolute(data->backing))) { if (!data->expect) @@ -692,7 +692,7 @@ mymain(void) virStorageSourcePtr chain2; /* short for chain->backingStore */ virStorageSourcePtr chain3; /* short for chain2->backingStore */ VIR_AUTOPTR(virCommand) cmd =3D NULL; - VIR_AUTOPTR(virStorageSource) chain =3D NULL; + VIR_AUTOUNREF(virStorageSourcePtr) chain =3D NULL; if (storageRegisterAll() < 0) return EXIT_FAILURE; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list