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:
Peter Krempa 2014-04-15 14:28:10 +02:00
parent 9944b710a5
commit 5c43e2e027
1 changed files with 7 additions and 8 deletions

View File

@ -795,7 +795,7 @@ qcow2GetFeatures(virBitmapPtr *features,
* information about the file and its backing store. */
static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(7)
ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(9)
ATTRIBUTE_NONNULL(8)
virStorageFileGetMetadataInternal(const char *path,
const char *canonPath,
const char *directory,
@ -803,7 +803,6 @@ virStorageFileGetMetadataInternal(const char *path,
size_t len,
int format,
virStorageFileMetadataPtr meta,
char **backingStore,
int *backingFormat,
char **backingDirectory)
{
@ -891,10 +890,6 @@ virStorageFileGetMetadataInternal(const char *path,
if (VIR_STRDUP(meta->backingStore, meta->backingStoreRaw) < 0)
goto cleanup;
if (backingStore &&
VIR_STRDUP(*backingStore, meta->backingStoreRaw) < 0)
goto cleanup;
*backingFormat = VIR_STORAGE_FILE_RAW;
}
} else {
@ -1020,12 +1015,17 @@ virStorageFileGetMetadataFromBuf(const char *path,
goto cleanup;
if (virStorageFileGetMetadataInternal(path, canonPath, ".", buf, len,
format, ret, backing,
format, ret,
backingFormat, NULL) < 0) {
virStorageFileFreeMetadata(ret);
ret = NULL;
}
if (VIR_STRDUP(*backing, ret->backingStoreRaw) < 0) {
virStorageFileFreeMetadata(ret);
ret = NULL;
}
cleanup:
VIR_FREE(canonPath);
return ret;
@ -1083,7 +1083,6 @@ virStorageFileGetMetadataFromFDInternal(const char *path,
ret = virStorageFileGetMetadataInternal(path, canonPath, directory,
buf, len, format, meta,
NULL,
backingFormat, backingDirectory);
if (ret == 0) {