render / rpms / libvirt

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