cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From e58d84de9cb73fba1b98c57edc63e751b4171c4e Mon Sep 17 00:00:00 2001
9ae3a8
From: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
Date: Fri, 18 Oct 2013 08:14:45 +0200
9ae3a8
Subject: [PATCH 20/81] raw-posix: report unwritten extents as zero
9ae3a8
9ae3a8
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
Message-id: <1382084091-16636-21-git-send-email-pbonzini@redhat.com>
9ae3a8
Patchwork-id: 55003
9ae3a8
O-Subject: [RHEL 7.0 qemu-kvm PATCH 20/26] raw-posix: report unwritten extents as zero
9ae3a8
Bugzilla: 989646
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Max Reitz <mreitz@redhat.com>
9ae3a8
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
9ae3a8
These are created for example with XFS_IOC_ZERO_RANGE.
9ae3a8
9ae3a8
Reviewed-by: Eric Blake <eblake@redhat.com>
9ae3a8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
(cherry picked from commit f5f7abcfd50bca38ae278a9c7a3ed60fba3d76dc)
9ae3a8
---
9ae3a8
 block/raw-posix.c | 3 +++
9ae3a8
 1 file changed, 3 insertions(+)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 block/raw-posix.c |    3 +++
9ae3a8
 1 files changed, 3 insertions(+), 0 deletions(-)
9ae3a8
9ae3a8
diff --git a/block/raw-posix.c b/block/raw-posix.c
9ae3a8
index a829ce0..c7ab908 100644
9ae3a8
--- a/block/raw-posix.c
9ae3a8
+++ b/block/raw-posix.c
9ae3a8
@@ -1128,6 +1128,9 @@ static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs,
9ae3a8
     } else {
9ae3a8
         data = f.fe.fe_logical;
9ae3a8
         hole = f.fe.fe_logical + f.fe.fe_length;
9ae3a8
+        if (f.fe.fe_flags & FIEMAP_EXTENT_UNWRITTEN) {
9ae3a8
+            ret |= BDRV_BLOCK_ZERO;
9ae3a8
+        }
9ae3a8
     }
9ae3a8
 
9ae3a8
 #elif defined SEEK_HOLE && defined SEEK_DATA
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8