Commit 88cab119 authored by Katerina Koukiou's avatar Katerina Koukiou

events: Register VIR_DOMAIN_EVENT_ID_WATCHDOG

Signed-off-by: default avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent 4aaa3983
......@@ -691,5 +691,10 @@
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventTunableCallback"/>
<arg name="params" type="a{sv}"/>
</signal>
<signal name="Watchdog">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventWatchdogCallback"/>
<arg name="action" type="i"/>
</signal>
</interface>
</node>
......@@ -389,6 +389,28 @@ virtDBusEventsDomainTunable(virConnectPtr connection G_GNUC_UNUSED,
return 0;
}
static gint
virtDBusEventsDomainWatchdog(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
gint action,
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,
"Watchdog",
g_variant_new("(i)", action),
NULL);
return 0;
}
static gint
virtDBusEventsDomainDiskChange(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
......@@ -642,6 +664,10 @@ virtDBusEventsRegister(virtDBusConnect *connect)
VIR_DOMAIN_EVENT_ID_TUNABLE,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainTunable));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_WATCHDOG,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainWatchdog));
virtDBusEventsRegisterNetworkEvent(connect,
VIR_NETWORK_EVENT_ID_LIFECYCLE,
VIR_NETWORK_EVENT_CALLBACK(virtDBusEventsNetworkLifecycle));
......
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