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 <arm...@redhat.com>
> ---
>  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 '.'

With that fixed,
Reviewed-by: Eric Blake <ebl...@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to