]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storageBackendProbeTarget: Don't fail if backing store can't be parsed
authorPeter Krempa <pkrempa@redhat.com>
Thu, 25 Feb 2021 12:51:51 +0000 (13:51 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 1 Mar 2021 14:44:20 +0000 (15:44 +0100)
When the backing store of the image can't be parsed
virStorageSourceNewFromBacking returns -1. storageBackendProbeTarget
then also fails which makes the pool refresh fail or even the storage
pool becomes inactive after (re)start of libvirtd.

In situations when we can't access the backing store via network we
just report the backing store string, thus we can do the same thing for
unparsable backing store to prevent the pool from going offline.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/storage/storage_util.c

index e71715f9086d70977e2ec23a773926f5e9b874b3..db2c7a18bf27a099e167e560b29bc7abede54e58 100644 (file)
@@ -3435,13 +3435,11 @@ storageBackendProbeTarget(virStorageSourcePtr target,
         return -1;
 
     if (meta->backingStoreRaw) {
-        if (virStorageSourceNewFromBacking(meta, &target->backingStore) < 0)
-            return -1;
-
         /* XXX: Remote storage doesn't play nicely with volumes backed by
          * remote storage. To avoid trouble, just fake the backing store is RAW
          * and put the string from the metadata as the path of the target. */
-        if (!virStorageSourceIsLocalStorage(target->backingStore)) {
+        if (virStorageSourceNewFromBacking(meta, &target->backingStore) < 0 ||
+            !virStorageSourceIsLocalStorage(target->backingStore)) {
             virObjectUnref(target->backingStore);
 
             target->backingStore = virStorageSourceNew();