]> git.proxmox.com Git - mirror_qemu.git/commit
block: vhdx - force FileOffsetMB field to '0' for certain block states
authorJeff Cody <jcody@redhat.com>
Tue, 20 Jan 2015 21:01:43 +0000 (16:01 -0500)
committerMax Reitz <mreitz@redhat.com>
Fri, 23 Jan 2015 17:41:32 +0000 (12:41 -0500)
commitcdf9634bdf76c8f59d9f7a04df30fa26d8e93d96
treef18b530aa38455489d97240284bcecc7a9f957cf
parent9a29e18f7dfd5a0e80d1c60fc856ebba18ddb738
block: vhdx - force FileOffsetMB field to '0' for certain block states

The v1.0.0 spec calls out PAYLOAD_BLOCK_ZERO FileOffsetMB field as being
'reserved'.  In practice, this means that Hyper-V will fail to read a
disk image with PAYLOAD_BLOCK_ZERO block states with a FileOffsetMB
value other than 0.

The other states that indicate a block that is not there
(PAYLOAD_BLOCK_UNDEFINED, PAYLOAD_BLOCK_NOT_PRESENT,
 PAYLOAD_BLOCK_UNMAPPED) have multiple options for what FileOffsetMB may
be set to, and '0' is explicitly called out as an option.

For all the above states, we will also just set the FileOffsetMB value
to 0.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: a9fe92f53f07e6ab1693811e4312c0d1e958500b.1421787566.git.jcody@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/vhdx.c