Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Domain.xml | 4 ++++
src/events.c | 25 +++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index c49f5e8..992fb11 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -603,6 +603,10 @@
<arg name="type" type="i"/>
<arg name="status" type="i"/>
</signal>
+ <signal name="ControlError">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEven...
+ </signal>
<signal name="DeviceAdded">
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEven...
diff --git a/src/events.c b/src/events.c
index 10b2802..251ea59 100644
--- a/src/events.c
+++ b/src/events.c
@@ -74,6 +74,27 @@ virtDBusEventsDomainBlockJob(virConnectPtr connection G_GNUC_UNUSED,
return 0;
}
+static gint
+virtDBusEventsDomainControlError(virConnectPtr connection G_GNUC_UNUSED,
+ virDomainPtr domain,
+ 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,
+ "ControlError",
+ NULL,
+ NULL);
+
+ return 0;
+}
+
static gint
virtDBusEventsDomainLifecycle(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
@@ -361,6 +382,10 @@ virtDBusEventsRegister(virtDBusConnect *connect)
VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainBlockJob));
+ virtDBusEventsRegisterDomainEvent(connect,
+ VIR_DOMAIN_EVENT_ID_CONTROL_ERROR,
+
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainControlError));
+
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_LIFECYCLE,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainLifecycle));
--
2.15.0