Re: [PATCHv4 2/3] openvswitch: Add utility functions for getting and setting Open vSwitch per-port data

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

 



On 10/23/2012 06:15 AM, Michal Privoznik wrote:
>>> +    virBufferAsprintf(buf, "external_ids:PortData=%s", migrate);
>>
>>
>>> +
>>> +    cmd = virCommandNewArgList(OVSVSCTL, "--timeout=5", "set", "Interface", ifname,
>>> +                               virBufferCurrentContent(buf), NULL);
>>
>> Again, if we ran OOM virBuffer* will return NULL. It should be checked.
> 
> Now that I am re-thinking this again, virBuffer is a bit overkill. What
> about bare virAsprintf()?

virAsprintf() would require a temporary variable.  Easiest would be:

cmd = virCommandNewArgList(OVSVSCTL, "--timeout=5", "set", "Interface",
ifname, NULL);
virCommandAddArgFormat(cmd, "external_ids:PortData=%s", migrate);

-- 
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]