mirror of https://gitee.com/openkylin/libvirt.git
virStorageFileGetMetadataFromFD: Remove unused 'backingFormat' argument
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
57df35aead
commit
c95656c995
|
@ -3358,8 +3358,7 @@ storageBackendProbeTarget(virStorageSourcePtr target,
|
||||||
|
|
||||||
if (!(meta = virStorageFileGetMetadataFromFD(target->path,
|
if (!(meta = virStorageFileGetMetadataFromFD(target->path,
|
||||||
fd,
|
fd,
|
||||||
VIR_STORAGE_FILE_AUTO,
|
VIR_STORAGE_FILE_AUTO)))
|
||||||
NULL)))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (meta->backingStoreRaw) {
|
if (meta->backingStoreRaw) {
|
||||||
|
|
|
@ -1161,21 +1161,14 @@ virStorageFileGetMetadataFromBuf(const char *path,
|
||||||
virStorageSourcePtr
|
virStorageSourcePtr
|
||||||
virStorageFileGetMetadataFromFD(const char *path,
|
virStorageFileGetMetadataFromFD(const char *path,
|
||||||
int fd,
|
int fd,
|
||||||
int format,
|
int format)
|
||||||
int *backingFormat)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
ssize_t len = VIR_STORAGE_MAX_HEADER;
|
ssize_t len = VIR_STORAGE_MAX_HEADER;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
int dummy;
|
|
||||||
g_autofree char *buf = NULL;
|
g_autofree char *buf = NULL;
|
||||||
g_autoptr(virStorageSource) meta = NULL;
|
g_autoptr(virStorageSource) meta = NULL;
|
||||||
|
|
||||||
if (!backingFormat)
|
|
||||||
backingFormat = &dummy;
|
|
||||||
|
|
||||||
*backingFormat = VIR_STORAGE_FILE_NONE;
|
|
||||||
|
|
||||||
if (fstat(fd, &sb) < 0) {
|
if (fstat(fd, &sb) < 0) {
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
_("cannot stat file '%s'"), path);
|
_("cannot stat file '%s'"), path);
|
||||||
|
@ -1206,9 +1199,6 @@ virStorageFileGetMetadataFromFD(const char *path,
|
||||||
if (virStorageFileGetMetadataInternal(meta, buf, len) < 0)
|
if (virStorageFileGetMetadataInternal(meta, buf, len) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (backingFormat)
|
|
||||||
*backingFormat = meta->backingStoreRawFormat;
|
|
||||||
|
|
||||||
if (S_ISREG(sb.st_mode))
|
if (S_ISREG(sb.st_mode))
|
||||||
meta->type = VIR_STORAGE_TYPE_FILE;
|
meta->type = VIR_STORAGE_TYPE_FILE;
|
||||||
else if (S_ISBLK(sb.st_mode))
|
else if (S_ISBLK(sb.st_mode))
|
||||||
|
|
|
@ -381,8 +381,7 @@ int virStorageFileProbeFormat(const char *path, uid_t uid, gid_t gid);
|
||||||
|
|
||||||
virStorageSourcePtr virStorageFileGetMetadataFromFD(const char *path,
|
virStorageSourcePtr virStorageFileGetMetadataFromFD(const char *path,
|
||||||
int fd,
|
int fd,
|
||||||
int format,
|
int format);
|
||||||
int *backingFormat);
|
|
||||||
virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
|
virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
|
||||||
char *buf,
|
char *buf,
|
||||||
size_t len,
|
size_t len,
|
||||||
|
|
Loading…
Reference in New Issue