Hi Martin, Thanks for your answer! > We cannot guarantee that some events will not fire multiple times as is some cases there is no way to check whether it is duplicate or not when libvirt gets the information. I have a hunch that the fact that events can happen multiple times is written somewhere in the docs. > Ok. I did not know about that. That would be an explanation. > Is there any problem you are trying to solve here? No, I can handle the duplicate notifs in the application. I was just surprise to see the same event twice and wondering whether I used the API correctly or if this could possibly be a bug in libvirt. Best Antoine -----Original Message----- From: Martin Kletzander [mailto:mkletzan@xxxxxxxxxx] Sent: Friday, August 25, 2017 11:51 AM To: Naud, AntoineX <antoinex.naud@xxxxxxxxx> Cc: libvirt-users@xxxxxxxxxx Subject: Re: duplicated notifications for suspend and resume On Thu, Aug 24, 2017 at 12:54:26PM +0000, Naud, AntoineX wrote: >Hello, > >I am using domain event notifications from libvirt-event API in my application and it seems to work fine, except for 'suspend' and 'resume' events where I keep receiving duplicated notifications. > >Similarly, the example provided with libvirt (in examples/object-events/event-test) also produces twice as much notifications for 'suspend' and 'resume' than for other events. Here is the sequence of virsh commands and the output of event-test: > >Virsh start Fed25 >Virsh suspend Fed25 >Virsh resume Fed25 >Virsh shutdown Fed25 > >[~/libvirt-3.4.0/examples/object-events] ./event-test qemu:///system >Registering event callbacks myNodeDeviceEventCallback EVENT: Node >device net_vnet0_fe_54_00_a0_ba_61 Created 0 >myDomainEventCallback1 EVENT: Domain Fed25(1) Resumed Unpaused >myDomainEventCallback2 EVENT: Domain Fed25(1) Resumed Unpaused >myDomainEventCallback1 EVENT: Domain Fed25(1) Started Booted >myDomainEventCallback2 EVENT: Domain Fed25(1) Started Booted >myDomainEventCallback1 EVENT: Domain Fed25(1) Suspended Paused >myDomainEventCallback2 EVENT: Domain Fed25(1) Suspended Paused >myDomainEventCallback1 EVENT: Domain Fed25(1) Suspended Paused >myDomainEventCallback2 EVENT: Domain Fed25(1) Suspended Paused >myDomainEventCallback1 EVENT: Domain Fed25(1) Resumed Unpaused >myDomainEventCallback2 EVENT: Domain Fed25(1) Resumed Unpaused >myDomainEventCallback1 EVENT: Domain Fed25(1) Resumed Unpaused >myDomainEventCallback2 EVENT: Domain Fed25(1) Resumed Unpaused >myDomainEventCallback1 EVENT: Domain Fed25(1) Shutdown Finished >myDomainEventCallback2 EVENT: Domain Fed25(1) Shutdown Finished >myNodeDeviceEventCallback EVENT: Node device >net_vnet0_fe_54_00_a0_ba_61 Deleted 0 > >Note that the 2 lines printed for each event are ok since 2 callbacks are registered in the example. > We cannot guarantee that some events will not fire multiple times as is some cases there is no way to check whether it is duplicate or not when libvirt gets the information. I have a hunch that the fact that events can happen multiple times is written somewhere in the docs. Is there any problem you are trying to solve here? >Has anybody else faced this issue? > >I am using libvirt-3.6.0 on Ubuntu 16.04. > >Best regards, >Antoine >-------------------------------------------------------------- >Intel Research and Development Ireland Limited Registered in Ireland >Registered Office: Collinstown Industrial Park, Leixlip, County Kildare >Registered Number: 308263 > > >This e-mail and any attachments may contain confidential material for >the sole use of the intended recipient(s). Any review or distribution >by others is strictly prohibited. If you are not the intended >recipient, please contact the sender and delete all copies. >_______________________________________________ >libvirt-users mailing list >libvirt-users@xxxxxxxxxx >https://www.redhat.com/mailman/listinfo/libvirt-users -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. _______________________________________________ libvirt-users mailing list libvirt-users@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvirt-users