* [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size
@ 2020-08-07 10:03 Swapnil Ingle
2020-08-07 10:13 ` no-reply
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Swapnil Ingle @ 2020-08-07 10:03 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Swapnil Ingle, open list:VHDX, Jeff Cody, Max Reitz,
philmd
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size
2020-08-07 10:03 [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size Swapnil Ingle
@ 2020-08-07 10:13 ` no-reply
2020-08-14 9:10 ` Swapnil Ingle
2020-09-10 16:19 ` Max Reitz
2 siblings, 0 replies; 5+ messages in thread
From: no-reply @ 2020-08-07 10:13 UTC (permalink / raw)
To: swapnil.ingle
Cc: kwolf, swapnil.ingle, qemu-block, codyprime, qemu-devel, mreitz,
philmd
Patchew URL: https://patchew.org/QEMU/1596794594-44531-1-git-send-email-swapnil.ingle@nutanix.com/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===
The full log is available at
http://patchew.org/logs/1596794594-44531-1-git-send-email-swapnil.ingle@nutanix.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size
2020-08-07 10:03 [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size Swapnil Ingle
2020-08-07 10:13 ` no-reply
@ 2020-08-14 9:10 ` Swapnil Ingle
2020-09-10 14:38 ` Swapnil Ingle
2020-09-10 16:19 ` Max Reitz
2 siblings, 1 reply; 5+ messages in thread
From: Swapnil Ingle @ 2020-08-14 9:10 UTC (permalink / raw)
To: qemu-devel@nongnu.org
Cc: Jeff Cody, Kevin Wolf, philmd@redhat.com, open list:VHDX,
Max Reitz
Ping
On 07.08.20, 12:03, "Swapnil Ingle" <swapnil.ingle@nutanix.com> wrote:
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size
2020-08-14 9:10 ` Swapnil Ingle
@ 2020-09-10 14:38 ` Swapnil Ingle
0 siblings, 0 replies; 5+ messages in thread
From: Swapnil Ingle @ 2020-09-10 14:38 UTC (permalink / raw)
To: qemu-devel@nongnu.org
Cc: Jeff Cody, Kevin Wolf, philmd@redhat.com, open list:VHDX,
Max Reitz
Ping
On 14.08.20, 11:10, "Swapnil Ingle" <swapnil.ingle@nutanix.com> wrote:
Ping
On 07.08.20, 12:03, "Swapnil Ingle" <swapnil.ingle@nutanix.com> wrote:
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size
2020-08-07 10:03 [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size Swapnil Ingle
2020-08-07 10:13 ` no-reply
2020-08-14 9:10 ` Swapnil Ingle
@ 2020-09-10 16:19 ` Max Reitz
2 siblings, 0 replies; 5+ messages in thread
From: Max Reitz @ 2020-09-10 16:19 UTC (permalink / raw)
To: Swapnil Ingle, qemu-devel; +Cc: Jeff Cody, Kevin Wolf, philmd, open list:VHDX
On 07.08.20 12:03, Swapnil Ingle wrote:
> 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(-)
Oh, sorry, yes. Thanks!
Applied to my block branch:
https://git.xanclic.moe/XanClic/qemu/commits/branch/block
Max
(Further information for others: The vhdx code assumes all over the
place that the vhdx sectors have the same size as “block layer sectors”.
Fixing this seems by no means trivial. I assume images with 4k sectors
have never worked, so this commit doesn’t remove support, it just makes
the vhdx driver safely exit before it can do something wrong.)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-09-10 16:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-07 10:03 [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size Swapnil Ingle
2020-08-07 10:13 ` no-reply
2020-08-14 9:10 ` Swapnil Ingle
2020-09-10 14:38 ` Swapnil Ingle
2020-09-10 16:19 ` Max Reitz
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).