render / rpms / libvirt

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