Skip to contentSkip to conversation

block-common: fix BDRV_WANT_PRECISE duplicating BDRV_WANT_OFFSET_VALID

PATCH Applied Denis V. Lunev 2 participants 2 messages Jul 24 – Jul 28

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block-common: fix BDRV_WANT_PRECISE duplicating BDRV_WANT_OFFSET_VALID

Should OR in BDRV_WANT_ALLOCATED instead.

Actually there is not problem within the code right now as the value is used as enum rather than flags but that is for now. Let us stay on the safe side.

Fixes c33159dec790 ("block: Expand block status mode from bool to flags")
CC Eric Blake <[email protected]>
CC Stefan Hajnoczi <[email protected]>

---
NOTE: technically we can just remove extra BDRV_WANT_OFFSET_VALID but for me
proposed change seems more logically correct.

 include/block/block-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/block/block-common.h +1 -1
index 895ea17541..3932ff8615 100644
@@ -351,7 +351,7 @@ typedef enum {
 #define BDRV_WANT_OFFSET_VALID  BDRV_BLOCK_OFFSET_VALID
 #define BDRV_WANT_ALLOCATED     BDRV_BLOCK_ALLOCATED
 #define BDRV_WANT_PRECISE       (BDRV_WANT_ZERO | BDRV_WANT_OFFSET_VALID | \
-                                 BDRV_WANT_OFFSET_VALID)
+                                 BDRV_WANT_ALLOCATED)
 
 typedef QTAILQ_HEAD(BlockReopenQueue, BlockReopenQueueEntry) BlockReopenQueue;
 
Signature · 1 line
2.53.0
Applied
#1 lore raw

Am 24.07.2026 um 18:11 hat Denis V. Lunev geschrieben:

Quoted 10 lines

Should OR in BDRV_WANT_ALLOCATED instead.

Actually there is not problem within the code right now as the value is used as enum rather than flags but that is for now. Let us stay on the safe side.

Fixes c33159dec790 ("block: Expand block status mode from bool to flags")
CC Eric Blake <[email protected]>
CC Stefan Hajnoczi <[email protected]>

Thanks, applied to the block-next branch for QEMU 11.2.

Kevin