
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