]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Implement a simple 'checkPool' method for 'rbd' type pools
authorKrisstoffe <krisstoffe@free.fr>
Wed, 11 Jun 2025 21:57:15 +0000 (21:57 +0000)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 12 Jun 2025 08:12:15 +0000 (10:12 +0200)
Same approach is used by the gluster pool driver.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/448

Signed-off-by: Krisstoffe <krisstoffe@free.fr>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/storage/storage_backend_rbd.c

index 038a1a9e34bf8c3aa44aa182d655435991c925a8..29d544d34945c8f287b95491ea89e1c2e5080fe3 100644 (file)
@@ -1442,9 +1442,21 @@ virStorageBackendRBDVolWipe(virStoragePoolObj *pool,
 }
 
 
+static int
+virStorageBackendRBDCheckPool(virStoragePoolObj *pool,
+                              bool *active)
+{
+    /* Return previous state remembered by the status XML. If the pool is not
+     * available we will fail to refresh it and end up in the same situation. */
+    *active = virStoragePoolObjIsActive(pool);
+    return 0;
+}
+
+
 virStorageBackend virStorageBackendRBD = {
     .type = VIR_STORAGE_POOL_RBD,
 
+    .checkPool = virStorageBackendRBDCheckPool,
     .refreshPool = virStorageBackendRBDRefreshPool,
     .createVol = virStorageBackendRBDCreateVol,
     .buildVol = virStorageBackendRBDBuildVol,