Re: [PATCH] openvzDomainSetNetwork: use virCommand

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

 



On 05/20/2013 02:46 AM, Ján Tomko wrote:
>> -    if (prog[0] != NULL) {
>> -        ADD_ARG_LIT("--save");
>> -        if (virRun(prog, NULL) < 0) {
>> +    if (cmd) {
> 
> cmd may be NULL here on OOM too.

That, and virCommandRun is designed to report OOM on your behalf if cmd
is NULL, so that your client code shouldn't have to worry about whether
virCommandNew... even succeeded.  Code that does 'if (cmd)' is generally
suspect as doing too much instead of letting virCommand do its job.

-- 
Eric Blake   eblake redhat com    +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]