mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
conf: Introduce VIR_DEFINE_AUTOPTR_FUNC for virStorageVolDef
Let's make use of the auto __cleanup capabilities cleaning up any now unnecessary goto paths. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d04fbe7dab
commit
1f20da92d8
@ -1168,7 +1168,6 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
|
||||
xmlXPathContextPtr ctxt,
|
||||
unsigned int flags)
|
||||
{
|
||||
virStorageVolDefPtr def;
|
||||
virStorageVolDefPtr ret = NULL;
|
||||
virStorageVolOptionsPtr options;
|
||||
char *type = NULL;
|
||||
@ -1180,6 +1179,7 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
|
||||
xmlNodePtr *nodes = NULL;
|
||||
size_t i;
|
||||
int n;
|
||||
VIR_AUTOPTR(virStorageVolDef) def = NULL;
|
||||
|
||||
virCheckFlags(VIR_VOL_XML_PARSE_NO_CAPACITY |
|
||||
VIR_VOL_XML_PARSE_OPT_CAPACITY, NULL);
|
||||
@ -1331,7 +1331,6 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
|
||||
VIR_STEAL_PTR(ret, def);
|
||||
|
||||
cleanup:
|
||||
virStorageVolDefFree(def);
|
||||
VIR_FREE(nodes);
|
||||
VIR_FREE(allocation);
|
||||
VIR_FREE(capacity);
|
||||
|
@ -461,5 +461,6 @@ VIR_ENUM_DECL(virStoragePartedFs);
|
||||
VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE)
|
||||
|
||||
VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolSource, virStoragePoolSourceFree);
|
||||
VIR_DEFINE_AUTOPTR_FUNC(virStorageVolDef, virStorageVolDefFree);
|
||||
|
||||
#endif /* LIBVIRT_STORAGE_CONF_H */
|
||||
|
@ -836,7 +836,6 @@ esxStorageVolCreateXML(virStoragePoolPtr pool,
|
||||
virStorageVolPtr volume = NULL;
|
||||
esxPrivate *priv = pool->conn->privateData;
|
||||
virStoragePoolDef poolDef;
|
||||
virStorageVolDefPtr def = NULL;
|
||||
char *tmp;
|
||||
char *unescapedDatastorePath = NULL;
|
||||
char *unescapedDirectoryName = NULL;
|
||||
@ -852,6 +851,7 @@ esxStorageVolCreateXML(virStoragePoolPtr pool,
|
||||
char *taskInfoErrorMessage = NULL;
|
||||
char *uuid_string = NULL;
|
||||
char *key = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) def = NULL;
|
||||
|
||||
virCheckFlags(0, NULL);
|
||||
|
||||
@ -1024,7 +1024,6 @@ esxStorageVolCreateXML(virStoragePoolPtr pool,
|
||||
virtualDiskSpec->adapterType = NULL;
|
||||
}
|
||||
|
||||
virStorageVolDefFree(def);
|
||||
VIR_FREE(unescapedDatastorePath);
|
||||
VIR_FREE(unescapedDirectoryName);
|
||||
VIR_FREE(unescapedDirectoryAndFileName);
|
||||
@ -1054,7 +1053,6 @@ esxStorageVolCreateXMLFrom(virStoragePoolPtr pool,
|
||||
esxPrivate *priv = pool->conn->privateData;
|
||||
virStoragePoolDef poolDef;
|
||||
char *sourceDatastorePath = NULL;
|
||||
virStorageVolDefPtr def = NULL;
|
||||
char *tmp;
|
||||
char *unescapedDatastorePath = NULL;
|
||||
char *unescapedDirectoryName = NULL;
|
||||
@ -1069,6 +1067,7 @@ esxStorageVolCreateXMLFrom(virStoragePoolPtr pool,
|
||||
char *taskInfoErrorMessage = NULL;
|
||||
char *uuid_string = NULL;
|
||||
char *key = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) def = NULL;
|
||||
|
||||
virCheckFlags(0, NULL);
|
||||
|
||||
@ -1207,7 +1206,6 @@ esxStorageVolCreateXMLFrom(virStoragePoolPtr pool,
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(sourceDatastorePath);
|
||||
virStorageVolDefFree(def);
|
||||
VIR_FREE(unescapedDatastorePath);
|
||||
VIR_FREE(unescapedDirectoryName);
|
||||
VIR_FREE(unescapedDirectoryAndFileName);
|
||||
|
@ -1952,11 +1952,11 @@ phypStorageVolCreateXML(virStoragePoolPtr pool,
|
||||
{
|
||||
virCheckFlags(0, NULL);
|
||||
|
||||
virStorageVolDefPtr voldef = NULL;
|
||||
virStoragePoolDefPtr spdef = NULL;
|
||||
virStorageVolPtr vol = NULL;
|
||||
virStorageVolPtr dup_vol = NULL;
|
||||
char *key = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) voldef = NULL;
|
||||
|
||||
if (VIR_ALLOC(spdef) < 0)
|
||||
return NULL;
|
||||
@ -2036,7 +2036,6 @@ phypStorageVolCreateXML(virStoragePoolPtr pool,
|
||||
|
||||
err:
|
||||
VIR_FREE(key);
|
||||
virStorageVolDefFree(voldef);
|
||||
virStoragePoolDefFree(spdef);
|
||||
virObjectUnref(vol);
|
||||
return NULL;
|
||||
|
@ -242,12 +242,12 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
|
||||
virStorageVolDefPtr *volptr)
|
||||
{
|
||||
int ret = -1;
|
||||
virStorageVolDefPtr vol = NULL;
|
||||
glfs_fd_t *fd = NULL;
|
||||
virStorageSourcePtr meta = NULL;
|
||||
char *header = NULL;
|
||||
ssize_t len;
|
||||
int backingFormat;
|
||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||
|
||||
*volptr = NULL;
|
||||
|
||||
@ -331,7 +331,6 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virStorageSourceFree(meta);
|
||||
virStorageVolDefFree(vol);
|
||||
if (fd)
|
||||
glfs_close(fd);
|
||||
VIR_FREE(header);
|
||||
|
@ -305,22 +305,21 @@ virISCSIDirectRefreshVol(virStoragePoolObjPtr pool,
|
||||
char *portal)
|
||||
{
|
||||
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
|
||||
virStorageVolDefPtr vol = NULL;
|
||||
uint32_t block_size;
|
||||
uint32_t nb_block;
|
||||
int ret = -1;
|
||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||
|
||||
virStoragePoolObjClearVols(pool);
|
||||
if (virISCSIDirectTestUnitReady(iscsi, lun) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if (VIR_ALLOC(vol) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
vol->type = VIR_STORAGE_VOL_NETWORK;
|
||||
|
||||
if (virISCSIDirectGetVolumeCapacity(iscsi, lun, &block_size, &nb_block) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
vol->target.capacity = block_size * nb_block;
|
||||
vol->target.allocation = block_size * nb_block;
|
||||
@ -328,17 +327,13 @@ virISCSIDirectRefreshVol(virStoragePoolObjPtr pool,
|
||||
def->allocation += vol->target.allocation;
|
||||
|
||||
if (virISCSIDirectSetVolumeAttributes(pool, vol, lun, portal) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if (virStoragePoolObjAddVol(pool, vol) < 0)
|
||||
goto cleanup;
|
||||
|
||||
return -1;
|
||||
vol = NULL;
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virStorageVolDefFree(vol);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -46,42 +46,36 @@ virStorageBackendMpathNewVol(virStoragePoolObjPtr pool,
|
||||
const char *dev)
|
||||
{
|
||||
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
|
||||
virStorageVolDefPtr vol;
|
||||
int ret = -1;
|
||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||
|
||||
if (VIR_ALLOC(vol) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
vol->type = VIR_STORAGE_VOL_BLOCK;
|
||||
|
||||
if (virAsprintf(&(vol->name), "dm-%u", devnum) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if (virAsprintf(&vol->target.path, "/dev/%s", dev) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if (virStorageBackendUpdateVolInfo(vol, true,
|
||||
VIR_STORAGE_VOL_OPEN_DEFAULT, 0) < 0) {
|
||||
goto cleanup;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* XXX should use logical unit's UUID instead */
|
||||
if (VIR_STRDUP(vol->key, vol->target.path) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
if (virStoragePoolObjAddVol(pool, vol) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
def->capacity += vol->target.capacity;
|
||||
def->allocation += vol->target.allocation;
|
||||
ret = 0;
|
||||
vol = NULL;
|
||||
|
||||
cleanup:
|
||||
|
||||
if (ret != 0)
|
||||
virStorageVolDefFree(vol);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -618,7 +618,7 @@ virStorageBackendRBDRefreshPool(virStoragePoolObjPtr pool)
|
||||
}
|
||||
|
||||
for (name = names; name < names + max_size;) {
|
||||
virStorageVolDefPtr vol;
|
||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||
|
||||
if (STREQ(name, ""))
|
||||
break;
|
||||
@ -626,10 +626,8 @@ virStorageBackendRBDRefreshPool(virStoragePoolObjPtr pool)
|
||||
if (VIR_ALLOC(vol) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (VIR_STRDUP(vol->name, name) < 0) {
|
||||
VIR_FREE(vol);
|
||||
if (VIR_STRDUP(vol->name, name) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
name += strlen(name) + 1;
|
||||
|
||||
@ -648,15 +646,14 @@ virStorageBackendRBDRefreshPool(virStoragePoolObjPtr pool)
|
||||
if (r == -ENOENT || r == -ETIMEDOUT)
|
||||
continue;
|
||||
|
||||
virStorageVolDefFree(vol);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virStoragePoolObjAddVol(pool, vol) < 0) {
|
||||
virStorageVolDefFree(vol);
|
||||
virStoragePoolObjClearVols(pool);
|
||||
goto cleanup;
|
||||
}
|
||||
vol = NULL;
|
||||
}
|
||||
|
||||
VIR_DEBUG("Found %zu images in RBD pool %s",
|
||||
|
@ -110,30 +110,27 @@ virStorageBackendSheepdogAddHostArg(virCommandPtr cmd,
|
||||
static int
|
||||
virStorageBackendSheepdogAddVolume(virStoragePoolObjPtr pool, const char *diskInfo)
|
||||
{
|
||||
virStorageVolDefPtr vol = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||
|
||||
if (diskInfo == NULL) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Missing disk info when adding volume"));
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (VIR_ALLOC(vol) < 0 || VIR_STRDUP(vol->name, diskInfo) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
vol->type = VIR_STORAGE_VOL_NETWORK;
|
||||
|
||||
if (virStorageBackendSheepdogRefreshVol(pool, vol) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
if (virStoragePoolObjAddVol(pool, vol) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
vol = NULL;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
virStorageVolDefFree(vol);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1820,8 +1820,8 @@ storageVolCreateXML(virStoragePoolPtr pool,
|
||||
virStoragePoolObjPtr obj;
|
||||
virStoragePoolDefPtr def;
|
||||
virStorageBackendPtr backend;
|
||||
virStorageVolDefPtr voldef = NULL;
|
||||
virStorageVolPtr vol = NULL, newvol = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) voldef = NULL;
|
||||
|
||||
virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, NULL);
|
||||
|
||||
@ -1941,7 +1941,6 @@ storageVolCreateXML(virStoragePoolPtr pool,
|
||||
|
||||
cleanup:
|
||||
virObjectUnref(newvol);
|
||||
virStorageVolDefFree(voldef);
|
||||
virStoragePoolObjEndAPI(&obj);
|
||||
return vol;
|
||||
}
|
||||
@ -1957,11 +1956,11 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
|
||||
virStoragePoolObjPtr objsrc = NULL;
|
||||
virStorageBackendPtr backend;
|
||||
virStorageVolDefPtr voldefsrc = NULL;
|
||||
virStorageVolDefPtr voldef = NULL;
|
||||
virStorageVolDefPtr shadowvol = NULL;
|
||||
virStorageVolPtr newvol = NULL;
|
||||
virStorageVolPtr vol = NULL;
|
||||
int buildret;
|
||||
VIR_AUTOPTR(virStorageVolDef) voldef = NULL;
|
||||
|
||||
virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA |
|
||||
VIR_STORAGE_VOL_CREATE_REFLINK,
|
||||
@ -2134,7 +2133,6 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
|
||||
|
||||
cleanup:
|
||||
virObjectUnref(newvol);
|
||||
virStorageVolDefFree(voldef);
|
||||
VIR_FREE(shadowvol);
|
||||
virStoragePoolObjEndAPI(&obj);
|
||||
virStoragePoolObjEndAPI(&objsrc);
|
||||
|
@ -3672,10 +3672,10 @@ virStorageBackendRefreshLocal(virStoragePoolObjPtr pool)
|
||||
struct dirent *ent;
|
||||
struct statvfs sb;
|
||||
struct stat statbuf;
|
||||
virStorageVolDefPtr vol = NULL;
|
||||
virStorageSourcePtr target = NULL;
|
||||
int direrr;
|
||||
int fd = -1, ret = -1;
|
||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||
|
||||
if (virDirOpen(&dir, def->target.path) < 0)
|
||||
goto cleanup;
|
||||
@ -3767,7 +3767,6 @@ virStorageBackendRefreshLocal(virStoragePoolObjPtr pool)
|
||||
cleanup:
|
||||
VIR_DIR_CLOSE(dir);
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
virStorageVolDefFree(vol);
|
||||
virStorageSourceFree(target);
|
||||
if (ret < 0)
|
||||
virStoragePoolObjClearVols(pool);
|
||||
@ -3816,9 +3815,9 @@ virStorageBackendSCSINewLun(virStoragePoolObjPtr pool,
|
||||
const char *dev)
|
||||
{
|
||||
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
|
||||
virStorageVolDefPtr vol = NULL;
|
||||
char *devpath = NULL;
|
||||
int retval = -1;
|
||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||
|
||||
/* Check if the pool is using a stable target path. The call to
|
||||
* virStorageBackendStablePath will fail if the pool target path
|
||||
@ -3898,7 +3897,6 @@ virStorageBackendSCSINewLun(virStoragePoolObjPtr pool,
|
||||
retval = 0;
|
||||
|
||||
cleanup:
|
||||
virStorageVolDefFree(vol);
|
||||
VIR_FREE(devpath);
|
||||
return retval;
|
||||
}
|
||||
|
@ -1025,7 +1025,7 @@ testOpenVolumesForPool(const char *file,
|
||||
size_t i;
|
||||
int num, ret = -1;
|
||||
xmlNodePtr *nodes = NULL;
|
||||
virStorageVolDefPtr volDef = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) volDef = NULL;
|
||||
|
||||
/* Find storage volumes */
|
||||
if (virAsprintf(&vol_xpath, "/node/pool[%d]/volume", objidx) < 0)
|
||||
@ -1064,7 +1064,6 @@ testOpenVolumesForPool(const char *file,
|
||||
|
||||
ret = 0;
|
||||
error:
|
||||
virStorageVolDefFree(volDef);
|
||||
VIR_FREE(nodes);
|
||||
return ret;
|
||||
}
|
||||
@ -5051,8 +5050,8 @@ testStorageVolCreateXML(virStoragePoolPtr pool,
|
||||
testDriverPtr privconn = pool->conn->privateData;
|
||||
virStoragePoolObjPtr obj;
|
||||
virStoragePoolDefPtr def;
|
||||
virStorageVolDefPtr privvol = NULL;
|
||||
virStorageVolPtr ret = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) privvol = NULL;
|
||||
|
||||
virCheckFlags(0, NULL);
|
||||
|
||||
@ -5096,7 +5095,6 @@ testStorageVolCreateXML(virStoragePoolPtr pool,
|
||||
privvol = NULL;
|
||||
|
||||
cleanup:
|
||||
virStorageVolDefFree(privvol);
|
||||
virStoragePoolObjEndAPI(&obj);
|
||||
return ret;
|
||||
}
|
||||
@ -5111,8 +5109,9 @@ testStorageVolCreateXMLFrom(virStoragePoolPtr pool,
|
||||
testDriverPtr privconn = pool->conn->privateData;
|
||||
virStoragePoolObjPtr obj;
|
||||
virStoragePoolDefPtr def;
|
||||
virStorageVolDefPtr privvol = NULL, origvol = NULL;
|
||||
virStorageVolDefPtr origvol = NULL;
|
||||
virStorageVolPtr ret = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) privvol = NULL;
|
||||
|
||||
virCheckFlags(0, NULL);
|
||||
|
||||
@ -5164,7 +5163,6 @@ testStorageVolCreateXMLFrom(virStoragePoolPtr pool,
|
||||
privvol = NULL;
|
||||
|
||||
cleanup:
|
||||
virStorageVolDefFree(privvol);
|
||||
virStoragePoolObjEndAPI(&obj);
|
||||
return ret;
|
||||
}
|
||||
|
@ -401,7 +401,6 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool,
|
||||
const char *xml, unsigned int flags)
|
||||
{
|
||||
vboxDriverPtr data = pool->conn->privateData;
|
||||
virStorageVolDefPtr def = NULL;
|
||||
PRUnichar *hddFormatUtf16 = NULL;
|
||||
PRUnichar *hddNameUtf16 = NULL;
|
||||
virStoragePoolDef poolDef;
|
||||
@ -415,6 +414,7 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool,
|
||||
PRUint32 variant = HardDiskVariant_Standard;
|
||||
resultCodeUnion resultCode;
|
||||
virStorageVolPtr ret = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) def = NULL;
|
||||
|
||||
if (!data->vboxObj)
|
||||
return ret;
|
||||
@ -501,7 +501,6 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool,
|
||||
VBOX_RELEASE(progress);
|
||||
VBOX_UTF16_FREE(hddFormatUtf16);
|
||||
VBOX_UTF16_FREE(hddNameUtf16);
|
||||
virStorageVolDefFree(def);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ test_vdi_list_parser(const void *opaque)
|
||||
int ret = -1;
|
||||
char *output = NULL;
|
||||
virStoragePoolDefPtr pool = NULL;
|
||||
virStorageVolDefPtr vol = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||
|
||||
if (!(pool = virStoragePoolDefParseFile(data->poolxml)))
|
||||
goto cleanup;
|
||||
@ -121,7 +121,6 @@ test_vdi_list_parser(const void *opaque)
|
||||
cleanup:
|
||||
VIR_FREE(output);
|
||||
virStoragePoolDefFree(pool);
|
||||
virStorageVolDefFree(vol);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -48,10 +48,11 @@ testCompareXMLToArgvFiles(bool shouldFail,
|
||||
|
||||
virCommandPtr cmd = NULL;
|
||||
|
||||
virStorageVolDefPtr vol = NULL, inputvol = NULL;
|
||||
virStoragePoolDefPtr def = NULL;
|
||||
virStoragePoolDefPtr inputpool = NULL;
|
||||
virStoragePoolObjPtr obj = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) vol = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) inputvol = NULL;
|
||||
|
||||
if (!(def = virStoragePoolDefParseFile(poolxml)))
|
||||
goto cleanup;
|
||||
@ -139,8 +140,6 @@ testCompareXMLToArgvFiles(bool shouldFail,
|
||||
|
||||
cleanup:
|
||||
virStoragePoolDefFree(inputpool);
|
||||
virStorageVolDefFree(vol);
|
||||
virStorageVolDefFree(inputvol);
|
||||
virCommandFree(cmd);
|
||||
VIR_FREE(actualCmdline);
|
||||
virStoragePoolObjEndAPI(&obj);
|
||||
|
@ -20,7 +20,7 @@ testCompareXMLToXMLFiles(const char *poolxml, const char *inxml,
|
||||
char *actual = NULL;
|
||||
int ret = -1;
|
||||
virStoragePoolDefPtr pool = NULL;
|
||||
virStorageVolDefPtr dev = NULL;
|
||||
VIR_AUTOPTR(virStorageVolDef) dev = NULL;
|
||||
|
||||
if (!(pool = virStoragePoolDefParseFile(poolxml)))
|
||||
goto fail;
|
||||
@ -39,7 +39,6 @@ testCompareXMLToXMLFiles(const char *poolxml, const char *inxml,
|
||||
fail:
|
||||
VIR_FREE(actual);
|
||||
virStoragePoolDefFree(pool);
|
||||
virStorageVolDefFree(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user