qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow
@ 2019-06-26 21:53 John Snow
  2019-06-26 23:25 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: John Snow @ 2019-06-26 21:53 UTC (permalink / raw)
  To: qemu-block, qemu-devel
  Cc: Qemu-Trivial, Kevin Wolf, radmehrsaeed7, John Snow, Max Reitz

Reported-by: radmehrsaeed7@gmail.com
Fixes: https://bugs.launchpad.net/bugs/1832914
Signed-off-by: John Snow <jsnow@redhat.com>
---
 block/qcow.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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;
     }
-- 
2.21.0



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

* Re: [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow
  2019-06-26 21:53 [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow John Snow
@ 2019-06-26 23:25 ` Eric Blake
  2019-06-27  8:34 ` Kevin Wolf
  2019-06-27  8:35 ` [Qemu-devel] [Qemu-block] " Maxim Levitsky
  2 siblings, 0 replies; 8+ messages in thread
From: Eric Blake @ 2019-06-26 23:25 UTC (permalink / raw)
  To: John Snow, qemu-block, qemu-devel
  Cc: Qemu-Trivial, Kevin Wolf, radmehrsaeed7, Max Reitz


[-- Attachment #1.1: Type: text/plain, Size: 1407 bytes --]

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

Yes, this is useful.

Reviewed-by: Eric Blake <eblake@redhat.com>

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow
  2019-06-26 21:53 [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow John Snow
  2019-06-26 23:25 ` Eric Blake
@ 2019-06-27  8:34 ` Kevin Wolf
  2019-06-27 14:51   ` Eric Blake
  2019-06-27 17:17   ` John Snow
  2019-06-27  8:35 ` [Qemu-devel] [Qemu-block] " Maxim Levitsky
  2 siblings, 2 replies; 8+ messages in thread
From: Kevin Wolf @ 2019-06-27  8:34 UTC (permalink / raw)
  To: John Snow; +Cc: Qemu-Trivial, radmehrsaeed7, qemu-devel, qemu-block, Max Reitz

Am 26.06.2019 um 23:53 hat John Snow geschrieben:
> Reported-by: radmehrsaeed7@gmail.com
> Fixes: https://bugs.launchpad.net/bugs/1832914
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  block/qcow.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> 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.");

I think we want a \n at the end here.

Kevin


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

* Re: [Qemu-devel] [Qemu-block] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow
  2019-06-26 21:53 [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow John Snow
  2019-06-26 23:25 ` Eric Blake
  2019-06-27  8:34 ` Kevin Wolf
@ 2019-06-27  8:35 ` Maxim Levitsky
  2 siblings, 0 replies; 8+ messages in thread
From: Maxim Levitsky @ 2019-06-27  8:35 UTC (permalink / raw)
  To: John Snow, qemu-block, qemu-devel
  Cc: Qemu-Trivial, Kevin Wolf, radmehrsaeed7, Max Reitz

On Wed, 2019-06-26 at 17:53 -0400, John Snow wrote:
> Reported-by: radmehrsaeed7@gmail.com
> Fixes: https://bugs.launchpad.net/bugs/1832914
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  block/qcow.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> 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;
>      }

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>

Best regards,
	Maxim Levitsky



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

* Re: [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow
  2019-06-27  8:34 ` Kevin Wolf
@ 2019-06-27 14:51   ` Eric Blake
  2019-06-27 17:17   ` John Snow
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Blake @ 2019-06-27 14:51 UTC (permalink / raw)
  To: Kevin Wolf, John Snow
  Cc: Qemu-Trivial, radmehrsaeed7, qemu-devel, qemu-block, Max Reitz


[-- Attachment #1.1: Type: text/plain, Size: 1222 bytes --]

On 6/27/19 3:34 AM, Kevin Wolf wrote:
> Am 26.06.2019 um 23:53 hat John Snow geschrieben:
>> Reported-by: radmehrsaeed7@gmail.com
>> Fixes: https://bugs.launchpad.net/bugs/1832914
>> Signed-off-by: John Snow <jsnow@redhat.com>
>> ---
>>  block/qcow.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> 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.");
> 
> I think we want a \n at the end here.
> 

Yes, we do. Good spot.

> Kevin
> 
> 

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow
  2019-06-27  8:34 ` Kevin Wolf
  2019-06-27 14:51   ` Eric Blake
@ 2019-06-27 17:17   ` John Snow
  2019-06-28  9:24     ` Kevin Wolf
  1 sibling, 1 reply; 8+ messages in thread
From: John Snow @ 2019-06-27 17:17 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Qemu-Trivial, radmehrsaeed7, qemu-devel, qemu-block, Max Reitz



On 6/27/19 4:34 AM, Kevin Wolf wrote:
> Am 26.06.2019 um 23:53 hat John Snow geschrieben:
>> Reported-by: radmehrsaeed7@gmail.com
>> Fixes: https://bugs.launchpad.net/bugs/1832914
>> Signed-off-by: John Snow <jsnow@redhat.com>
>> ---
>>  block/qcow.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> 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.");
> 
> I think we want a \n at the end here.
> 

D'oh.

> Kevin
> 

Can a maintainer pretty-please make the edit?


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

* Re: [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow
  2019-06-27 17:17   ` John Snow
@ 2019-06-28  9:24     ` Kevin Wolf
  2019-06-28 16:50       ` John Snow
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Wolf @ 2019-06-28  9:24 UTC (permalink / raw)
  To: John Snow; +Cc: Qemu-Trivial, radmehrsaeed7, qemu-devel, qemu-block, Max Reitz

Am 27.06.2019 um 19:17 hat John Snow geschrieben:
> 
> 
> On 6/27/19 4:34 AM, Kevin Wolf wrote:
> > Am 26.06.2019 um 23:53 hat John Snow geschrieben:
> >> Reported-by: radmehrsaeed7@gmail.com
> >> Fixes: https://bugs.launchpad.net/bugs/1832914
> >> Signed-off-by: John Snow <jsnow@redhat.com>
> >> ---
> >>  block/qcow.c | 7 ++++++-
> >>  1 file changed, 6 insertions(+), 1 deletion(-)
> >>
> >> 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.");
> > 
> > I think we want a \n at the end here.
> > 
> 
> D'oh.
> 
> > Kevin
> 
> Can a maintainer pretty-please make the edit?

A maintainer did that now. (read: thanks, applied)

Kevin


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

* Re: [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow
  2019-06-28  9:24     ` Kevin Wolf
@ 2019-06-28 16:50       ` John Snow
  0 siblings, 0 replies; 8+ messages in thread
From: John Snow @ 2019-06-28 16:50 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Qemu-Trivial, radmehrsaeed7, qemu-devel, qemu-block, Max Reitz



On 6/28/19 5:24 AM, Kevin Wolf wrote:
> Am 27.06.2019 um 19:17 hat John Snow geschrieben:
>>
>>
>> On 6/27/19 4:34 AM, Kevin Wolf wrote:
>>> Am 26.06.2019 um 23:53 hat John Snow geschrieben:
>>>> Reported-by: radmehrsaeed7@gmail.com
>>>> Fixes: https://bugs.launchpad.net/bugs/1832914
>>>> Signed-off-by: John Snow <jsnow@redhat.com>
>>>> ---
>>>>  block/qcow.c | 7 ++++++-
>>>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>>>
>>>> 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.");
>>>
>>> I think we want a \n at the end here.
>>>
>>
>> D'oh.
>>
>>> Kevin
>>
>> Can a maintainer pretty-please make the edit?
> 
> A maintainer did that now. (read: thanks, applied)
> 
> Kevin
> 

Thankyouthankyou!

--js


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

end of thread, other threads:[~2019-06-28 17:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26 21:53 [Qemu-devel] [PATCH] block/qcow: Improve error when opening qcow2 files as qcow John Snow
2019-06-26 23:25 ` Eric Blake
2019-06-27  8:34 ` Kevin Wolf
2019-06-27 14:51   ` Eric Blake
2019-06-27 17:17   ` John Snow
2019-06-28  9:24     ` Kevin Wolf
2019-06-28 16:50       ` John Snow
2019-06-27  8:35 ` [Qemu-devel] [Qemu-block] " Maxim Levitsky

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