qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 08/11] block: update error reporting for bdrv_sn


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 08/11] block: update error reporting for bdrv_snapshot_create() and related functions
Date: Tue, 16 Apr 2013 17:54:02 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

On 04/16/2013 10:05 AM, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <address@hidden>
> ---
>  block.c                   | 23 ++++++++++++++---------
>  block/qcow2-snapshot.c    | 18 ++++++++++++------
>  block/qcow2.h             |  4 +++-
>  block/rbd.c               | 20 +++++++++++---------
>  block/sheepdog.c          | 22 +++++++++++-----------
>  include/block/block.h     |  5 +++--
>  include/block/block_int.h |  5 +++--
>  qemu-img.c                |  8 +++-----
>  savevm.c                  |  9 +++++----
>  9 files changed, 65 insertions(+), 49 deletions(-)
> 

> @@ -855,20 +857,20 @@ static int qemu_rbd_snap_create(BlockDriverState *bs,
>       */
>      if (sn_info->id_str[0] != '\0' &&
>          strcmp(sn_info->id_str, sn_info->name) != 0) {
> -        return -EINVAL;
> +        error_setg(errp, "rbd: ID and name have to be equal");
> +        return;

Who generates sn_info->id_str in the first place?  Didn't you just say
that the QMP interface does NOT expose user control over id_str, and
that it gets populated as a side effect of creation?  That says that
this error condition is probably dead code, if the QMP command never
attempts to generate id_str itself.

At any rate, the conversion to errp looks reasonable.

Reviewed-by: Eric Blake <address@hidden>

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

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