mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
storage: Return backing format from virStorageFileGetMetadataFromFD
Add argument to return backing file format of a file probed by virStorageFileGetMetadataFromFD so that it can be used in place of virStorageFileGetMetadataFromBuf.
This commit is contained in:
parent
e6bcbcd32c
commit
5a1cf6bd16
@ -10364,7 +10364,7 @@ qemuDomainGetBlockInfo(virDomainPtr dom,
|
||||
}
|
||||
}
|
||||
|
||||
if (!(meta = virStorageFileGetMetadataFromFD(path, fd, format)))
|
||||
if (!(meta = virStorageFileGetMetadataFromFD(path, fd, format, NULL)))
|
||||
goto cleanup;
|
||||
|
||||
/* Get info for normal formats */
|
||||
|
@ -1091,14 +1091,16 @@ virStorageFileGetMetadataFromFDInternal(virStorageSourcePtr meta,
|
||||
virStorageSourcePtr
|
||||
virStorageFileGetMetadataFromFD(const char *path,
|
||||
int fd,
|
||||
int format)
|
||||
int format,
|
||||
int *backingFormat)
|
||||
|
||||
{
|
||||
virStorageSourcePtr ret = NULL;
|
||||
|
||||
if (!(ret = virStorageFileMetadataNew(path, format)))
|
||||
goto cleanup;
|
||||
|
||||
if (virStorageFileGetMetadataFromFDInternal(ret, fd, NULL) < 0) {
|
||||
if (virStorageFileGetMetadataFromFDInternal(ret, fd, backingFormat) < 0) {
|
||||
virStorageSourceFree(ret);
|
||||
ret = NULL;
|
||||
}
|
||||
|
@ -271,7 +271,8 @@ int virStorageFileGetMetadata(virStorageSourcePtr src,
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
virStorageSourcePtr virStorageFileGetMetadataFromFD(const char *path,
|
||||
int fd,
|
||||
int format);
|
||||
int format,
|
||||
int *backingFormat);
|
||||
virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
|
||||
char *buf,
|
||||
size_t len,
|
||||
|
Loading…
Reference in New Issue
Block a user