Re: [dbus PATCH 02/25] Implement SendKey method for Domain Interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 17, 2018 at 02:04:21PM +0200, Katerina Koukiou wrote:
Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
---
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"/>
+      <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#virDomainSetMemoryFlags"/>
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);

Double space ^^

+    g_variant_unref(v);
+
+    v = g_variant_get_child_value(inArgs, 1);
+    holdtime  = g_variant_get_uint32(v);

Here too      ^^

+    g_variant_unref(v);
+

With that fixed:
Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux