search for: vir_domain_event_callback

Displaying 20 results from an estimated 25 matches for "vir_domain_event_callback".

2013 Oct 14
2
event handler
...etLastError(); fprintf(stderr, "Failed to register event implementation: %s\n", err && err->message ? err->message: "Unknown error"); return -1; } { int callback = virConnectDomainEventRegisterAny(libvirt_connection, NULL, VIR_DOMAIN_EVENT_ID_LIFECYCLE, VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); if(callback == -1) { std::cout<<"Error: failed to register domain event handle callback\n"; return -1; } } boost::thread(boost::bind(&libvirt_eventloop_thr_func)); ... libvirt_eventloop_thr_func() called, and locked on virEv...
2013 Aug 20
2
virConnectDomainEventRegisterAny problem
...rite following code static int domain_event_handler(virConnectPtr conn, virDomainPtr dom, int event, int detail, void * opaque) { switch(event) { } return 0; } ..... int callback = virConnectDomainEventRegisterAny(libvirt_connection, NULL, VIR_DOMAIN_EVENT_ID_LIFECYCLE, VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); if(callback == -1) { std::cout<<"Error: failed to register domain event handle callback\n"; return -1; } ..... but "domain_event_handler" is never called, what is wrong here ? -----BEGIN...
2013 Aug 22
1
Re: virConnectDomainEventRegisterAny problem
...e) { >>>>>> switch(event) { } return 0; } >>>>>> >>>>>> ..... int callback = >>>>>> virConnectDomainEventRegisterAny(libvirt_connection, >>>>>> NULL, VIR_DOMAIN_EVENT_ID_LIFECYCLE, >>>>>> VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, >>>>>> NULL); if(callback == -1) { std::cout<<"Error: failed to >>>>>> register domain event handle callback\n"; return -1; } >>>>>> ..... >>>>>> >>>>>> >&g...
2013 Aug 21
2
Re: virConnectDomainEventRegisterAny problem
...dom, int event, int detail, void * opaque) { > >>> switch(event) { } return 0; } > >>> > >>> ..... int callback = > >>> virConnectDomainEventRegisterAny(libvirt_connection, NULL, > >>> VIR_DOMAIN_EVENT_ID_LIFECYCLE, > >>> VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); > >>> if(callback == -1) { std::cout<<"Error: failed to register > >>> domain event handle callback\n"; return -1; } ..... > >>> > >>> > >>> but "domain_event_handler" is nev...
2013 Oct 14
2
Re: event handler
..., >> err && err->message ? err->message: "Unknown error"); >> return -1; >> } >> { >> int callback = >> virConnectDomainEventRegisterAny(libvirt_connection, NULL, >> VIR_DOMAIN_EVENT_ID_LIFECYCLE, >> VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); >> if(callback == -1) >> { >> std::cout<<"Error: failed to register domain event handle >> callback\n"; >> return -1; >> } >> } >> >> bo...
2013 Aug 21
2
Re: virConnectDomainEventRegisterAny problem
...vent_handler(virConnectPtr conn, >> virDomainPtr dom, int event, int detail, void * opaque) { >> switch(event) { } return 0; } >> >> ..... int callback = >> virConnectDomainEventRegisterAny(libvirt_connection, NULL, >> VIR_DOMAIN_EVENT_ID_LIFECYCLE, >> VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); >> if(callback == -1) { std::cout<<"Error: failed to register domain >> event handle callback\n"; return -1; } ..... >> >> >> but "domain_event_handler" is never called, what is wrong here ? > > Ar...
2020 Apr 13
2
what a correct use for virConnectDomainEventRegisterAny API, how to Obtain a stable expected result
...work maybe doesn’t remove from my vm guest os. So I use virConnectDomainEventRegisterAny to register an event ID: VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED , my process as follow: cb_para->call_id=virConnectDomainEventRegisterAny(cb_para->conn,cb_para->dom,VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); flags |= VIR_DOMAIN_AFFECT_CONFIG; if (virDomainIsActive(dom) == 1) { flags |= VIR_DOMAIN_AFFECT_LIVE; } ret = virDomainDetachDeviceFlags(dom, xml, flags); above code write in thread loop ,then...
2011 Nov 04
1
Event&Callback in QEMU
...*/ ....... } int main(){ /* .....*/ virDomainPtr dom = domain.getDomains("xp"); virFreeCallback freecb = NULL; void *opaque =NULL; virConnectDomainEventCallback cb =DomainEventCallback; virConnectDomainEventRegisterAny(conn, dom, VIR_DOMAIN_EVENT_ID_LIFECYCLE, VIR_DOMAIN_EVENT_CALLBACK(cb),opaque,freecb); /* .....*/ } but such a error happened: libvir: Remote error : this function is not supported by the connection driver: no event support and the libvirt version is 0.9; the driver is QEMU-KVM ,version is 0.14.0. I want to know why this Error will happen? Is the QEMU not sup...
2013 Oct 14
2
Re: event handler
...age: "Unknown error"); >>>> return -1; >>>> } >>>> { >>>> int callback = >>>> virConnectDomainEventRegisterAny(libvirt_connection, NULL, >>>> VIR_DOMAIN_EVENT_ID_LIFECYCLE, >>>> VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); >>>> if(callback == -1) >>>> { >>>> std::cout<<"Error: failed to register domain event >>>> handle >>>> callback\n"; >>>> return -1; &...
2020 Apr 07
0
why virConnectDomainEventRegisterAny can't alway trigger the callback ,how can i get a stable callback ?
...with six nic, after the vm start, i delete tree nics. all the three nic delete logic will happen in a thread , every nic delete has the following process: int vnf_control_del_network(void *arg) { 。。。。。 call_id = virConnectDomainEventRegisterAny(conn, dom, VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); flags |= VIR_DOMAIN_AFFECT_CONFIG; if (virDomainIsActive(dom) == 1) { flags |= VIR_DOMAIN_AFFECT_LIVE; } ret = virDomainDetachDeviceFlags(dom, xml, flags); // detach a nic from vm guest os 。。。。 } void vnf_c...
2020 Apr 14
0
Re: what a correct use for virConnectDomainEventRegisterAny API, how to Obtain a stable expected result
...my vm guest os. > > So I use virConnectDomainEventRegisterAny to register an event ID: VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED , > > my process as follow: > > cb_para->call_id=virConnectDomainEventRegisterAny(cb_para->conn,cb_para->dom,VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); > > > > flags |= VIR_DOMAIN_AFFECT_CONFIG; > if (virDomainIsActive(dom) == 1) { > flags |= VIR_DOMAIN_AFFECT_LIVE; > } > > ret = virDomainDetachDeviceFlags(dom, xml, flags...
2013 Aug 21
0
Re: virConnectDomainEventRegisterAny problem
...ctPtr conn, virDomainPtr dom, > int event, int detail, void * opaque) > { > switch(event) > { > } > return 0; > } > > ..... > int callback = > virConnectDomainEventRegisterAny(libvirt_connection, NULL, > VIR_DOMAIN_EVENT_ID_LIFECYCLE, > VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); > if(callback == -1) > { > std::cout<<"Error: failed to register domain event handle > callback\n"; > return -1; > } > ..... > > > but "domain_event_handler" i...
2013 Aug 21
0
Re: virConnectDomainEventRegisterAny problem
...nn, >>> virDomainPtr dom, int event, int detail, void * opaque) { >>> switch(event) { } return 0; } >>> >>> ..... int callback = >>> virConnectDomainEventRegisterAny(libvirt_connection, NULL, >>> VIR_DOMAIN_EVENT_ID_LIFECYCLE, >>> VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); >>> if(callback == -1) { std::cout<<"Error: failed to register >>> domain event handle callback\n"; return -1; } ..... >>> >>> >>> but "domain_event_handler" is never called, what is wrong...
2013 Aug 21
0
Re: virConnectDomainEventRegisterAny problem
...nt detail, void * opaque) { >>>>> switch(event) { } return 0; } >>>>> >>>>> ..... int callback = >>>>> virConnectDomainEventRegisterAny(libvirt_connection, NULL, >>>>> VIR_DOMAIN_EVENT_ID_LIFECYCLE, >>>>> VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, >>>>> NULL); if(callback == -1) { std::cout<<"Error: failed to >>>>> register domain event handle callback\n"; return -1; } >>>>> ..... >>>>> >>>>> >>>>> but &quo...
2013 Oct 14
0
Re: event handler
...event implementation: %s\n", > err && err->message ? err->message: "Unknown error"); > return -1; > } > { > int callback = > virConnectDomainEventRegisterAny(libvirt_connection, NULL, > VIR_DOMAIN_EVENT_ID_LIFECYCLE, > VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); > if(callback == -1) > { > std::cout<<"Error: failed to register domain event handle > callback\n"; > return -1; > } > } > > boost::thread(boost::bind(&libvirt...
2013 Oct 14
0
Re: event handler
...r->message ? err->message: "Unknown error"); >>> return -1; >>> } >>> { >>> int callback = >>> virConnectDomainEventRegisterAny(libvirt_connection, NULL, >>> VIR_DOMAIN_EVENT_ID_LIFECYCLE, >>> VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); >>> if(callback == -1) >>> { >>> std::cout<<"Error: failed to register domain event handle >>> callback\n"; >>> return -1; >>> } >>>...
2013 Oct 14
0
Re: event handler
...t;); >>>>> return -1; >>>>> } >>>>> { >>>>> int callback = >>>>> virConnectDomainEventRegisterAny(libvirt_connection, NULL, >>>>> VIR_DOMAIN_EVENT_ID_LIFECYCLE, >>>>> VIR_DOMAIN_EVENT_CALLBACK(domain_event_handler), NULL, NULL); >>>>> if(callback == -1) >>>>> { >>>>> std::cout<<"Error: failed to register domain event handle >>>>> callback\n"; >>>>> return -1;...
2020 Apr 07
0
when virEventAddTimeout trigger timeout ,should in the callback call virConnectDomainEventDeregisterAny ?
...para->group_id = info->group_id; cb_para->vsys_id = info->vsysid; cb_para->vnf_id = info->vnf_id; cb_para->conn = conn; cb_para->time_out = 20*1000;//20s cb_para->call_id = virConnectDomainEventRegisterAny(conn, dom, VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); flags |= VIR_DOMAIN_AFFECT_CONFIG; if (virDomainIsActive(dom) == 1) { flags |= VIR_DOMAIN_AFFECT_LIVE; } cb_para->timer_id = virEventAddTimeout(cb_para->time_out, vnf_control_del_network_timeout_c...
2019 Apr 08
0
[PATCH v4 2/7] common: Bundle the libvirt-ocaml library for use by virt-v2v
...Ptr dom = NULL; + int eventID = Tag_val(callback); + + virConnectDomainEventGenericCallback cb; + void *opaque; + virFreeCallback freecb = free; + int r; + + if (domv != Val_int(0)) + dom = Domain_val (Field(domv, 0)); + + switch (eventID){ + case VIR_DOMAIN_EVENT_ID_LIFECYCLE: + cb = VIR_DOMAIN_EVENT_CALLBACK(i_i_callback); + break; + case VIR_DOMAIN_EVENT_ID_REBOOT: + cb = VIR_DOMAIN_EVENT_CALLBACK(u_callback); + break; + case VIR_DOMAIN_EVENT_ID_RTC_CHANGE: + cb = VIR_DOMAIN_EVENT_CALLBACK(i64_callback); + break; + case VIR_DOMAIN_EVENT_ID_WATCHDOG: + cb = VIR_DOMAIN_EVENT_CALLBAC...
2019 Dec 16
3
[v2v PATCH 0/2] Move libvirt-ocaml copy to v2v repo
libvirt-ocaml is used only by virt-v2v, so move it to this repository, instead of having it around in the common submodule. The removal from common will happen later. Pino Toscano (2): common: Bundle the libvirt-ocaml library for use by virt-v2v build: switch embedded copy of libvirt-ocaml .gitignore | 2 + 3rdparty/libvirt-ocaml/Makefile.am |