]> xenbits.xensource.com Git - libvirt.git/commitdiff
virstoragefile: remove unused virStorageFileChainCheckBroken
authorPavel Hrdina <phrdina@redhat.com>
Mon, 7 Dec 2020 11:02:14 +0000 (12:02 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 6 Jan 2021 12:15:17 +0000 (13:15 +0100)
The last usage outside of tests was removed by commit
<780f8c94ca8b3dee7eb59c1bfbc32f672f965df8>.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/libvirt_private.syms
src/util/virstoragefile.c
src/util/virstoragefile.h
tests/virstoragetest.c

index d7714361d328b168637ebf5689b89e0df135b88d..f8da4a7648d2536cdd930a55a79479d9dda19dbf 100644 (file)
@@ -3127,7 +3127,6 @@ virStorageAuthDefFree;
 virStorageAuthDefParse;
 virStorageFileAccess;
 virStorageFileCanonicalizePath;
-virStorageFileChainGetBroken;
 virStorageFileChainLookup;
 virStorageFileChown;
 virStorageFileCreate;
index fac93118fd3d75dabf80cf423b4500b254e52b2f..119342d29641e14430c5503a9eb02e22d043502e 100644 (file)
@@ -1193,39 +1193,6 @@ virStorageFileGetMetadataFromFD(const char *path,
 }
 
 
-/**
- * virStorageFileChainCheckBroken
- *
- * If CHAIN is broken, set *brokenFile to the broken file name,
- * otherwise set it to NULL. Caller MUST free *brokenFile after use.
- * Return 0 on success (including when brokenFile is set), negative on
- * error (allocation failure).
- */
-int
-virStorageFileChainGetBroken(virStorageSourcePtr chain,
-                             char **brokenFile)
-{
-    virStorageSourcePtr tmp;
-
-    *brokenFile = NULL;
-
-    if (!chain)
-        return 0;
-
-    for (tmp = chain; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) {
-        /* Break when we hit end of chain; report error if we detected
-         * a missing backing file, infinite loop, or other error */
-        if (!tmp->backingStore && tmp->backingStoreRaw) {
-            *brokenFile = g_strdup(tmp->backingStoreRaw);
-
-           return 0;
-        }
-    }
-
-    return 0;
-}
-
-
 /**
  * virStorageFileResize:
  *
index 87763cf3893f1d5c4a30855a6f70368c3ed7ed53..cc9bd4875f21b0c30f2efd9983714c39c21bcef6 100644 (file)
@@ -403,9 +403,6 @@ virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
                                                      size_t len,
                                                      int format)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-int virStorageFileChainGetBroken(virStorageSourcePtr chain,
-                                 char **broken_file);
-
 int virStorageFileParseChainIndex(const char *diskTarget,
                                   const char *name,
                                   unsigned int *chainIndex)
index 2e466ecb992c329358c04cb3ace2a49ff85b4244..a376154defdcf7661bcfc733c76a589776240215 100644 (file)
@@ -270,7 +270,6 @@ testStorageChain(const void *args)
     virStorageSourcePtr elt;
     size_t i = 0;
     g_autoptr(virStorageSource) meta = NULL;
-    g_autofree char *broken = NULL;
 
     meta = testStorageFileGetMetadata(data->start, data->format, -1, -1);
     if (!meta) {
@@ -289,11 +288,6 @@ testStorageChain(const void *args)
         return -1;
     }
 
-    if (virStorageFileChainGetBroken(meta, &broken) || broken) {
-        fprintf(stderr, "chain should not be identified as broken\n");
-        return -1;
-    }
-
     elt = meta;
     while (virStorageSourceIsBacking(elt)) {
         g_autofree char *expect = NULL;