[libvirt] [PATCH 1/4] qemu: make qemuDomainHelperGetVcpus silent

Peter Krempa pkrempa at redhat.com
Fri Sep 19 10:57:50 UTC 2014


On 09/19/14 12:29, Daniel P. Berrange wrote:
> On Fri, Sep 19, 2014 at 11:44:20AM +0200, Francesco Romani wrote:
>> The commit 74c066df4d8 introduced an helper to factor a code path
>> which is shared between the existing API and the new bulk stats API.
>> In the bulk stats path errors must be silenced unless critical
>> (e.g. memory allocation failure).
>>
>> To address this need, this patch adds an argument to disable error reporting.
> 
> I'm really don't like the approach of adding 'bool reportError' flags to
> internal functions as it doesn't scale. These flags end up creeping out
> across more & more of the code base and different callers are going to
> disagree about which errors should be ignored and which not. Having the
> callers use virResetError is preferrable IMHO as it avoids polluting

In Eric's last review he advised to change from virResetError to the
boolean flag so that logs are not polluted. Without this patch, the code
is in the state as you suggest, but it contradicts Eric's stance.

> countless internal functions with ill defined args.
> 
> Regards,
> Daniel
> 

Peter

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


More information about the libvir-list mailing list