Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Domain.xml | 5 +++++
src/domain.c | 24 ++++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 00b4988..c6234e9 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -402,6 +402,11 @@
<arg name="cpumap" type="ab" direction="in"/>
<arg name="flags" type="u" direction="in"/>
</method>
+ <method name="PMWakeup">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainPMWakeup&qu...
+ <arg name="flags" type="u" direction="in"/>
+ </method>
<method name="Reboot">
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainReboot"...
diff --git a/src/domain.c b/src/domain.c
index 5772e7e..fc0eca2 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -2185,6 +2185,29 @@ virtDBusDomainPinVcpu(GVariant *inArgs,
virtDBusUtilSetLastVirtError(error);
}
+static void
+virtDBusDomainPMWakeup(GVariant *inArgs,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath,
+ gpointer userData,
+ GVariant **outArgs G_GNUC_UNUSED,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+{
+ virtDBusConnect *connect = userData;
+ g_autoptr(virDomain) domain = NULL;
+ guint flags;
+
+ g_variant_get(inArgs, "(u)", &flags);
+
+ domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+ if (!domain)
+ return;
+
+ if (virDomainPMWakeup(domain, flags) < 0)
+ virtDBusUtilSetLastVirtError(error);
+}
+
static void
virtDBusDomainReboot(GVariant *inArgs,
GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -2919,6 +2942,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
{ "PinEmulator", virtDBusDomainPinEmulator },
{ "PinIOThread", virtDBusDomainPinIOThread },
{ "PinVcpu", virtDBusDomainPinVcpu },
+ { "PMWakeup", virtDBusDomainPMWakeup },
{ "Reboot", virtDBusDomainReboot },
{ "Rename", virtDBusDomainRename },
{ "Reset", virtDBusDomainReset },
--
2.15.0