Commit 81c3a0c4 authored by Katerina Koukiou's avatar Katerina Koukiou

events: Register VIR_DOMAIN_EVENT_ID_METADATA_CHANGE

Signed-off-by: default avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent c541f912
......@@ -645,6 +645,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="Reboot">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventGenericCallback"/>
......
......@@ -186,6 +186,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,
......@@ -447,6 +470,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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment