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

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



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

Attachment: signature.asc
Description: OpenPGP digital signature


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