search for: virconnectdomaineventregisterany

Displaying 20 results from an estimated 34 matches for "virconnectdomaineventregisterany".

2020 Apr 13
2
what a correct use for virConnectDomainEventRegisterAny API, how to Obtain a stable expected result
HI, everyone: My target deal with network hotplug use virDomainDetachDeviceFlags. Because when the API return ,the network 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_c...
2020 Apr 14
0
Re: what a correct use for virConnectDomainEventRegisterAny API, how to Obtain a stable expected result
On Mon, Apr 13, 2020 at 05:32:38PM +0800, thomas.kuang wrote: > HI, everyone: > > > My target deal with network hotplug use virDomainDetachDeviceFlags. Because when the API return ,the network 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_c...
2013 Aug 20
2
virConnectDomainEventRegisterAny problem
...ack, but it never called, i need to know when domain started, stopped or crashed, i have write 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...
2020 Apr 07
0
why virConnectDomainEventRegisterAny can't alway trigger the callback ,how can i get a stable callback ?
hi, all: I create a vm 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 = virDomainDetachDeviceFla...
2013 Aug 21
0
Re: virConnectDomainEventRegisterAny problem
...d or > crashed, i have write 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"; >...
2013 Aug 21
0
Re: virConnectDomainEventRegisterAny problem
...or crashed, i have write 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; } .......
2013 Aug 21
0
Re: virConnectDomainEventRegisterAny problem
...> >>>>> 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 call...
2013 Aug 21
2
Re: virConnectDomainEventRegisterAny problem
...in >> started, stopped or crashed, i have write 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; } ..... >> >...
2013 Aug 22
1
Re: virConnectDomainEventRegisterAny problem
...t;> 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...
2013 Aug 21
2
Re: virConnectDomainEventRegisterAny problem
...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&quot...
2014 Aug 21
1
Reboot, halt, poweroff called inside an lxc domain
Hi all, Is there any possibility (using libvirt C API or whatever else) to "propagate" shutdown events (reboot, halt, power off) to a host? The API seems to lack this functionality - there exists function virConnectDomainEventRegisterAny, but the virDomainEventStoppedDetailType enum does not distinguish between these 3 different situations. Moreover, while rebooting a machine, an additional argument can be passed to reboot() syscall, which will be used by bootloader during the startup. Ideally, when calling e.g. "reboot recov...
2013 Oct 14
2
event handler
...emu:///system"); if (virEventRegisterDefaultImpl() < 0) { virErrorPtr err = virGetLastError(); 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_...
2013 Oct 14
2
Re: event handler
...rror(); >> 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...
2011 Nov 04
1
Event&Callback in QEMU
...Ptr dom, int event, int detail, void * opaque){ /*My code */ ....... } 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.1...
2013 Oct 14
2
Re: event handler
...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 regist...
2016 Aug 03
0
Crash after connection close when callback is in progress
...) { assert(virInitialize() >= 0); assert(virEventRegisterDefaultImpl() >= 0); pthread_t event_loop; assert(pthread_create(&event_loop, NULL, loop, NULL) == 0); virConnectPtr conn = virConnectOpen("test:///default"); assert(conn != NULL); int cbid = virConnectDomainEventRegisterAny(conn, NULL, VIR_DOMAIN_EVENT_ID_LIFECYCLE, callback, NULL, freecb); assert(cbid != -1); virDomainPtr dom = virDomainDefineXML(conn,...
2017 Aug 21
1
dump in virEventPollRunOnce
...ecture: x86_64 ubuntu16.04-server hypervisor: kvm,qemu My program use libvirt event , the program is a module(.so) file in cloud application, when unload the module, program will dump in virEventPoolRunOnce call. program frame virInitialize virEventAddTimeOut virEventRunDefaultImpl virConnectXXX virConnectDomainEventRegisterAny ... virConnectDomainEventDeregisterAny ... when unload the module will dump , the gdb bt commad output is [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `/usr/local/lssa/bin/lssa -f'. Prog...
2012 Oct 24
0
Libvirt event for disk change is not being registered by DomainEventRegisterAny()
...ugh libvirt events. Recently I have upgraded my libvirt from 9.4 to 9.10 and I have this issue. While *de-registering* for DomainEventDiskChangeCallback, I get a libvirt error saying 'libvirtError: internal error domain event 2 not registered;' where 2 is the callbackid returned by virConnectDomainEventRegisterAny() for the disk change event type. This error didn?t occur when I used libvirt 0.9.4-23.el6_2.6 Can you please enlighten me on the recent changes that has been made? Also, is the diskchange event a part of the domains life cycle event? Any help on this issue will be highly appreciated....
2012 Oct 25
0
Please help: Libvirt event for disk change is not being registered by DomainEventRegisterAny()
...ugh libvirt events. Recently I have upgraded my libvirt from 9.4 to 9.10 and I have this issue. While *de-registering* for DomainEventDiskChangeCallback, I get a libvirt error saying 'libvirtError: internal error domain event 2 not registered;' where 2 is the callbackid returned by virConnectDomainEventRegisterAny() for the disk change event type. This error didn?t occur when I used libvirt 0.9.4-23.el6_2.6 Can you please enlighten me on the recent changes that has been made? Also, is the diskchange event a part of the domains life cycle event? Any help on this issue will be highly appreciated....
2013 Oct 14
0
Re: event handler
...virErrorPtr err = virGetLastError(); > 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"; >...