Re: [libvirt] [PATCH 7/8] conf: check for buffer errors before virBufferUse

2017-08-02 Thread John Ferlan
>> >>> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c >>> index 7728321cb..4dc49fdb0 100644 >>> --- a/src/conf/domain_conf.c >>> +++ b/src/conf/domain_conf.c >> >> [...] >> >>> @@ -23309,6 +23321,10 @@ static int >>> virDomainPanicDefFormat(virBufferPtr buf, >>> virBufferAdjustI

Re: [libvirt] [PATCH 7/8] conf: check for buffer errors before virBufferUse

2017-08-02 Thread Ján Tomko
On Tue, Aug 01, 2017 at 05:45:10PM -0400, John Ferlan wrote: [...] diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 0f99f3096..db7efffdf 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -930,6 +930,11 @@ virCapabilitiesFormatCaches(virBufferPtr buf,

Re: [libvirt] [PATCH 7/8] conf: check for buffer errors before virBufferUse

2017-08-01 Thread John Ferlan
On 07/26/2017 09:29 AM, Ján Tomko wrote: > After an OOM error, virBuffer* APIs set buf->use to zero. > Adding a buffer to the parent buffer only if use is non-zero > would quitely drop data on error. s/quitely/quietly/ > > Check the error beforehand to make sure buf->use is zero > because we h

[libvirt] [PATCH 7/8] conf: check for buffer errors before virBufferUse

2017-07-26 Thread Ján Tomko
After an OOM error, virBuffer* APIs set buf->use to zero. Adding a buffer to the parent buffer only if use is non-zero would quitely drop data on error. Check the error beforehand to make sure buf->use is zero because we have not attempted to add anything to it. --- src/conf/capabilities.c | 5 +