qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block/vhdx: Support vhdx image only with 512 bytes logical sector size
@ 2020-08-05 21:30 Swapnil Ingle
  2020-08-06  7:06 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: Swapnil Ingle @ 2020-08-05 21:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jeff Cody, Kevin Wolf, open list:VHDX, Swapnil Ingle, Max Reitz

block/vhdx uses qemu block layer where sector size is always 512 byte.
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
has logical sector size other than 512 bytes.

Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
---
 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;
     }
 
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block/vhdx: Support vhdx image only with 512 bytes logical sector size
  2020-08-05 21:30 [PATCH] block/vhdx: Support vhdx image only with 512 bytes logical sector size Swapnil Ingle
@ 2020-08-06  7:06 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-06  7:06 UTC (permalink / raw)
  To: Swapnil Ingle, qemu-devel
  Cc: Jeff Cody, Kevin Wolf, open list:VHDX, Max Reitz

On 8/5/20 11:30 PM, Swapnil Ingle wrote:
> block/vhdx uses qemu block layer where sector size is always 512 byte.

"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
> has logical sector size other than 512 bytes.

Probably "which have".

> 
> Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
> ---
>  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;
>      }
>  
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-06 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-05 21:30 [PATCH] block/vhdx: Support vhdx image only with 512 bytes logical sector size Swapnil Ingle
2020-08-06  7:06 ` Philippe Mathieu-Daudé

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).