Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 6 ++++++ src/events.c | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 76f9a97..72ff60e 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -663,6 +663,12 @@ value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventJobCompletedCallback"/> <arg name="params" type="a{sv}"/> </signal> + <signal name="MetadataChange"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventMetadataChangeCallback"/> + <arg name="type" type="i"/> + <arg name="nsuri" type="s"/> + </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 5943ea5..c9daeac 100644 --- a/src/events.c +++ b/src/events.c @@ -317,6 +317,29 @@ virtDBusEventsDomainJobCompleted(virConnectPtr connection G_GNUC_UNUSED, return 0; } +static gint +virtDBusEventsDomainMetadataChange(virConnectPtr connection G_GNUC_UNUSED, + virDomainPtr domain, + gint type, + const gchar *nsuri, + 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, + "MetadataChange", + g_variant_new("(is)", type, nsuri), + NULL); + + return 0; +} + static gint virtDBusEventsDomainReboot(virConnectPtr connection G_GNUC_UNUSED, virDomainPtr domain, @@ -598,6 +621,10 @@ virtDBusEventsRegister(virtDBusConnect *connect) VIR_DOMAIN_EVENT_ID_JOB_COMPLETED, VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainJobCompleted)); + virtDBusEventsRegisterDomainEvent(connect, + VIR_DOMAIN_EVENT_ID_METADATA_CHANGE, + VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainMetadataChange)); + 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