[libvirt-users] Event&Callback in QEMU

huachao yao yao.d.hc at gmail.com
Fri Nov 4 03:42:00 UTC 2011


Hi buddy,
I wanna to monitor a domain's life cycle event, so i register a event an a

virConnectDomainEventCallback, the code segment is as below:

------------------------
int DomainEventCallback(virConnectPtr conn,
			virDomainPtr 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.14.0.

I want to know why this Error will happen? Is the QEMU not support the
LIFECYCLE Event ? If it is , how can i monitor the domain's life cycle
event( such as started,defined and stopped..)

Pls help~~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20111104/aded1148/attachment.htm>


More information about the libvirt-users mailing list