Commit 4aaa3983 authored by Katerina Koukiou's avatar Katerina Koukiou

events: Register VIR_DOMAIN_EVENT_ID_TUNABLE

Signed-off-by: default avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent ccd1fd78
......@@ -686,5 +686,10 @@
<arg name="device" type="s"/>
<arg name="reason" type="u"/>
</signal>
<signal name="Tunable">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventTunableCallback"/>
<arg name="params" type="a{sv}"/>
</signal>
</interface>
</node>
......@@ -363,6 +363,32 @@ virtDBusEventsDomainTrayChange(virConnectPtr connection G_GNUC_UNUSED,
return 0;
}
static gint
virtDBusEventsDomainTunable(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
virTypedParameterPtr params,
gint nparams,
gpointer opaque)
{
virtDBusConnect *connect = opaque;
g_autofree gchar *path = NULL;
GVariant *gargs;
path = virtDBusUtilBusPathForVirDomain(domain, connect->domainPath);
gargs = virtDBusUtilTypedParamsToGVariant(params, nparams);
g_dbus_connection_emit_signal(connect->bus,
NULL,
path,
VIRT_DBUS_DOMAIN_INTERFACE,
"Tunable",
g_variant_new_tuple(&gargs, 1),
NULL);
return 0;
}
static gint
virtDBusEventsDomainDiskChange(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
......@@ -612,6 +638,10 @@ virtDBusEventsRegister(virtDBusConnect *connect)
VIR_DOMAIN_EVENT_ID_TRAY_CHANGE,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainTrayChange));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_TUNABLE,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainTunable));
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