[PATCH 4/7] storage_backend_rbd.C: Fix return type of a volStorageBackendRBDUseFastDiff() stub

Michal Privoznik via Devel posted 7 patches 3 months, 3 weeks ago
[PATCH 4/7] storage_backend_rbd.C: Fix return type of a volStorageBackendRBDUseFastDiff() stub
Posted by Michal Privoznik via Devel 3 months, 3 weeks ago
From: Michal Privoznik <mprivozn@redhat.com>

Inside of storage_backend.c there are two implementations of
volStorageBackendRBDUseFastDiff() function: one when librbd is
new enough and one when it isn't. The former returns a bool, but
the latter is declared to return an int despite it returning a
boolean. Fix the latter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/storage/storage_backend_rbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index c2dbf3a307..fd46c8be55 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -503,7 +503,7 @@ volStorageBackendRBDGetFlags(rbd_image_t image G_GNUC_UNUSED,
     return 0;
 }
 
-static int
+static bool
 volStorageBackendRBDUseFastDiff(uint64_t features G_GNUC_UNUSED,
                                 uint64_t feature_flags G_GNUC_UNUSED)
 {
-- 
2.49.0
Re: [PATCH 4/7] storage_backend_rbd.C: Fix return type of a volStorageBackendRBDUseFastDiff() stub
Posted by Peter Krempa via Devel 3 months, 3 weeks ago
On Wed, May 14, 2025 at 16:24:13 +0200, Michal Privoznik via Devel wrote:
> From: Michal Privoznik <mprivozn@redhat.com>
> 
> Inside of storage_backend.c there are two implementations of
> volStorageBackendRBDUseFastDiff() function: one when librbd is
> new enough and one when it isn't. The former returns a bool, but
> the latter is declared to return an int despite it returning a
> boolean. Fix the latter.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/storage/storage_backend_rbd.c | 2 +-

Reviewed-by: Peter Krempa <pkrempa@redhat.com>