[libvirt] [PATCH] virsh: Back out if the argument for vol-create-as is malformed

Eric Blake eblake at redhat.com
Mon Jun 4 19:09:32 UTC 2012


On 06/04/2012 03:08 AM, Osier Yang wrote:
> ---
>  tools/virsh.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 4737948..4810627 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -11372,18 +11372,24 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
>  
>      if (vshCommandOptString(cmd, "capacity", &capacityStr) <= 0)
>          goto cleanup;
> -    if (vshVolSize(capacityStr, &capacity) < 0)
> +
> +    if (vshVolSize(capacityStr, &capacity) < 0) {
>          vshError(ctl, _("Malformed size %s"), capacityStr);
> +        goto cleanup;
> +    }

ACK.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120604/f97ea0f7/attachment-0001.sig>


More information about the libvir-list mailing list