Commit ccd1fd78 authored by Katerina Koukiou's avatar Katerina Koukiou

events: Register VIR_DOMAIN_EVENT_ID_RTC_CHANGE

Signed-off-by: default avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent 8a41a1db
......@@ -675,6 +675,11 @@
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventGenericCallback"/>
</signal>
<signal name="RTCChange">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventRTCChangeCallback"/>
<arg name="utcoffset" type="x"/>
</signal>
<signal name="TrayChange">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventTrayChangeCallback"/>
......
......@@ -318,6 +318,28 @@ virtDBusEventsDomainReboot(virConnectPtr connection G_GNUC_UNUSED,
return 0;
}
static gint
virtDBusEventsDomainRTCChange(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
gint64 utcoffset,
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,
"RTCChange",
g_variant_new("(x)", utcoffset),
NULL);
return 0;
}
static gint
virtDBusEventsDomainTrayChange(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
......@@ -582,6 +604,10 @@ virtDBusEventsRegister(virtDBusConnect *connect)
VIR_DOMAIN_EVENT_ID_REBOOT,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainReboot));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_RTC_CHANGE,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainRTCChange));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_TRAY_CHANGE,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainTrayChange));
......
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