[libvirt] [PATCH 3/3] Port hooks and iptables code to new command execution APIs

Eric Blake eblake at redhat.com
Tue May 25 21:25:50 UTC 2010


On 05/25/2010 07:24 AM, Daniel P. Berrange wrote:
> This proof of concept shows how two existing uses of virExec
> and virRun can be ported to the new virCommand APIs, and how
> much simpler the code becomes

Love it!

> -    va_start(args, arg);
> -
>      while ((s = va_arg(args, const char *)))
> -        if (!(argv[n++] = strdup(s)))
> -            goto error;
> -
> +        virCommandAddArg(cmd, s);
>      va_end(args);

Hmm - at first, I wondered why coverity did not detect the missing
va_end() call on the oom case pre-patch.  But on further investigation,
it looks like your patch is based off an older commit, since the missing
va_end() was already fixed in commit d564fcb3, so you'll have a slight
conflict to resolve when you rebase.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100525/5e3851d9/attachment-0001.sig>


More information about the libvir-list mailing list