Re: [PATCH] hooks: let virCommand do the error reporting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/09/2012 12:32 AM, Martin Kletzander wrote:
> On 10/09/2012 05:47 AM, Eric Blake wrote:
>> The code was reporting raw exit status without decoding it into
>> normal vs. signal exit.  virCommandRun already does this, but
>> with a different error type, so all we have to do is recast
>> the error to the correct type.
>> Reported by li guang.
>>
>> * src/util/hooks.c (virHookCall): Simplify.
>> ---
>>
>> In response to:
>> https://www.redhat.com/archives/libvir-list/2012-October/msg00308.html
>>
>>  src/util/hooks.c | 14 ++++++--------
>>  1 file changed, 6 insertions(+), 8 deletions(-)
>>
> 
> ACK,

Pushed.

Hmm, I wonder if we should add a new function,
virCommandSetErrorNumber(cmd, VIR_ERR_...); if it is not called, then
command failure continues to give INTERNAL_ERROR; but if it is called,
then failures of that particular command object are reported with that
error category.  Then we wouldn't have to rewrap the error just to
change the category.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]