]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Remove the AUTOPTR func for virStorageSource
authorPeter Krempa <pkrempa@redhat.com>
Fri, 15 Feb 2019 11:52:45 +0000 (12:52 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 18 Feb 2019 09:31:21 +0000 (10:31 +0100)
Since virStorageSource is now a subclass of virObject, we can use
VIR_AUTOUNREF instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/conf/domain_conf.c
src/qemu/qemu_domain.c
src/qemu/qemu_driver.c
src/qemu/qemu_migration.c
src/storage/storage_backend_gluster.c
src/storage/storage_util.c
src/util/virstoragefile.h
tests/qemublocktest.c
tests/virstoragetest.c

index 614fae9b4fdf50090d9f5b1ee2deb127a52bd154..e80c53e3576c6621136ee4efa584d764a3223640 100644 (file)
@@ -9160,7 +9160,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt,
     char *format = NULL;
     char *idx = NULL;
     int ret = -1;
-    VIR_AUTOPTR(virStorageSource) backingStore = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) backingStore = NULL;
 
     if (!(ctxt->node = virXPathNode("./backingStore", ctxt))) {
         ret = 0;
index 0c8feb25be3496771e4c806646093dd117da4cb3..a96a4f4049e6cea343d59a682a9b3c492c78ee56 100644 (file)
@@ -2733,7 +2733,7 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node,
     char *format = NULL;
     char *type = NULL;
     int ret = -1;
-    VIR_AUTOPTR(virStorageSource) migrSource = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) migrSource = NULL;
 
     ctxt->node = node;
 
index f94955a22fadf4c6b957cfdd0b7f85bdce5da487..5a77afa1b46b0abfb3f8e00e9a01cec1df736e31 100644 (file)
@@ -279,7 +279,7 @@ qemuSecurityChownCallback(const virStorageSource *src,
     int save_errno = 0;
     int ret = -1;
     int rv;
-    VIR_AUTOPTR(virStorageSource) cpy = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) cpy = NULL;
 
     rv = virStorageFileSupportsSecurityDriver(src);
     if (rv <= 0)
@@ -17962,7 +17962,7 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base,
     virDomainObjPtr vm;
     int ret = -1;
     unsigned long long speed = bandwidth;
-    VIR_AUTOPTR(virStorageSource) dest = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) dest = NULL;
 
     virCheckFlags(VIR_DOMAIN_BLOCK_REBASE_SHALLOW |
                   VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT |
@@ -18156,7 +18156,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
     unsigned long long speed = bandwidth;
     qemuBlockJobDataPtr job = NULL;
     qemuBlockJobType jobtype = QEMU_BLOCKJOB_TYPE_COMMIT;
-    VIR_AUTOPTR(virStorageSource) mirror = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) mirror = NULL;
 
     /* XXX Add support for COMMIT_DELETE */
     virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW |
index 8a9dbb5e630370e6a5cee714d454e44240cfbc67..b10f55f80cd67f5033f8482342b3ddf3b947ec9c 100644 (file)
@@ -790,7 +790,7 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr driver,
     qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
     int mon_ret = 0;
     int ret = -1;
-    VIR_AUTOPTR(virStorageSource) copysrc = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) copysrc = NULL;
 
     VIR_DEBUG("starting blockdev mirror for disk=%s to host=%s", diskAlias, host);
 
index 854ecf2b67fa30f40409b60a27642c7fc4592f14..819993439ad93b8d2a6b4f367cccb0aaf9452f61 100644 (file)
@@ -239,7 +239,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
     ssize_t len;
     int backingFormat;
     VIR_AUTOPTR(virStorageVolDef) vol = NULL;
-    VIR_AUTOPTR(virStorageSource) meta = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) meta = NULL;
     VIR_AUTOFREE(char *) header = NULL;
 
     *volptr = NULL;
index 3a6cc34b6896a4538600eabfc03dda338c8d3b26..1c5d4d14be9e46fb3f9a3a623e54c1bab8b90f1c 100644 (file)
@@ -3359,7 +3359,7 @@ storageBackendProbeTarget(virStorageSourcePtr target,
     int backingStoreFormat;
     int rc;
     struct stat sb;
-    VIR_AUTOPTR(virStorageSource) meta = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) meta = NULL;
     VIR_AUTOCLOSE fd = -1;
 
     if (encryption)
@@ -3529,7 +3529,7 @@ virStorageBackendRefreshLocal(virStoragePoolObjPtr pool)
     int ret = -1;
     VIR_AUTOPTR(virStorageVolDef) vol = NULL;
     VIR_AUTOCLOSE fd = -1;
-    VIR_AUTOPTR(virStorageSource) target = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) target = NULL;
 
     if (virDirOpen(&dir, def->target.path) < 0)
         goto cleanup;
index dc75d2d36f50ee4085b067cf4d2d6bcaa201b113..17eea6dc6be2f64ebd4c62e840ae6ca72bad0892 100644 (file)
@@ -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 */
index 813b20a08d14385c4764927744ca777832a7e8e4..4cd15a1dff6f9f6fb07fc73213c7f39875799387 100644 (file)
@@ -52,8 +52,8 @@ testBackingXMLjsonXML(const void *args)
     char *protocolwrapper = NULL;
     char *actualxml = NULL;
     int ret = -1;
-    VIR_AUTOPTR(virStorageSource) xmlsrc = NULL;
-    VIR_AUTOPTR(virStorageSource) jsonsrc = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) xmlsrc = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) jsonsrc = NULL;
 
     if (!(xmlsrc = virStorageSourceNew()))
         return -1;
index da70beb1f7cfde42abe4de9f539a5b1b1b799d96..830d4fb08e6f27cd23880e0a9c195acf2456ef3e 100644 (file)
@@ -96,7 +96,7 @@ testStorageFileGetMetadata(const char *path,
 {
     struct stat st;
     virStorageSourcePtr ret = NULL;
-    VIR_AUTOPTR(virStorageSource) def = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) def = NULL;
 
     if (!(def = virStorageSourceNew()))
         return NULL;
@@ -308,7 +308,7 @@ testStorageChain(const void *args)
     const struct testChainData *data = args;
     virStorageSourcePtr elt;
     size_t i = 0;
-    VIR_AUTOPTR(virStorageSource) meta = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) meta = NULL;
     VIR_AUTOFREE(char *) broken = NULL;
 
     meta = testStorageFileGetMetadata(data->start, data->format, -1, -1);
@@ -642,7 +642,7 @@ testBackingParse(const void *args)
     virBuffer buf = VIR_BUFFER_INITIALIZER;
     int ret = -1;
     VIR_AUTOFREE(char *) xml = NULL;
-    VIR_AUTOPTR(virStorageSource) src = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) src = NULL;
 
     if (!(src = 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 = NULL;
-    VIR_AUTOPTR(virStorageSource) chain = NULL;
+    VIR_AUTOUNREF(virStorageSourcePtr) chain = NULL;
 
     if (storageRegisterAll() < 0)
        return EXIT_FAILURE;