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

[libvirt] [PATCH 05/10 V2] [PATCH 05/13] send-key: Defining the public API



Add public virDomainSendKey() and enum libvirt_keycode_set
for the @codeset.

Python version of virDomainSendKey() has not been implemented yet,
it will be done soon.

Signed-off-by: Lai Jiangshan <laijs cn fujitsu com>
---
 include/libvirt/libvirt.h.in |    7 +++++++
 include/libvirt/virtkeys.h   |   22 ++++++++++++++++++++++
 python/generator.py          |    1 +
 src/libvirt_public.syms      |    5 +++++
 4 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 include/libvirt/virtkeys.h

diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index df213f1..94da205 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -2673,6 +2673,13 @@ typedef struct _virTypedParameter virMemoryParameter;
  */
 typedef virMemoryParameter *virMemoryParameterPtr;
 
+int virDomainSendKey(virDomainPtr domain,
+                     unsigned int codeset,
+                     unsigned int holdtime,
+                     unsigned int *keycodes,
+                     unsigned int nkeycodes,
+                     unsigned int flags);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/libvirt/virtkeys.h b/include/libvirt/virtkeys.h
new file mode 100644
index 0000000..854594a
--- /dev/null
+++ b/include/libvirt/virtkeys.h
@@ -0,0 +1,22 @@
+#ifndef _LIBVIRT_VIRTKEYS_H
+#define _LIBVIRT_VIRTKEYS_H
+
+/*
+ * Copyright (c) 2011 Lai Jiangshan
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+enum libvirt_keycode_set {
+    LIBVIRT_KEYCODE_LINUX          = 0,
+    LIBVIRT_KEYCODE_XT             = 1,
+    LIBVIRT_KEYCODE_ATSET1         = 2,
+    LIBVIRT_KEYCODE_ATSET2         = 3,
+    LIBVIRT_KEYCODE_ATSET3         = 4,
+};
+
+#define MAX_SEND_KEY  16
+
+#endif
diff --git a/python/generator.py b/python/generator.py
index 7c38fdd..57373f0 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -356,6 +356,7 @@ skip_impl = (
     'virNodeDeviceListCaps',
     'virConnectBaselineCPU',
     'virDomainRevertToSnapshot',
+    'virDomainSendKey',
 )
 
 
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index 4d4299a..ddfed44 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -450,4 +450,9 @@ LIBVIRT_0.9.2 {
         virInterfaceChangeRollback;
 } LIBVIRT_0.9.0;
 
+LIBVIRT_0.9.3 {
+    global:
+        virDomainSendKey;
+} LIBVIRT_0.9.2;
+
 # .... define new API here using predicted next version number ....
-- 
1.7.4.4


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