On 04/16/2013 10:05 AM, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <phrd...@redhat.com>
> ---
>  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 <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