summaryrefslogtreecommitdiff
path: root/block/vhdx.h
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2014-12-08 01:07:43 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2014-12-12 15:42:22 +0000
commita9d1e9daa5527101c0b2dcf1a57aab549075144a (patch)
tree13e2f25b66631c7a64219504fc74fbe29c38d654 /block/vhdx.h
parent0571df44a1bf810113037abd14c13afd448601c9 (diff)
downloadqemu-a9d1e9daa5527101c0b2dcf1a57aab549075144a.tar.gz
block: vhdx - update PAYLOAD_BLOCK_UNMAPPED value to match 1.00 spec
The 0.95 VHDX spec defined PAYLOAD_BLOCK_UNMAPPED to be 5. The 1.00 VHDX spec redefines PAYLOAD_BLOCK_UNMAPPED to be 3 instead. The original value of 5 is now an undefined state in the spec, but it should be safe to treat it the same and return zeros for data read. This way, we can maintain compatibility with any images out in the wild that may have been created in accordance to the 0.95 spec. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 8a4d2da73a8dbc04cde62bea782fc09ff84b1cf1.1418018421.git.jcody@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/vhdx.h')
-rw-r--r--block/vhdx.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/vhdx.h b/block/vhdx.h
index b4a12a081e..7003ab7a79 100644
--- a/block/vhdx.h
+++ b/block/vhdx.h
@@ -226,7 +226,8 @@ typedef struct QEMU_PACKED VHDXLogDataSector {
#define PAYLOAD_BLOCK_NOT_PRESENT 0
#define PAYLOAD_BLOCK_UNDEFINED 1
#define PAYLOAD_BLOCK_ZERO 2
-#define PAYLOAD_BLOCK_UNMAPPED 5
+#define PAYLOAD_BLOCK_UNMAPPED 3
+#define PAYLOAD_BLOCK_UNMAPPED_v095 5
#define PAYLOAD_BLOCK_FULLY_PRESENT 6
#define PAYLOAD_BLOCK_PARTIALLY_PRESENT 7