diff options
author | Eric Blake <eblake@redhat.com> | 2025-05-09 15:40:18 -0500 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2025-05-14 15:33:34 -0500 |
commit | c33159dec79069514f78faecfe268439226b0f5b (patch) | |
tree | 651e46b5273c37edbe34f125d607998dc01743a8 /scripts/vmstate-static-checker.py | |
parent | 864813878951b44e964eb4c012d832fd21f8cc0c (diff) | |
download | qemu-c33159dec79069514f78faecfe268439226b0f5b.zip qemu-c33159dec79069514f78faecfe268439226b0f5b.tar.gz qemu-c33159dec79069514f78faecfe268439226b0f5b.tar.bz2 |
block: Expand block status mode from bool to flags
This patch is purely mechanical, changing bool want_zero into an
unsigned int for bitwise-or of flags. As of this patch, all
implementations are unchanged (the old want_zero==true is now
mode==BDRV_WANT_PRECISE which is a superset of BDRV_WANT_ZERO); but
the callers in io.c that used to pass want_zero==false are now
prepared for future driver changes that can now distinguish bewteen
BDRV_WANT_ZERO vs. BDRV_WANT_ALLOCATED. The next patch will actually
change the file-posix driver along those lines, now that we have
more-specific hints.
As for the background why this patch is useful: right now, the
file-posix driver recognizes that if allocation is being queried, the
entire image can be reported as allocated (there is no backing file to
refer to) - but this throws away information on whether the entire
image reads as zero (trivially true if lseek(SEEK_HOLE) at offset 0
returns -ENXIO, a bit more complicated to prove if the raw file was
created with 'qemu-img create' since we intentionally allocate a small
chunk of all-zero data to help with alignment probing). Later patches
will add a generic algorithm for seeing if an entire file reads as
zeroes.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20250509204341.3553601-16-eblake@redhat.com>
Diffstat (limited to 'scripts/vmstate-static-checker.py')
0 files changed, 0 insertions, 0 deletions