Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx> --- data/org.libvirt.Domain.xml | 7 +++++++ src/events.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml index 13f9ee3..c52f9d4 100644 --- a/data/org.libvirt.Domain.xml +++ b/data/org.libvirt.Domain.xml @@ -643,6 +643,13 @@ <annotation name="org.gtk.GDBus.DocString" value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventGenericCallback"/> </signal> + <signal name="IOError"> + <annotation name="org.gtk.GDBus.DocString" + value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventIOErrorCallback"/> + <arg name="srcPath" type="s"/> + <arg name="device" type="s"/> + <arg name="action" type="i"/> + </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 d409c50..b7aa4e5 100644 --- a/src/events.c +++ b/src/events.c @@ -240,6 +240,31 @@ virtDBusEventsDomainGraphics(virConnectPtr connection G_GNUC_UNUSED, return 0; } +static gint +virtDBusEventsDomainIOError(virConnectPtr connection G_GNUC_UNUSED, + virDomainPtr domain, + const gchar *srcPath, + const gchar *device, + gint action, + 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, + "IOError", + g_variant_new("(ssi)", srcPath, device, + action), + NULL); + + return 0; +} + static gint virtDBusEventsDomainReboot(virConnectPtr connection G_GNUC_UNUSED, virDomainPtr domain, @@ -509,6 +534,10 @@ virtDBusEventsRegister(virtDBusConnect *connect) VIR_DOMAIN_EVENT_ID_GRAPHICS, VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainGraphics)); + virtDBusEventsRegisterDomainEvent(connect, + VIR_DOMAIN_EVENT_ID_IO_ERROR, + VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainIOError)); + 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