mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
util: Remove the AUTOPTR func for virStorageSource
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>
This commit is contained in:
parent
0d13790695
commit
e1c01b2252
@ -9160,7 +9160,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt,
|
|||||||
char *format = NULL;
|
char *format = NULL;
|
||||||
char *idx = NULL;
|
char *idx = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
VIR_AUTOPTR(virStorageSource) backingStore = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) backingStore = NULL;
|
||||||
|
|
||||||
if (!(ctxt->node = virXPathNode("./backingStore", ctxt))) {
|
if (!(ctxt->node = virXPathNode("./backingStore", ctxt))) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -2733,7 +2733,7 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node,
|
|||||||
char *format = NULL;
|
char *format = NULL;
|
||||||
char *type = NULL;
|
char *type = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
VIR_AUTOPTR(virStorageSource) migrSource = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) migrSource = NULL;
|
||||||
|
|
||||||
ctxt->node = node;
|
ctxt->node = node;
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ qemuSecurityChownCallback(const virStorageSource *src,
|
|||||||
int save_errno = 0;
|
int save_errno = 0;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
int rv;
|
int rv;
|
||||||
VIR_AUTOPTR(virStorageSource) cpy = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) cpy = NULL;
|
||||||
|
|
||||||
rv = virStorageFileSupportsSecurityDriver(src);
|
rv = virStorageFileSupportsSecurityDriver(src);
|
||||||
if (rv <= 0)
|
if (rv <= 0)
|
||||||
@ -17962,7 +17962,7 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base,
|
|||||||
virDomainObjPtr vm;
|
virDomainObjPtr vm;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
unsigned long long speed = bandwidth;
|
unsigned long long speed = bandwidth;
|
||||||
VIR_AUTOPTR(virStorageSource) dest = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) dest = NULL;
|
||||||
|
|
||||||
virCheckFlags(VIR_DOMAIN_BLOCK_REBASE_SHALLOW |
|
virCheckFlags(VIR_DOMAIN_BLOCK_REBASE_SHALLOW |
|
||||||
VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT |
|
VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT |
|
||||||
@ -18156,7 +18156,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
|
|||||||
unsigned long long speed = bandwidth;
|
unsigned long long speed = bandwidth;
|
||||||
qemuBlockJobDataPtr job = NULL;
|
qemuBlockJobDataPtr job = NULL;
|
||||||
qemuBlockJobType jobtype = QEMU_BLOCKJOB_TYPE_COMMIT;
|
qemuBlockJobType jobtype = QEMU_BLOCKJOB_TYPE_COMMIT;
|
||||||
VIR_AUTOPTR(virStorageSource) mirror = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) mirror = NULL;
|
||||||
|
|
||||||
/* XXX Add support for COMMIT_DELETE */
|
/* XXX Add support for COMMIT_DELETE */
|
||||||
virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW |
|
virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW |
|
||||||
|
@ -790,7 +790,7 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr driver,
|
|||||||
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
|
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
|
||||||
int mon_ret = 0;
|
int mon_ret = 0;
|
||||||
int ret = -1;
|
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);
|
VIR_DEBUG("starting blockdev mirror for disk=%s to host=%s", diskAlias, host);
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
|
|||||||
ssize_t len;
|
ssize_t len;
|
||||||
int backingFormat;
|
int backingFormat;
|
||||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||||
VIR_AUTOPTR(virStorageSource) meta = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) meta = NULL;
|
||||||
VIR_AUTOFREE(char *) header = NULL;
|
VIR_AUTOFREE(char *) header = NULL;
|
||||||
|
|
||||||
*volptr = NULL;
|
*volptr = NULL;
|
||||||
|
@ -3359,7 +3359,7 @@ storageBackendProbeTarget(virStorageSourcePtr target,
|
|||||||
int backingStoreFormat;
|
int backingStoreFormat;
|
||||||
int rc;
|
int rc;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
VIR_AUTOPTR(virStorageSource) meta = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) meta = NULL;
|
||||||
VIR_AUTOCLOSE fd = -1;
|
VIR_AUTOCLOSE fd = -1;
|
||||||
|
|
||||||
if (encryption)
|
if (encryption)
|
||||||
@ -3529,7 +3529,7 @@ virStorageBackendRefreshLocal(virStoragePoolObjPtr pool)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||||
VIR_AUTOCLOSE fd = -1;
|
VIR_AUTOCLOSE fd = -1;
|
||||||
VIR_AUTOPTR(virStorageSource) target = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) target = NULL;
|
||||||
|
|
||||||
if (virDirOpen(&dir, def->target.path) < 0)
|
if (virDirOpen(&dir, def->target.path) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -547,6 +547,5 @@ void virStorageFileReportBrokenChain(int errcode,
|
|||||||
virStorageSourcePtr parent);
|
virStorageSourcePtr parent);
|
||||||
|
|
||||||
VIR_DEFINE_AUTOPTR_FUNC(virStorageAuthDef, virStorageAuthDefFree);
|
VIR_DEFINE_AUTOPTR_FUNC(virStorageAuthDef, virStorageAuthDefFree);
|
||||||
VIR_DEFINE_AUTOPTR_FUNC(virStorageSource, virStorageSourceFree);
|
|
||||||
|
|
||||||
#endif /* LIBVIRT_VIRSTORAGEFILE_H */
|
#endif /* LIBVIRT_VIRSTORAGEFILE_H */
|
||||||
|
@ -52,8 +52,8 @@ testBackingXMLjsonXML(const void *args)
|
|||||||
char *protocolwrapper = NULL;
|
char *protocolwrapper = NULL;
|
||||||
char *actualxml = NULL;
|
char *actualxml = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
VIR_AUTOPTR(virStorageSource) xmlsrc = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) xmlsrc = NULL;
|
||||||
VIR_AUTOPTR(virStorageSource) jsonsrc = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) jsonsrc = NULL;
|
||||||
|
|
||||||
if (!(xmlsrc = virStorageSourceNew()))
|
if (!(xmlsrc = virStorageSourceNew()))
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -96,7 +96,7 @@ testStorageFileGetMetadata(const char *path,
|
|||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
virStorageSourcePtr ret = NULL;
|
virStorageSourcePtr ret = NULL;
|
||||||
VIR_AUTOPTR(virStorageSource) def = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) def = NULL;
|
||||||
|
|
||||||
if (!(def = virStorageSourceNew()))
|
if (!(def = virStorageSourceNew()))
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -308,7 +308,7 @@ testStorageChain(const void *args)
|
|||||||
const struct testChainData *data = args;
|
const struct testChainData *data = args;
|
||||||
virStorageSourcePtr elt;
|
virStorageSourcePtr elt;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
VIR_AUTOPTR(virStorageSource) meta = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) meta = NULL;
|
||||||
VIR_AUTOFREE(char *) broken = NULL;
|
VIR_AUTOFREE(char *) broken = NULL;
|
||||||
|
|
||||||
meta = testStorageFileGetMetadata(data->start, data->format, -1, -1);
|
meta = testStorageFileGetMetadata(data->start, data->format, -1, -1);
|
||||||
@ -642,7 +642,7 @@ testBackingParse(const void *args)
|
|||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
VIR_AUTOFREE(char *) xml = NULL;
|
VIR_AUTOFREE(char *) xml = NULL;
|
||||||
VIR_AUTOPTR(virStorageSource) src = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) src = NULL;
|
||||||
|
|
||||||
if (!(src = virStorageSourceNewFromBackingAbsolute(data->backing))) {
|
if (!(src = virStorageSourceNewFromBackingAbsolute(data->backing))) {
|
||||||
if (!data->expect)
|
if (!data->expect)
|
||||||
@ -692,7 +692,7 @@ mymain(void)
|
|||||||
virStorageSourcePtr chain2; /* short for chain->backingStore */
|
virStorageSourcePtr chain2; /* short for chain->backingStore */
|
||||||
virStorageSourcePtr chain3; /* short for chain2->backingStore */
|
virStorageSourcePtr chain3; /* short for chain2->backingStore */
|
||||||
VIR_AUTOPTR(virCommand) cmd = NULL;
|
VIR_AUTOPTR(virCommand) cmd = NULL;
|
||||||
VIR_AUTOPTR(virStorageSource) chain = NULL;
|
VIR_AUTOUNREF(virStorageSourcePtr) chain = NULL;
|
||||||
|
|
||||||
if (storageRegisterAll() < 0)
|
if (storageRegisterAll() < 0)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
Loading…
Reference in New Issue
Block a user