Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 5 +++++ src/events.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 5ab6660..39b7ac6 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -700,5 +700,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> diff --git a/src/events.c b/src/events.c index 6319776..d8c2a37 100644 --- a/src/events.c +++ b/src/events.c @@ -494,6 +494,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, @@ -763,6 +789,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)); -- 2.15.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list