Displaying 3 results from an estimated 3 matches for "domaineventlifecycle".
2017 May 17
2
Callback re-registration after libvirtd restart
...ing libvirt-go and I following code to listen for lifecycle events:
func event_listen() {
log.Printf("event_listen %s", conf.Libvirt.LocalUrl)
hv, err := libvirt.NewConnect(conf.Libvirt.LocalUrl)
lifecycleCallback := func(c *libvirt.Connect, d *libvirt.Domain, event
*libvirt.DomainEventLifecycle) {
event_message(c, d, "lifecycle", event)
}
_, err = hv.DomainEventLifecycleRegister(nil, lifecycleCallback)
if err != nil {
log.Printf("unable to register event callback")
return
}
log.Printf("Libvirt event listener started&qu...
2017 May 17
0
Re: Callback re-registration after libvirtd restart
...to listen for lifecycle events:
>
> func event_listen() {
> log.Printf("event_listen %s", conf.Libvirt.LocalUrl)
> hv, err := libvirt.NewConnect(conf.Libvirt.LocalUrl)
>
> lifecycleCallback := func(c *libvirt.Connect, d *libvirt.Domain, event
> *libvirt.DomainEventLifecycle) {
> event_message(c, d, "lifecycle", event)
> }
>
> _, err = hv.DomainEventLifecycleRegister(nil, lifecycleCallback)
> if err != nil {
> log.Printf("unable to register event callback")
> return
> }
>
>...
2017 May 17
2
Re: Callback re-registration after libvirtd restart
...>
> > func event_listen() {
> > log.Printf("event_listen %s", conf.Libvirt.LocalUrl)
> > hv, err := libvirt.NewConnect(conf.Libvirt.LocalUrl)
> >
> > lifecycleCallback := func(c *libvirt.Connect, d *libvirt.Domain,
> event
> > *libvirt.DomainEventLifecycle) {
> > event_message(c, d, "lifecycle", event)
> > }
> >
> > _, err = hv.DomainEventLifecycleRegister(nil, lifecycleCallback)
> > if err != nil {
> > log.Printf("unable to register event callback")
> >...