diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-09-04 19:00:36 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-09-06 15:25:09 +0200 |
commit | f5f7abcfd50bca38ae278a9c7a3ed60fba3d76dc (patch) | |
tree | d7aa127458c42711ccf252cd8ab56b451a240cc0 /block/raw-posix.c | |
parent | 63390a8d14c9006f42bdaab22291c9c97676322d (diff) | |
download | hqemu-f5f7abcfd50bca38ae278a9c7a3ed60fba3d76dc.zip hqemu-f5f7abcfd50bca38ae278a9c7a3ed60fba3d76dc.tar.gz |
raw-posix: report unwritten extents as zero
These are created for example with XFS_IOC_ZERO_RANGE.
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/raw-posix.c')
-rw-r--r-- | block/raw-posix.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c index d011cfd..1b41ea3 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -1128,6 +1128,9 @@ static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs, } else { data = f.fe.fe_logical; hole = f.fe.fe_logical + f.fe.fe_length; + if (f.fe.fe_flags & FIEMAP_EXTENT_UNWRITTEN) { + ret |= BDRV_BLOCK_ZERO; + } } #elif defined SEEK_HOLE && defined SEEK_DATA |