On 3/19/19 2:42 PM, jdillama(a)redhat.com wrote:
From: Jason Dillaman <dillaman(a)redhat.com>
The librbd API will transparently revert to a slow disk usage
calculation method if the fast-diff map is marked as invalid.
Signed-off-by: Jason Dillaman <dillaman(a)redhat.com>
---
src/storage/storage_backend_rbd.c | 41 ++++++++++++++++++++++++++++---
1 file changed, 37 insertions(+), 4 deletions(-)
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index 2b7af1db23..e67911f928 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -437,10 +437,29 @@ volStorageBackendRBDGetFeatures(rbd_image_t image,
}
#if LIBRBD_VERSION_CODE > 265
+static int
+volStorageBackendRBDGetFlags(rbd_image_t image,
+ const char *volname,
+ uint64_t *flags)
+{
+ int r, ret = -1;
+
+ if ((r = rbd_get_flags(image, flags)) < 0) {
+ virReportSystemError(-r, _("failed to get the flags of RBD image "
+ "%s"), volname);
+ goto cleanup;
+ }
+ ret = 0;
+
+ cleanup:
+ return ret;
+}
I've simplified this a bit.
Michal