block-common: fix BDRV_WANT_PRECISE duplicating BDRV_WANT_OFFSET_VALID
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")
Signed-off-by Denis V. Lunev <[email protected]>
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
@@ -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
Kevin Wolf
AppliedAm 24.07.2026 um 18:11 hat Denis V. Lunev geschrieben:
Quoted 10 lines
Should OR in
BDRV_WANT_ALLOCATEDinstead.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")Signed-off-by Denis V. Lunev <[email protected]>CC Eric Blake <[email protected]>CC Stefan Hajnoczi <[email protected]>
Thanks, applied to the block-next branch for QEMU 11.2.
Kevin