mirror of https://gitee.com/openkylin/libvirt.git
virStorageFileGetMetadataFromBuf: Remove 'backingFormat' argument
None of the callers actually use it. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
fee56942e2
commit
57df35aead
|
@ -275,8 +275,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
|
|||
goto cleanup;
|
||||
|
||||
if (!(meta = virStorageFileGetMetadataFromBuf(name, header, len,
|
||||
VIR_STORAGE_FILE_AUTO,
|
||||
NULL)))
|
||||
VIR_STORAGE_FILE_AUTO)))
|
||||
goto cleanup;
|
||||
|
||||
if (meta->backingStoreRaw) {
|
||||
|
|
|
@ -1109,7 +1109,6 @@ virStorageFileMetadataNew(const char *path,
|
|||
* @buf: header bytes from @path
|
||||
* @len: length of @buf
|
||||
* @format: format of the storage file
|
||||
* @backingFormat: format of @backing
|
||||
*
|
||||
* Extract metadata about the storage volume with the specified image format.
|
||||
* If image format is VIR_STORAGE_FILE_AUTO, it will probe to automatically
|
||||
|
@ -1119,9 +1118,10 @@ virStorageFileMetadataNew(const char *path,
|
|||
* that might be raw if that file will then be passed to a guest, since a
|
||||
* malicious guest can turn a raw file into any other non-raw format at will.
|
||||
*
|
||||
* If the returned @backingFormat is VIR_STORAGE_FILE_AUTO it indicates the
|
||||
* image didn't specify an explicit format for its backing store. Callers are
|
||||
* advised against probing for the backing store format in this case.
|
||||
* If the 'backingStoreRawFormat' field of the returned structure is
|
||||
* VIR_STORAGE_FILE_AUTO it indicates the image didn't specify an explicit
|
||||
* format for its backing store. Callers are advised against probing for the
|
||||
* backing store format in this case.
|
||||
*
|
||||
* Caller MUST free the result after use via virObjectUnref.
|
||||
*/
|
||||
|
@ -1129,8 +1129,7 @@ virStorageSourcePtr
|
|||
virStorageFileGetMetadataFromBuf(const char *path,
|
||||
char *buf,
|
||||
size_t len,
|
||||
int format,
|
||||
int *backingFormat)
|
||||
int format)
|
||||
{
|
||||
virStorageSourcePtr ret = NULL;
|
||||
|
||||
|
@ -1142,9 +1141,6 @@ virStorageFileGetMetadataFromBuf(const char *path,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (backingFormat)
|
||||
*backingFormat = ret->backingStoreRawFormat;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3991,7 +3987,7 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr src,
|
|||
if (format == VIR_STORAGE_FILE_RAW && !src->encryption) {
|
||||
src->capacity = src->physical;
|
||||
} else if ((meta = virStorageFileGetMetadataFromBuf(src->path, buf,
|
||||
len, format, NULL))) {
|
||||
len, format))) {
|
||||
src->capacity = meta->capacity ? meta->capacity : src->physical;
|
||||
if (src->encryption && meta->encryption)
|
||||
src->encryption->payload_offset = meta->encryption->payload_offset;
|
||||
|
|
|
@ -386,8 +386,7 @@ virStorageSourcePtr virStorageFileGetMetadataFromFD(const char *path,
|
|||
virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
|
||||
char *buf,
|
||||
size_t len,
|
||||
int format,
|
||||
int *backingFormat)
|
||||
int format)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
int virStorageFileChainGetBroken(virStorageSourcePtr chain,
|
||||
char **broken_file);
|
||||
|
|
Loading…
Reference in New Issue