qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH] block/qcow: Improve error when ope


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow
Date: Wed, 26 Jun 2019 18:25:17 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 6/26/19 4:53 PM, John Snow wrote:
> Reported-by: address@hidden
> Fixes: https://bugs.launchpad.net/bugs/1832914
> Signed-off-by: John Snow <address@hidden>
> ---
>  block/qcow.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Yes, this is useful.

Reviewed-by: Eric Blake <address@hidden>

Reminds me of when I helped convince the file(1) database maintainers
that 'qcow2 (v3)' was better than 'qcow (v3)'.
(https://bugzilla.redhat.com/show_bug.cgi?id=1654349, file.git 60b896d4)

> 
> diff --git a/block/qcow.c b/block/qcow.c
> index 6dee5bb792..a9cb6ae0bd 100644
> --- a/block/qcow.c
> +++ b/block/qcow.c
> @@ -156,7 +156,12 @@ static int qcow_open(BlockDriverState *bs, QDict 
> *options, int flags,
>          goto fail;
>      }
>      if (header.version != QCOW_VERSION) {
> -        error_setg(errp, "Unsupported qcow version %" PRIu32, 
> header.version);
> +        error_setg(errp, "qcow (v%d) does not support qcow version %" PRIu32,
> +                   QCOW_VERSION, header.version);
> +        if (header.version == 2 || header.version == 3) {
> +            error_append_hint(errp, "Try the 'qcow2' driver instead.");
> +        }
> +
>          ret = -ENOTSUP;
>          goto fail;
>      }
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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