[libvirt] [PATCH] virsh: fix regression in log to file

Eric Blake eblake at redhat.com
Sat Apr 30 16:18:33 UTC 2011


On 04/30/2011 07:44 AM, Eric Blake wrote:
> On 04/30/2011 04:56 AM, Supriya Kannery wrote:
>> Commit 36deff04 introduced a regression due to which virsh is not able
>> to log to a file - msg_buf was changed from an array to a pointer
>> without corresponding change to usage of "sizeof()".
>>
>> Fix regression in virsh logging
> 
> Good catch.  However, I'd prefer if we instead rewrote this function to
> use virBuffer instead of snprintf.  Much less error-prone to maintain.

On second thought, after some IRC discussions with others, I'm planning on:

1. push your patch as-is for 0.9.1 (it's minimal, which is good since
we're post-freeze)
2. after 0.9.1, revert your patch, and replace it with:
3. global rename of virBufferVSprintf -> virBufferAsprintf (to match the
existing virAsprintf name)
4. add virBufferVasprintf (to match the existing virVasprintf name)
5. fix virsh to use virBuffer, including the new virBufferVasprintf

-- 
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/20110430/678a053c/attachment-0001.sig>


More information about the libvir-list mailing list