[libvirt] [PATCH 7/8] logging: always NUL-terminate circular buffer
Eric Blake
eblake at redhat.com
Mon Mar 28 16:25:00 UTC 2011
On 03/27/2011 02:51 AM, Laine Stump wrote:
> On 03/26/2011 08:12 AM, Eric Blake wrote:
>> * src/util/logging.c (virLogStartup, virLogSetBufferSize):
>> Over-allocate, so that a debugger can just print the circular
>> buffer. Suggested by Daniel Veillard.
>> ---
>>
>> Original post:
>> https://www.redhat.com/archives/libvir-list/2011-March/msg01107.html
>>
>> src/util/logging.c | 8 ++++----
>> 1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/util/logging.c b/src/util/logging.c
>> index f4910ad..48c0cfd 100644
>> --- a/src/util/logging.c
>> +++ b/src/util/logging.c
>> @@ -197,14 +197,14 @@ int virLogStartup(void) {
>>
>> virLogInitialized = 1;
>> virLogLock();
>> - if (VIR_ALLOC_N(virLogBuffer, virLogSize)< 0) {
>> + if (VIR_ALLOC_N(virLogBuffer, virLogSize + 1)< 0) {
>> /*
>
> ACK
Thanks; pushed.
--
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/20110328/a6fb4d6b/attachment-0001.sig>
More information about the libvir-list
mailing list