提交 5c43e2e0 编写于 作者: P Peter Krempa

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.
上级 9944b710
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册