From: Swapnil Ingle <swapnil.ingle@nutanix.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Swapnil Ingle <swapnil.ingle@nutanix.com>,
"open list:VHDX" <qemu-block@nongnu.org>,
Jeff Cody <codyprime@gmail.com>, Max Reitz <mreitz@redhat.com>,
philmd@redhat.com
Subject: [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size
Date: Fri, 07 Aug 2020 10:03:23 +0000 (UTC) [thread overview]
Message-ID: <1596794594-44531-1-git-send-email-swapnil.ingle@nutanix.com> (raw)
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>
---
v2: Fixed commit message, suggested by Philippe Mathieu-Daude
---
block/vhdx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/vhdx.c b/block/vhdx.c
index 791eb90..356ec4c 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -816,9 +816,9 @@ static int vhdx_parse_metadata(BlockDriverState *bs, BDRVVHDXState *s)
goto exit;
}
- /* only 2 supported sector sizes */
- if (s->logical_sector_size != 512 && s->logical_sector_size != 4096) {
- ret = -EINVAL;
+ /* Currently we only support 512 */
+ if (s->logical_sector_size != 512) {
+ ret = -ENOTSUP;
goto exit;
}
--
2.9.3
next reply other threads:[~2020-08-07 10:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-07 10:03 Swapnil Ingle [this message]
2020-08-07 10:13 ` [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size no-reply
2020-08-14 9:10 ` Swapnil Ingle
2020-09-10 14:38 ` Swapnil Ingle
2020-09-10 16:19 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1596794594-44531-1-git-send-email-swapnil.ingle@nutanix.com \
--to=swapnil.ingle@nutanix.com \
--cc=codyprime@gmail.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).