]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: storage: remove 'allow_probe' from virStorageFileGetMetadata
authorPeter Krempa <pkrempa@redhat.com>
Mon, 4 Jun 2018 08:25:17 +0000 (10:25 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 8 Jun 2018 07:26:38 +0000 (09:26 +0200)
All callers pass 'false' now so it's no longer needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c
src/security/virt-aa-helper.c
src/util/virstoragefile.c
src/util/virstoragefile.h
tests/virstoragetest.c

index 68d1114a5a7d080d7c67a6072d110e5181184afe..245d7d3852b567cf3429902ab4918ecb33282fe6 100644 (file)
@@ -8118,9 +8118,7 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
 
     qemuDomainGetImageIds(cfg, vm, src, disk->src, &uid, &gid);
 
-    if (virStorageFileGetMetadata(src,
-                                  uid, gid, false,
-                                  report_broken) < 0)
+    if (virStorageFileGetMetadata(src, uid, gid, report_broken) < 0)
         goto cleanup;
 
     for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
index 37fe36a329409b95f30252966dee6d6b4bc3c9e3..971ee6733cbd38394ff8fb03e8faffa76023da82 100644 (file)
@@ -974,7 +974,7 @@ get_files(vahControl * ctl)
          *        so that the open could be re-tried as that user:group.
          */
         if (!virStorageSourceHasBacking(disk->src))
-            virStorageFileGetMetadata(disk->src, -1, -1, false, false);
+            virStorageFileGetMetadata(disk->src, -1, -1, false);
 
         /* XXX passing ignoreOpenFailure = true to get back to the behavior
          * from before using virDomainDiskDefForeachPath. actually we should
index 62768af9687e36a1877eed4710a1de7262c23078..6ede542df65b264579cb56087aad2882e71a17d9 100644 (file)
@@ -4678,7 +4678,6 @@ static int
 virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
                                  virStorageSourcePtr parent,
                                  uid_t uid, gid_t gid,
-                                 bool allow_probe,
                                  bool report_broken,
                                  virHashTablePtr cycle,
                                  unsigned int depth)
@@ -4691,9 +4690,9 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
     int backingFormat;
     int rv;
 
-    VIR_DEBUG("path=%s format=%d uid=%u gid=%u probe=%d",
+    VIR_DEBUG("path=%s format=%d uid=%u gid=%u",
               src->path, src->format,
-              (unsigned int)uid, (unsigned int)gid, allow_probe);
+              (unsigned int)uid, (unsigned int)gid);
 
     /* exit if we can't load information about the current image */
     rv = virStorageFileSupportsBackingChainTraversal(src);
@@ -4740,7 +4739,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
         if (!(backingStore = virStorageSourceNewFromBacking(src)))
             goto cleanup;
 
-        if (backingFormat == VIR_STORAGE_FILE_AUTO && !allow_probe)
+        if (backingFormat == VIR_STORAGE_FILE_AUTO)
             backingStore->format = VIR_STORAGE_FILE_RAW;
         else if (backingFormat == VIR_STORAGE_FILE_AUTO_SAFE)
             backingStore->format = VIR_STORAGE_FILE_AUTO;
@@ -4749,7 +4748,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
 
         if ((ret = virStorageFileGetMetadataRecurse(backingStore, parent,
                                                     uid, gid,
-                                                    allow_probe, report_broken,
+                                                    report_broken,
                                                     cycle, depth + 1)) < 0) {
             if (report_broken)
                 goto cleanup;
@@ -4802,12 +4801,11 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
 int
 virStorageFileGetMetadata(virStorageSourcePtr src,
                           uid_t uid, gid_t gid,
-                          bool allow_probe,
                           bool report_broken)
 {
-    VIR_DEBUG("path=%s format=%d uid=%u gid=%u probe=%d, report_broken=%d",
+    VIR_DEBUG("path=%s format=%d uid=%u gid=%u report_broken=%d",
               src->path, src->format, (unsigned int)uid, (unsigned int)gid,
-              allow_probe, report_broken);
+              report_broken);
 
     virHashTablePtr cycle = NULL;
     virStorageType actualType = virStorageSourceGetActualType(src);
@@ -4819,14 +4817,12 @@ virStorageFileGetMetadata(virStorageSourcePtr src,
     if (src->format <= VIR_STORAGE_FILE_NONE) {
         if (actualType == VIR_STORAGE_TYPE_DIR)
             src->format = VIR_STORAGE_FILE_DIR;
-        else if (allow_probe)
-            src->format = VIR_STORAGE_FILE_AUTO;
         else
             src->format = VIR_STORAGE_FILE_RAW;
     }
 
     ret = virStorageFileGetMetadataRecurse(src, src, uid, gid,
-                                           allow_probe, report_broken, cycle, 1);
+                                           report_broken, cycle, 1);
 
     virHashFree(cycle);
     return ret;
index 33fc853fcdd3ec9aff3be52ae5c676f80e4a8c83..592e19bd7fe56735b1a5636f68b508287d930eef 100644 (file)
@@ -504,7 +504,6 @@ int virStorageFileSupportsAccess(const virStorageSource *src);
 
 int virStorageFileGetMetadata(virStorageSourcePtr src,
                               uid_t uid, gid_t gid,
-                              bool allow_probe,
                               bool report_broken)
     ATTRIBUTE_NONNULL(1);
 
index 9876469db66539283bd055a6ebe67445b8ff9e03..68d0307d5ca40f7e58a768e5682ecef24f42c74d 100644 (file)
@@ -117,7 +117,7 @@ testStorageFileGetMetadata(const char *path,
     if (VIR_STRDUP(ret->path, path) < 0)
         goto error;
 
-    if (virStorageFileGetMetadata(ret, uid, gid, false, false) < 0)
+    if (virStorageFileGetMetadata(ret, uid, gid, false) < 0)
         goto error;
 
     return ret;