Commit 8a41a1db authored by Katerina Koukiou's avatar Katerina Koukiou

events: Register VIR_DOMAIN_EVENT_ID_PMWAKEUP

Signed-off-by: default avatarKaterina Koukiou <kkoukiou@redhat.com>
Reviewed-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent fd8752ee
......@@ -666,6 +666,11 @@
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventPMSuspendDiskCallback"/>
<arg name="reason" type="i"/>
</signal>
<signal name="PMWakeup">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventPMWakeupCallback"/>
<arg name="reason" type="i"/>
</signal>
<signal name="Reboot">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventGenericCallback"/>
......
......@@ -275,6 +275,28 @@ virtDBusEventsDomainPMSuspendDisk(virConnectPtr connection G_GNUC_UNUSED,
return 0;
}
static gint
virtDBusEventsDomainPMWakeup(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
gint reason,
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,
"PMWakeup",
g_variant_new("(i)", reason),
NULL);
return 0;
}
static gint
virtDBusEventsDomainReboot(virConnectPtr connection G_GNUC_UNUSED,
virDomainPtr domain,
......@@ -552,6 +574,10 @@ virtDBusEventsRegister(virtDBusConnect *connect)
VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainPMSuspendDisk));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_PMWAKEUP,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainPMWakeup));
virtDBusEventsRegisterDomainEvent(connect,
VIR_DOMAIN_EVENT_ID_REBOOT,
VIR_DOMAIN_EVENT_CALLBACK(virtDBusEventsDomainReboot));
......
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