]> xenbits.xensource.com Git - libvirt.git/commitdiff
virStorageFileGetMetadataFromBuf: Remove 'backingFormat' argument
authorPeter Krempa <pkrempa@redhat.com>
Fri, 21 Feb 2020 11:41:11 +0000 (12:41 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 24 Feb 2020 14:12:32 +0000 (15:12 +0100)
None of the callers actually use it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/storage/storage_backend_gluster.c
src/util/virstoragefile.c
src/util/virstoragefile.h

index e92e9612bd4742a47f667d464b4cc6ed75b77cd3..db3df82aad7646d75dfd44121c55148a910938ab 100644 (file)
@@ -275,8 +275,7 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
         goto cleanup;
 
     if (!(meta = virStorageFileGetMetadataFromBuf(name, header, len,
-                                                  VIR_STORAGE_FILE_AUTO,
-                                                  NULL)))
+                                                  VIR_STORAGE_FILE_AUTO)))
         goto cleanup;
 
     if (meta->backingStoreRaw) {
index 6fddc0610e5e862ecceb3c3e9d0b4c8f227b5d63..94805e8741d4fb60ebad54ea92ca82006bb1e577 100644 (file)
@@ -1109,7 +1109,6 @@ virStorageFileMetadataNew(const char *path,
  * @buf: header bytes from @path
  * @len: length of @buf
  * @format: format of the storage file
- * @backingFormat: format of @backing
  *
  * Extract metadata about the storage volume with the specified image format.
  * If image format is VIR_STORAGE_FILE_AUTO, it will probe to automatically
@@ -1119,9 +1118,10 @@ virStorageFileMetadataNew(const char *path,
  * that might be raw if that file will then be passed to a guest, since a
  * malicious guest can turn a raw file into any other non-raw format at will.
  *
- * If the returned @backingFormat is VIR_STORAGE_FILE_AUTO it indicates the
- * image didn't specify an explicit format for its backing store. Callers are
- * advised against probing for the backing store format in this case.
+ * If the 'backingStoreRawFormat' field of the returned structure is
+ * VIR_STORAGE_FILE_AUTO it indicates the image didn't specify an explicit
+ * format for its backing store. Callers are advised against probing for the
+ * backing store format in this case.
  *
  * Caller MUST free the result after use via virObjectUnref.
  */
@@ -1129,8 +1129,7 @@ virStorageSourcePtr
 virStorageFileGetMetadataFromBuf(const char *path,
                                  char *buf,
                                  size_t len,
-                                 int format,
-                                 int *backingFormat)
+                                 int format)
 {
     virStorageSourcePtr ret = NULL;
 
@@ -1142,9 +1141,6 @@ virStorageFileGetMetadataFromBuf(const char *path,
         return NULL;
     }
 
-    if (backingFormat)
-        *backingFormat = ret->backingStoreRawFormat;
-
     return ret;
 }
 
@@ -3991,7 +3987,7 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr src,
     if (format == VIR_STORAGE_FILE_RAW && !src->encryption) {
         src->capacity = src->physical;
     } else if ((meta = virStorageFileGetMetadataFromBuf(src->path, buf,
-                                                        len, format, NULL))) {
+                                                        len, format))) {
         src->capacity = meta->capacity ? meta->capacity : src->physical;
         if (src->encryption && meta->encryption)
             src->encryption->payload_offset = meta->encryption->payload_offset;
index ecba418bb3d052b334e98bab2a0758ae6ceb207c..32f2c82147b3f15564c7971692c7e142c584b6b4 100644 (file)
@@ -386,8 +386,7 @@ virStorageSourcePtr virStorageFileGetMetadataFromFD(const char *path,
 virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
                                                      char *buf,
                                                      size_t len,
-                                                     int format,
-                                                     int *backingFormat)
+                                                     int format)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
 int virStorageFileChainGetBroken(virStorageSourcePtr chain,
                                  char **broken_file);