Displaying 5 results from an estimated 5 matches for "eventregisterdefaultimpl".
2017 May 17
2
Re: Callback re-registration after libvirtd restart
No, I'm not, I'm calling it sooner:
func libvirt_start() {
libvirt.EventRegisterDefaultImpl()
event_listen()
}
S pozdravom / Best regards
Daniel Kucera.
2017-05-17 15:47 GMT+02:00 Daniel P. Berrange <berrange@redhat.com>:
> On Wed, May 17, 2017 at 03:41:09PM +0200, Daniel Kučera wrote:
> > Hi Daniel,
> >
> > I tried that but it doesn't work:
&g...
2017 May 17
2
Re: Callback re-registration after libvirtd restart
Hi Daniel,
I tried that but it doesn't work:
func libvirt_close_callback(conn *libvirt.Connect, reason
libvirt.ConnectCloseReason){
log.Printf("close callback: %+v", reason)
}
func event_listen() {
log.Printf("event_listen %s", conf.Libvirt.LocalUrl)
hv, err := libvirt.NewConnect(conf.Libvirt.LocalUrl)
err =
2017 May 17
0
Re: Callback re-registration after libvirtd restart
On Wed, May 17, 2017 at 03:49:45PM +0200, Daniel Kučera wrote:
> No, I'm not, I'm calling it sooner:
>
> func libvirt_start() {
> libvirt.EventRegisterDefaultImpl()
> event_listen()
> }
Well the following example works as expected for me
package main
import (
"github.com/libvirt/libvirt-go"
"log"
)
func libvirt_close_callback(conn *libvirt.Connect, reason libvirt.ConnectCloseReason) {
log.Printf("In here")
}...
2017 May 17
1
Re: Callback re-registration after libvirtd restart
2017-05-17 15:52 GMT+02:00 Daniel P. Berrange <berrange@redhat.com>:
> On Wed, May 17, 2017 at 03:49:45PM +0200, Daniel Kučera wrote:
> > No, I'm not, I'm calling it sooner:
> >
> > func libvirt_start() {
> > libvirt.EventRegisterDefaultImpl()
> > event_listen()
> > }
>
> Well the following example works as expected for me
>
> package main
>
> import (
> "github.com/libvirt/libvirt-go"
> "log"
> )
>
> func libvirt_close_callback(conn *libvirt.Conne...
2017 May 17
0
Re: Callback re-registration after libvirtd restart
...gt; err = hv.RegisterCloseCallback(libvirt_close_callback)
> if err != nil {
> log.Printf("unable to register close callback")
> return
> }
> ...
>
> The callback fires only when I kill my app,
Looks like you are missing a call to libvirt.EventRegisterDefaultImpl(),
which must be the first you do do before even connecting to libvirt.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https:/...