[libvirt] [PATCH v2 1/3] virerror: Fix incorrect use of RaiseErrorFull

Cole Robinson crobinso at redhat.com
Wed May 21 13:42:36 UTC 2014


On 05/21/2014 07:07 AM, Daniel P. Berrange wrote:
> On Mon, May 19, 2014 at 06:02:26PM -0400, Cole Robinson wrote:
>> RaiseErrorFull does not prepend the static error code string (like
>> INVALID_ARG yields "invalid arg: %(msg)s"). We should be using
>> ReportErrorHelper.
>>
>> The generated error objects are slightly different, by not storing the
>> invalid argument name in err->str2. However those fields aren't used
>> anywhere else and aren't documented to contain anything useful, so
>> I don't think it matters.
> 
> This was actually intentional when I created these helpers, since IMHO
> the string concatenation between the caller supplied error message and
> the virErrorMsg funtion leads to fugly error messages. So the intent
> was that these helper macros would provide the complete error message
> that's relevant to their usage, and ignore virErrorMsg.
> 
> IOW, I don't think adding a 'invalid argument: ' prefix to these
> helper macros is particularly useful.

Fair enough. I rebased the two other ACKd patches and pushed.

Thanks,
Cole




More information about the libvir-list mailing list