mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
util: storage: Remove obsolete argument virStorageFileGetMetadataInternal
As we already pass the whole structure down the call path there's no need to return some stuff in a separate argument. Remove the argument and tweak callers to avoid breaking semantics. virStorageFileGetMetadataFromBuf will be refactored later along with the storage driver.
This commit is contained in:
parent
9944b710a5
commit
5c43e2e027
@ -795,7 +795,7 @@ qcow2GetFeatures(virBitmapPtr *features,
|
|||||||
* information about the file and its backing store. */
|
* information about the file and its backing store. */
|
||||||
static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
|
||||||
ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(7)
|
ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(7)
|
||||||
ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(9)
|
ATTRIBUTE_NONNULL(8)
|
||||||
virStorageFileGetMetadataInternal(const char *path,
|
virStorageFileGetMetadataInternal(const char *path,
|
||||||
const char *canonPath,
|
const char *canonPath,
|
||||||
const char *directory,
|
const char *directory,
|
||||||
@ -803,7 +803,6 @@ virStorageFileGetMetadataInternal(const char *path,
|
|||||||
size_t len,
|
size_t len,
|
||||||
int format,
|
int format,
|
||||||
virStorageFileMetadataPtr meta,
|
virStorageFileMetadataPtr meta,
|
||||||
char **backingStore,
|
|
||||||
int *backingFormat,
|
int *backingFormat,
|
||||||
char **backingDirectory)
|
char **backingDirectory)
|
||||||
{
|
{
|
||||||
@ -891,10 +890,6 @@ virStorageFileGetMetadataInternal(const char *path,
|
|||||||
if (VIR_STRDUP(meta->backingStore, meta->backingStoreRaw) < 0)
|
if (VIR_STRDUP(meta->backingStore, meta->backingStoreRaw) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (backingStore &&
|
|
||||||
VIR_STRDUP(*backingStore, meta->backingStoreRaw) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
*backingFormat = VIR_STORAGE_FILE_RAW;
|
*backingFormat = VIR_STORAGE_FILE_RAW;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1020,12 +1015,17 @@ virStorageFileGetMetadataFromBuf(const char *path,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virStorageFileGetMetadataInternal(path, canonPath, ".", buf, len,
|
if (virStorageFileGetMetadataInternal(path, canonPath, ".", buf, len,
|
||||||
format, ret, backing,
|
format, ret,
|
||||||
backingFormat, NULL) < 0) {
|
backingFormat, NULL) < 0) {
|
||||||
virStorageFileFreeMetadata(ret);
|
virStorageFileFreeMetadata(ret);
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (VIR_STRDUP(*backing, ret->backingStoreRaw) < 0) {
|
||||||
|
virStorageFileFreeMetadata(ret);
|
||||||
|
ret = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(canonPath);
|
VIR_FREE(canonPath);
|
||||||
return ret;
|
return ret;
|
||||||
@ -1083,7 +1083,6 @@ virStorageFileGetMetadataFromFDInternal(const char *path,
|
|||||||
|
|
||||||
ret = virStorageFileGetMetadataInternal(path, canonPath, directory,
|
ret = virStorageFileGetMetadataInternal(path, canonPath, directory,
|
||||||
buf, len, format, meta,
|
buf, len, format, meta,
|
||||||
NULL,
|
|
||||||
backingFormat, backingDirectory);
|
backingFormat, backingDirectory);
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user