[libvirt] [PATCH 1/2] daemon: convert virRun to virCommand

Eric Blake eblake at redhat.com
Thu Jan 26 23:48:11 UTC 2012


On 01/26/2012 01:56 AM, Michal Privoznik wrote:
> On 26.01.2012 01:51, Eric Blake wrote:
>> Using snprintf to build up argv seems archaic.
>>
>> * daemon/remote.c (remoteDispatchAuthPolkit): Modernize command call.
>> ---
>>  daemon/remote.c |   42 +++++++++++++++++-------------------------
>>  1 files changed, 17 insertions(+), 25 deletions(-)
>>
> 
> ACK. I wonder if we should force developers to use virAsnprintf()
> instead of snprintf() like we already do for malloc(), realloc(), etc.

Series pushed.

There are still some valid uses of snprintf (in situations like
generating a unix socket name into a fixed-width structure), so I don't
think we can outright forbid it.  But yes, there's quite a few places
where dynamic sizing makes the code easier to write.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list