[dbus PATCH 20/22] events: Register VIR_DOMAIN_EVENT_ID_RTC_CHANGE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
---
 data/org.libvirt.Domain.xml |  5 +++++
 src/events.c                | 26 ++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 3478c09..5ab6660 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -689,6 +689,11 @@
         value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventPMWakeupCallback"/>
       <arg name="reason" type="i"/>
     </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"/>
diff --git a/src/events.c b/src/events.c
index c71ed14..6319776 100644
--- a/src/events.c
+++ b/src/events.c
@@ -428,6 +428,28 @@ virtDBusEventsDomainPMWakeup(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
 virtDBusEventsDomainReboot(virConnectPtr connection G_GNUC_UNUSED,
                            virDomainPtr domain,
@@ -729,6 +751,10 @@ virtDBusEventsRegister(virtDBusConnect *connect)
                                       VIR_DOMAIN_EVENT_ID_PMWAKEUP,
                                       VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainPMWakeup));
 
+    virtDBusEventsRegisterDomainEvent(connect,
+                                      VIR_DOMAIN_EVENT_ID_RTC_CHANGE,
+                                      VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainRTCChange));
+
     virtDBusEventsRegisterDomainEvent(connect,
                                       VIR_DOMAIN_EVENT_ID_REBOOT,
                                       VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainReboot));
-- 
2.15.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux