Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
data/org.libvirt.Domain.xml | 8 ++++++++
src/domain.c | 46 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+)
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 74b0a62..0b23e75 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -178,6 +178,14 @@
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainResume"...
</method>
+ <method name="SendKey">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSendKey&quo...
+ <arg name="codeset" type="u" direction="in"/>
+ <arg name="holdtime" type="u" direction="in"/>
+ <arg name="keycodes" type="au"
direction="in"/>
+ <arg name="flags" type="u" direction="in"/>
+ </method>
<method name="SetMemory">
<annotation name="org.gtk.GDBus.DocString"
value="See
https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainSetMemoryFl...
diff --git a/src/domain.c b/src/domain.c
index 5ec7686..0c8e1ce 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -1002,6 +1002,51 @@ virtDBusDomainResume(GVariant *inArgs G_GNUC_UNUSED,
virtDBusUtilSetLastVirtError(error);
}
+static void
+virtDBusDomainSendKey(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 codeset;
+ guint holdtime;
+ const guint *keycodes;
+ gsize nkeycodes = 0;
+ gint ret;
+ guint flags;
+ GVariant *v;
+
+ v = g_variant_get_child_value(inArgs, 0);
+ codeset = g_variant_get_uint32(v);
+ g_variant_unref(v);
+
+ v = g_variant_get_child_value(inArgs, 1);
+ holdtime = g_variant_get_uint32(v);