[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 02/15] sheepdog: Fix error handling
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH 02/15] sheepdog: Fix error handling in sd_snapshot_delete() |
Date: |
Fri, 03 Mar 2017 06:22:04 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 03/02/2017 03:43 PM, Markus Armbruster wrote:
>> As a bdrv_snapshot_delete() method, sd_snapshot_delete() must set an
>> error and return negative errno on failure. It sometimes returns -1,
>> and sometimes neglects to set an error. It also prints error messages
>> with error_report(). Fix all that.
>>
>> Moreover, its handling of an attempt to delete an nonexistent snapshot
>> is wrong: it error_report()s and succeeds. Fix it to set an error and
>> return -ENOENT instead.
>>
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>> block/sheepdog.c | 37 +++++++++++++++++--------------------
>> 1 file changed, 17 insertions(+), 20 deletions(-)
>>
>
>> @@ -2447,15 +2444,14 @@ static bool remove_objects(BDRVSheepdogState *s)
>> data_vdi_id[start_idx]),
>> false, s->cache_flags);
>> if (ret < 0) {
>> - error_report("failed to discard snapshot inode.");
>> - result = false;
>> + error_setg(errp, "failed to discard snapshot inode.");
>
> Lose the trailing '.'
Good idea.
> With that fixed,
> Reviewed-by: Eric Blake <address@hidden>
Thanks!
- Re: [Qemu-block] [Qemu-devel] [PATCH 12/15] gluster: Plug memory leaks in qemu_gluster_parse_json(), (continued)
[Qemu-block] [PATCH 06/15] sheepdog: Don't truncate long VDI name in _open(), _create(), Markus Armbruster, 2017/03/02
Re: [Qemu-block] [Qemu-devel] [PATCH 06/15] sheepdog: Don't truncate long VDI name in _open(), _create(), Philippe Mathieu-Daudé, 2017/03/02
[Qemu-block] [PATCH 02/15] sheepdog: Fix error handling in sd_snapshot_delete(), Markus Armbruster, 2017/03/02
[Qemu-block] [PATCH 05/15] sheepdog: Fix snapshot ID parsing in _open(), _create, _goto(), Markus Armbruster, 2017/03/02
[Qemu-block] [PATCH 07/15] sheepdog: Report errors in pseudo-filename more usefully, Markus Armbruster, 2017/03/02