From: Krisstoffe Date: Wed, 11 Jun 2025 21:57:15 +0000 (+0000) Subject: storage: Implement a simple 'checkPool' method for 'rbd' type pools X-Git-Tag: v11.5.0-rc1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd21c3ecb4ae7cb378e0dde848442968a8868833;p=thirdparty%2Flibvirt.git storage: Implement a simple 'checkPool' method for 'rbd' type pools Same approach is used by the gluster pool driver. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/448 Signed-off-by: Krisstoffe Reviewed-by: Peter Krempa --- diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index 038a1a9e34..29d544d349 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -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,