OSDN Git Service

block/vhdx: Support vhdx image only with 512 bytes logical sector size
authorSwapnil Ingle <swapnil.ingle@nutanix.com>
Fri, 7 Aug 2020 10:03:23 +0000 (10:03 +0000)
committerMax Reitz <mreitz@redhat.com>
Tue, 15 Sep 2020 09:05:13 +0000 (11:05 +0200)
commit83a6a90009401f02bdb18fd2414dbae090d0f2b5
tree6188a8f22ca5c0c3eb530ad949b8acf72daac995
parent33fe08fcaf3773e2151bb60b4f9c62159a0c6633
block/vhdx: Support vhdx image only with 512 bytes logical sector size

block/vhdx uses qemu block layer where sector size is always 512 bytes.
This may have issues  with 4K logical sector sized vhdx image.

For e.g qemu-img convert on such images fails with following assert:

$qemu-img convert -f vhdx -O raw 4KTest1.vhdx test.raw
qemu-img: util/iov.c:388: qiov_slice: Assertion `offset + len <=
qiov->size' failed.
Aborted

This patch adds an check to return ENOTSUP for vhdx images which
have logical sector size other than 512 bytes.

Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Message-Id: <1596794594-44531-1-git-send-email-swapnil.ingle@nutanix.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/vhdx.c