Re: [PATCH v2 14/44] block: Avoid error accumulation in bdrv_img_create()

2020-07-03 Thread Vladimir Sementsov-Ogievskiy

02.07.2020 18:49, Markus Armbruster wrote:

When creating an image fails because the format doesn't support option
"backing_file" or "backing_fmt", bdrv_img_create() first has
qemu_opt_set() put a generic error into @local_err, then puts the real
error into @errp with error_setg(), and then propagates the former to
the latter, which throws away the generic error.  A bit complicated,
but works.

Not that qemu_opt_set() returns a useful value, we can simply ignore
the generic error instead.

Signed-off-by: Markus Armbruster
Reviewed-by: Eric Blake



Reviewed-by: Vladimir Sementsov-Ogievskiy 

--
Best regards,
Vladimir



Re: [PATCH v2 14/44] block: Avoid error accumulation in bdrv_img_create()

2020-07-03 Thread Markus Armbruster
Eric Blake  writes:

> On 7/2/20 10:49 AM, Markus Armbruster wrote:
>> When creating an image fails because the format doesn't support option
>> "backing_file" or "backing_fmt", bdrv_img_create() first has
>> qemu_opt_set() put a generic error into @local_err, then puts the real
>> error into @errp with error_setg(), and then propagates the former to
>> the latter, which throws away the generic error.  A bit complicated,
>> but works.
>>
>> Not that qemu_opt_set() returns a useful value, we can simply ignore
>
> s/Not/Now/

I missed this one when processing review comments for v2.  Thanks for
reminding me!

>> the generic error instead.
>>
>> Signed-off-by: Markus Armbruster 
>> Reviewed-by: Eric Blake 
>> ---
>>   block.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>




Re: [PATCH v2 14/44] block: Avoid error accumulation in bdrv_img_create()

2020-07-02 Thread Eric Blake

On 7/2/20 10:49 AM, Markus Armbruster wrote:

When creating an image fails because the format doesn't support option
"backing_file" or "backing_fmt", bdrv_img_create() first has
qemu_opt_set() put a generic error into @local_err, then puts the real
error into @errp with error_setg(), and then propagates the former to
the latter, which throws away the generic error.  A bit complicated,
but works.

Not that qemu_opt_set() returns a useful value, we can simply ignore


s/Not/Now/


the generic error instead.

Signed-off-by: Markus Armbruster 
Reviewed-by: Eric Blake 
---
  block.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)



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