qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logica


From: Swapnil Ingle
Subject: Re: [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size
Date: Fri, 14 Aug 2020 09:10:46 +0000
User-agent: Microsoft-MacOutlook/16.39.20071300

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]