mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
conf: storage: Provide only virStorageVolDefParse
Remove the virStorageVolDefParseFile/String shim functions. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
3c56186031
commit
2a166e6c12
@ -1401,7 +1401,7 @@ virStorageVolDefParseXML(virStoragePoolDef *pool,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virStorageVolDef *
|
virStorageVolDef *
|
||||||
virStorageVolDefParse(virStoragePoolDef *pool,
|
virStorageVolDefParse(virStoragePoolDef *pool,
|
||||||
const char *xmlStr,
|
const char *xmlStr,
|
||||||
const char *filename,
|
const char *filename,
|
||||||
@ -1418,24 +1418,6 @@ virStorageVolDefParse(virStoragePoolDef *pool,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virStorageVolDef *
|
|
||||||
virStorageVolDefParseString(virStoragePoolDef *pool,
|
|
||||||
const char *xmlStr,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
return virStorageVolDefParse(pool, xmlStr, NULL, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
virStorageVolDef *
|
|
||||||
virStorageVolDefParseFile(virStoragePoolDef *pool,
|
|
||||||
const char *filename,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
return virStorageVolDefParse(pool, NULL, filename, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
virStorageVolTimestampFormat(virBuffer *buf, const char *name,
|
virStorageVolTimestampFormat(virBuffer *buf, const char *name,
|
||||||
struct timespec *ts)
|
struct timespec *ts)
|
||||||
|
@ -287,14 +287,10 @@ typedef enum {
|
|||||||
} virStorageVolDefParseFlags;
|
} virStorageVolDefParseFlags;
|
||||||
|
|
||||||
virStorageVolDef *
|
virStorageVolDef *
|
||||||
virStorageVolDefParseString(virStoragePoolDef *pool,
|
virStorageVolDefParse(virStoragePoolDef *pool,
|
||||||
const char *xml,
|
const char *xmlStr,
|
||||||
unsigned int flags);
|
const char *filename,
|
||||||
|
unsigned int flags);
|
||||||
virStorageVolDef *
|
|
||||||
virStorageVolDefParseFile(virStoragePoolDef *pool,
|
|
||||||
const char *filename,
|
|
||||||
unsigned int flags);
|
|
||||||
|
|
||||||
virStorageVolDef *
|
virStorageVolDef *
|
||||||
virStorageVolDefParseXML(virStoragePoolDef *pool,
|
virStorageVolDefParseXML(virStoragePoolDef *pool,
|
||||||
|
@ -861,7 +861,7 @@ esxStorageVolCreateXML(virStoragePoolPtr pool,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Parse config */
|
/* Parse config */
|
||||||
def = virStorageVolDefParseString(&poolDef, xmldesc, 0);
|
def = virStorageVolDefParse(&poolDef, xmldesc, NULL, 0);
|
||||||
|
|
||||||
if (!def)
|
if (!def)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -1063,7 +1063,7 @@ esxStorageVolCreateXMLFrom(virStoragePoolPtr pool,
|
|||||||
sourceVolume->name);
|
sourceVolume->name);
|
||||||
|
|
||||||
/* Parse config */
|
/* Parse config */
|
||||||
def = virStorageVolDefParseString(&poolDef, xmldesc, 0);
|
def = virStorageVolDefParse(&poolDef, xmldesc, NULL, 0);
|
||||||
|
|
||||||
if (!def)
|
if (!def)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -1078,8 +1078,7 @@ virStorageVolDefFindByName;
|
|||||||
virStorageVolDefFindByPath;
|
virStorageVolDefFindByPath;
|
||||||
virStorageVolDefFormat;
|
virStorageVolDefFormat;
|
||||||
virStorageVolDefFree;
|
virStorageVolDefFree;
|
||||||
virStorageVolDefParseFile;
|
virStorageVolDefParse;
|
||||||
virStorageVolDefParseString;
|
|
||||||
virStorageVolDefParseXML;
|
virStorageVolDefParseXML;
|
||||||
virStorageVolDefRefreshAllocationTypeFromString;
|
virStorageVolDefRefreshAllocationTypeFromString;
|
||||||
virStorageVolDefRefreshAllocationTypeToString;
|
virStorageVolDefRefreshAllocationTypeToString;
|
||||||
|
@ -1893,8 +1893,7 @@ storageVolCreateXML(virStoragePoolPtr pool,
|
|||||||
if ((backend = virStorageBackendForType(def->type)) == NULL)
|
if ((backend = virStorageBackendForType(def->type)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
voldef = virStorageVolDefParseString(def, xmldesc,
|
voldef = virStorageVolDefParse(def, xmldesc, NULL, VIR_VOL_XML_PARSE_OPT_CAPACITY);
|
||||||
VIR_VOL_XML_PARSE_OPT_CAPACITY);
|
|
||||||
if (voldef == NULL)
|
if (voldef == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -2067,8 +2066,7 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
voldef = virStorageVolDefParseString(def, xmldesc,
|
voldef = virStorageVolDefParse(def, xmldesc, NULL, VIR_VOL_XML_PARSE_NO_CAPACITY);
|
||||||
VIR_VOL_XML_PARSE_NO_CAPACITY);
|
|
||||||
if (voldef == NULL)
|
if (voldef == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -7198,7 +7198,7 @@ testStorageVolCreateXML(virStoragePoolPtr pool,
|
|||||||
return NULL;
|
return NULL;
|
||||||
def = virStoragePoolObjGetDef(obj);
|
def = virStoragePoolObjGetDef(obj);
|
||||||
|
|
||||||
privvol = virStorageVolDefParseString(def, xmldesc, 0);
|
privvol = virStorageVolDefParse(def, xmldesc, NULL, 0);
|
||||||
if (privvol == NULL)
|
if (privvol == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -7257,7 +7257,7 @@ testStorageVolCreateXMLFrom(virStoragePoolPtr pool,
|
|||||||
return NULL;
|
return NULL;
|
||||||
def = virStoragePoolObjGetDef(obj);
|
def = virStoragePoolObjGetDef(obj);
|
||||||
|
|
||||||
privvol = virStorageVolDefParseString(def, xmldesc, 0);
|
privvol = virStorageVolDefParse(def, xmldesc, NULL, 0);
|
||||||
if (privvol == NULL)
|
if (privvol == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool,
|
|||||||
memset(&poolDef, 0, sizeof(poolDef));
|
memset(&poolDef, 0, sizeof(poolDef));
|
||||||
poolDef.type = VIR_STORAGE_POOL_DIR;
|
poolDef.type = VIR_STORAGE_POOL_DIR;
|
||||||
|
|
||||||
if ((def = virStorageVolDefParseString(&poolDef, xml, 0)) == NULL)
|
if ((def = virStorageVolDefParse(&poolDef, xml, NULL, 0)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!def->name ||
|
if (!def->name ||
|
||||||
|
@ -65,11 +65,11 @@ testCompareXMLToArgvFiles(bool shouldFail,
|
|||||||
if (inputvolxml)
|
if (inputvolxml)
|
||||||
parse_flags |= VIR_VOL_XML_PARSE_NO_CAPACITY;
|
parse_flags |= VIR_VOL_XML_PARSE_NO_CAPACITY;
|
||||||
|
|
||||||
if (!(vol = virStorageVolDefParseFile(def, volxml, parse_flags)))
|
if (!(vol = virStorageVolDefParse(def, NULL, volxml, parse_flags)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (inputvolxml &&
|
if (inputvolxml &&
|
||||||
!(inputvol = virStorageVolDefParseFile(inputpool, inputvolxml, 0)))
|
!(inputvol = virStorageVolDefParse(inputpool, NULL, inputvolxml, 0)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
testSetVolumeType(vol, def);
|
testSetVolumeType(vol, def);
|
||||||
|
@ -22,7 +22,7 @@ testCompareXMLToXMLFiles(const char *poolxml, const char *inxml,
|
|||||||
if (!(pool = virStoragePoolDefParse(NULL, poolxml, 0)))
|
if (!(pool = virStoragePoolDefParse(NULL, poolxml, 0)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(dev = virStorageVolDefParseFile(pool, inxml, flags)))
|
if (!(dev = virStorageVolDefParse(pool, NULL, inxml, flags)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(actual = virStorageVolDefFormat(pool, dev)))
|
if (!(actual = virStorageVolDefFormat(pool, dev)))
|
||||||
|
Loading…
Reference in New Issue
Block a user