Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 5 +++++ src/events.c | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 72ff60e..3b090ba 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -669,6 +669,11 @@ <arg name="type" type="i"/> <arg name="nsuri" type="s"/> </signal> + <signal name="MigrationIteration"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventMigrationIterationCallback"/> + <arg name="iteration" type="i"/> + </signal> <signal name="TrayChange"> <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventTrayChangeCallback"/> diff --git a/src/events.c b/src/events.c index c9daeac..22dbed9 100644 --- a/src/events.c +++ b/src/events.c @@ -340,6 +340,28 @@ virtDBusEventsDomainMetadataChange(virConnectPtr connection G_GNUC_UNUSED, return 0; } +static gint +virtDBusEventsDomainMigrationIteration(virConnectPtr connection G_GNUC_UNUSED, + virDomainPtr domain, + gint iteration, + gpointer opaque) +{ + virtDBusConnect *connect = opaque; + g_autofree gchar *path = NULL; + + path = virtDBusUtilBusPathForVirDomain(domain, connect->domainPath); + + g_dbus_connection_emit_signal(connect->bus, + NULL, + path, + VIRT_DBUS_DOMAIN_INTERFACE, + "MigrationIteration", + g_variant_new("(i)", iteration), + NULL); + + return 0; +} + static gint virtDBusEventsDomainReboot(virConnectPtr connection G_GNUC_UNUSED, virDomainPtr domain, @@ -625,6 +647,10 @@ virtDBusEventsRegister(virtDBusConnect *connect) VIR_DOMAIN_EVENT_ID_METADATA_CHANGE, VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainMetadataChange)); + virtDBusEventsRegisterDomainEvent(connect, + VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION, + VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainMigrationIteration)); + virtDBusEventsRegisterDomainEvent(connect, VIR_DOMAIN_EVENT_ID_REBOOT, VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainReboot)); -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list