libvirt/SOURCES/libvirt-virStorageFileGetMetadataFromFD-Remove-unused-backingFormat-argument.patch
2021-09-10 11:58:15 +00:00

92 lines
3.5 KiB
Diff

From c813373a8e6ab6efcd90fd65e7ea15431733280f Mon Sep 17 00:00:00 2001
Message-Id: <c813373a8e6ab6efcd90fd65e7ea15431733280f@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Fri, 28 Feb 2020 10:24:41 +0100
Subject: [PATCH] virStorageFileGetMetadataFromFD: Remove unused
'backingFormat' argument
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit c95656c995e9af260c6dfab69c6da0da8a3ae50c)
https://bugzilla.redhat.com/show_bug.cgi?id=1798148
Message-Id: <7e26b363b7628de0f22e2fa45b2d1ce79a81d59e.1582881363.git.pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/storage/storage_util.c | 3 +--
src/util/virstoragefile.c | 12 +-----------
src/util/virstoragefile.h | 3 +--
3 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index f3e899d0ca..0e80983f1f 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -3345,8 +3345,7 @@ storageBackendProbeTarget(virStorageSourcePtr target,
if (!(meta = virStorageFileGetMetadataFromFD(target->path,
fd,
- VIR_STORAGE_FILE_AUTO,
- NULL)))
+ VIR_STORAGE_FILE_AUTO)))
return -1;
if (meta->backingStoreRaw) {
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 1b9bd12284..0bfd9e16e9 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -1161,21 +1161,14 @@ virStorageFileGetMetadataFromBuf(const char *path,
virStorageSourcePtr
virStorageFileGetMetadataFromFD(const char *path,
int fd,
- int format,
- int *backingFormat)
+ int format)
{
ssize_t len = VIR_STORAGE_MAX_HEADER;
struct stat sb;
- int dummy;
g_autofree char *buf = NULL;
g_autoptr(virStorageSource) meta = NULL;
- if (!backingFormat)
- backingFormat = &dummy;
-
- *backingFormat = VIR_STORAGE_FILE_NONE;
-
if (fstat(fd, &sb) < 0) {
virReportSystemError(errno,
_("cannot stat file '%s'"), path);
@@ -1206,9 +1199,6 @@ virStorageFileGetMetadataFromFD(const char *path,
if (virStorageFileGetMetadataInternal(meta, buf, len) < 0)
return NULL;
- if (backingFormat)
- *backingFormat = meta->backingStoreRawFormat;
-
if (S_ISREG(sb.st_mode))
meta->type = VIR_STORAGE_TYPE_FILE;
else if (S_ISBLK(sb.st_mode))
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index 32f2c82147..5b995d54ab 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -381,8 +381,7 @@ int virStorageFileProbeFormat(const char *path, uid_t uid, gid_t gid);
virStorageSourcePtr virStorageFileGetMetadataFromFD(const char *path,
int fd,
- int format,
- int *backingFormat);
+ int format);
virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
char *buf,
size_t len,
--
2.25.1