[libvirt] [PATCH] openvz: simplify openvzDomainDefineCmd by using virCommandPtr

Eric Blake eblake at redhat.com
Mon May 7 14:51:50 UTC 2012


On 05/05/2012 03:30 AM, Guido Günther wrote:
> ---
> While working on setting filesystem quotas I came accross this and I
> figured I'll send this in advance because of the diffstat.
> Cheers,
>  -- Guido

> +    } else {
> +        cmd = openvzDomainDefineCmd(vmdef);
> +        if (cmd == NULL)
>              goto cleanup;

This misses out on the virReportOOMError(); you could just delete this
if clause, and directly proceed to:

> -        }
>  
> -        if (virRun(prog, NULL) < 0) {
> +        if (virCommandRun(cmd, NULL) < 0)

this, which will properly report the OOM in case cmd is NULL.

ACK with that simplification.

-- 
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/20120507/f919e6e6/attachment-0001.sig>


More information about the libvir-list mailing list