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

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

 



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@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]