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