Re: [PATCH] event: don't overwrite registration error message

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

 



On Thu, Jan 02, 2014 at 05:52:59AM -0700, Eric Blake wrote:
> On 01/02/2014 03:20 AM, Martin Kletzander wrote:
> > On Tue, Dec 31, 2013 at 07:22:53AM -0700, Eric Blake wrote:
> >> Prior to this patch, an attempt to register an event without an
> >> event loop started results in the vague:
> >>
> >> libvirt: Remote Driver error : adding cb to list
> >>
> >> Now it gives the much nicer:
> >>
> >> libvirt:  error : internal error: could not initialize domain event timer
> >>
> >> This also avoids hiding other reasonable error messages, such as
> >> attempts to register a duplicate callback or OOM errors.
> >>
> >> Also, document the event loop usage requirement, since that was how
> >> I ran into the issue.
> 
> I actually moved the doc changes into a separate patch, since they
> turned out to be bigger in nature:
> https://www.redhat.com/archives/libvir-list/2013-December/msg01334.html
> 
> > 
> > ACK, although I wasn't (somehow) able to test it with python bindings.
> 
> Thanks for the review.  It turns out reproducing this in python is
> fairly straightforward; here run pre-patch:
> 

I was able to reproduce it, but I wasn't able to test it after I
merged the fix.  I'm probably misusing the python bindings (still
didn't get used to the workflow when they are split).

> $ python
> >>> def hi():
> ...	print('hi')
> ...
> >>> import libvirt
> >>> conn = libvirt.open('qemu:///system')
> >>> conn.domainEventRegisterAny(None, 0, hi, '')
> libvirt: Remote Driver error : adding cb to list
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3865, in
> domainEventRegisterAny
>     raise libvirtError ('virConnectDomainEventRegisterAny() failed',
> conn=self)
> libvirt.libvirtError: adding cb to list
> 
> Not that I'm sure how to set up the python event loop, but that's one
> way to see the improved error message.
> 
> At any rate, I've pushed the patch (while waiting for the doc patch review).
> 

Getting right on that.

Martin

Attachment: signature.asc
Description: 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]