]> xenbits.xensource.com Git - libvirt.git/commitdiff
virStorageSourceUpdateCapacity: Drop 'probe' argument
authorPeter Krempa <pkrempa@redhat.com>
Fri, 21 Feb 2020 11:21:56 +0000 (12:21 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 24 Feb 2020 14:12:32 +0000 (15:12 +0100)
Both callers pass false. Since we frown upon format probing, remove the
unused possibility to do the probing.

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

index ef7838a3afdb4d75909641015302ea84790c97f1..900c16fba9fb3dd507641481d154e231dfe6eabd 100644 (file)
@@ -11894,7 +11894,7 @@ qemuStorageLimitsRefresh(virQEMUDriverPtr driver,
     if (virStorageSourceUpdateBackingSizes(src, fd, &sb) < 0)
         goto cleanup;
 
-    if (virStorageSourceUpdateCapacity(src, buf, len, false) < 0)
+    if (virStorageSourceUpdateCapacity(src, buf, len) < 0)
         goto cleanup;
 
     /* If guest is not using raw disk format and is on a host block
index c2754dbb93513f3fe033225e25fd70b7f72b08de..8199c7a2af414941ee1634bae90c73770b8b97b1 100644 (file)
@@ -1756,7 +1756,7 @@ storageBackendUpdateVolTargetInfo(virStorageVolType voltype,
             }
         }
 
-        if (virStorageSourceUpdateCapacity(target, buf, len, false) < 0)
+        if (virStorageSourceUpdateCapacity(target, buf, len) < 0)
             return -1;
     }
 
index b984204b93031262b5c5014214a16b24f4fe2ca3..cc351e3f53ac1be36296c8582daf4973bf0173c7 100644 (file)
@@ -3964,18 +3964,15 @@ virStorageSourceUpdateBackingSizes(virStorageSourcePtr src,
  * @src: disk source definition structure
  * @buf: buffer to the storage file header
  * @len: length of the storage file header
- * @probe: allow probe
  *
- * Update the storage @src capacity. This may involve probing the storage
- * @src in order to "see" if we can recognize what exists.
+ * Update the storage @src capacity.
  *
  * Returns 0 on success, -1 on error.
  */
 int
 virStorageSourceUpdateCapacity(virStorageSourcePtr src,
                                char *buf,
-                               ssize_t len,
-                               bool probe)
+                               ssize_t len)
 {
     int format = src->format;
     g_autoptr(virStorageSource) meta = NULL;
@@ -3984,18 +3981,10 @@ virStorageSourceUpdateCapacity(virStorageSourcePtr src,
      * the metadata has a capacity, use that, otherwise fall back to
      * physical size.  */
     if (format == VIR_STORAGE_FILE_NONE) {
-        if (!probe) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("no disk format for %s and probing is disabled"),
-                           src->path);
-            return -1;
-        }
-
-        if ((format = virStorageFileProbeFormatFromBuf(src->path,
-                                                       buf, len)) < 0)
-            return -1;
-
-        src->format = format;
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("no disk format for %s was specified"),
+                       src->path);
+        return -1;
     }
 
     if (format == VIR_STORAGE_FILE_RAW && !src->encryption) {
index 1f41e6e3579eb3c47be6d5b80273b1233f867349..2a684fd74682ae23e3bdf0b8eb8a91ff3d7aad65 100644 (file)
@@ -472,8 +472,7 @@ int virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
 int virStorageSourceUpdateBackingSizes(virStorageSourcePtr src,
                                        int fd, struct stat const *sb);
 int virStorageSourceUpdateCapacity(virStorageSourcePtr src,
-                                   char *buf, ssize_t len,
-                                   bool probe);
+                                   char *buf, ssize_t len);
 
 int virStorageSourceNewFromBacking(virStorageSourcePtr parent,
                                    virStorageSourcePtr *backing);