Commit 1d2a51e8 authored by Katerina Koukiou's avatar Katerina Koukiou

events: Register VIR_DOMAIN_EVENT_ID_REBOOT

Signed-off-by: default avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent 23cc188f
......@@ -640,6 +640,10 @@
<arg name="device" type="s"/>
<arg name="reason" type="u"/>
</signal>
<signal name="Reboot">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventGenericCallback"/>
</signal>
<signal name="TrayChange">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventTrayChangeCallback"/>
......
......@@ -160,6 +160,27 @@ virtDBusEventsDomainDeviceRemoved(virConnectPtr connection G_GNUC_UNUSED,
return 0;
}
static gint
virtDBusEventsDomainReboot(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,
"Reboot",
NULL,
NULL);
return 0;
}
static gint
virtDBusEventsDomainTrayChange(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
......@@ -396,6 +417,10 @@ virtDBusEventsRegister(virtDBusConnect *connect)
VIR_DOMAIN_EVENT_ID_DISK_CHANGE,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainDiskChange));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_REBOOT,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainReboot));
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