|
|
c55d09 |
From 93ea8130081b8450981320c7c4e7b1b65a75f269 Mon Sep 17 00:00:00 2001
|
|
|
c55d09 |
From: Thilo Boehm <tboehm@linux.vnet.ibm.com>
|
|
|
c55d09 |
Date: Wed, 11 Sep 2013 16:45:36 +0200
|
|
|
c55d09 |
Subject: [PATCH 16/60] schema: New SVPC types for chardev/consoles
|
|
|
c55d09 |
|
|
|
c55d09 |
C definitions for the console source types, defining the representation
|
|
|
c55d09 |
of the consoles in the hypervisor host. Includes mapping from and to
|
|
|
c55d09 |
string representations.
|
|
|
c55d09 |
|
|
|
c55d09 |
Signed-off-by: Thilo Boehm <tboehm@linux.vnet.ibm.com>
|
|
|
c55d09 |
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
|
|
|
c55d09 |
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
|
|
|
c55d09 |
Signed-off-by: John Ferlan <jferlan@redhat.com>
|
|
|
c55d09 |
---
|
|
|
c55d09 |
src/svpc_types.h | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
|
|
|
c55d09 |
1 file changed, 96 insertions(+), 1 deletion(-)
|
|
|
c55d09 |
|
|
|
c55d09 |
diff --git a/src/svpc_types.h b/src/svpc_types.h
|
|
|
c55d09 |
index 99dd56f..2e4d73f 100644
|
|
|
c55d09 |
--- a/src/svpc_types.h
|
|
|
c55d09 |
+++ b/src/svpc_types.h
|
|
|
c55d09 |
@@ -1,5 +1,5 @@
|
|
|
c55d09 |
/*
|
|
|
c55d09 |
- * Copyright IBM Corp. 2007
|
|
|
c55d09 |
+ * Copyright IBM Corp. 2007, 2013
|
|
|
c55d09 |
*
|
|
|
c55d09 |
* Authors:
|
|
|
c55d09 |
* Dan Smith <danms@us.ibm.com>
|
|
|
c55d09 |
@@ -167,5 +167,100 @@ enum CIM_op_status {
|
|
|
c55d09 |
CIM_OP_STATUS_POWER_MODE = 18,
|
|
|
c55d09 |
};
|
|
|
c55d09 |
|
|
|
c55d09 |
+/* emum for the Character device Source resource types */
|
|
|
c55d09 |
+enum CIM_chardev_source_type {
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_NULL = 0,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_VC = 1,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_PTY = 2,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_DEV = 3,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_FILE = 4,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_PIPE = 5,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_STDIO = 6,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_UDP = 7,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_TCP = 8,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_UNIXSOCK = 9,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_SPICEVMC = 10,
|
|
|
c55d09 |
+ /* please insert new source types above */
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_INVALIDTYPE,
|
|
|
c55d09 |
+ CIM_CHARDEV_SOURCE_TYPE_UNKNOWN = 32768,
|
|
|
c55d09 |
+};
|
|
|
c55d09 |
+
|
|
|
c55d09 |
+static inline int chardev_source_type_StrToID(const char *type_str)
|
|
|
c55d09 |
+{
|
|
|
c55d09 |
+ int rc = CIM_CHARDEV_SOURCE_TYPE_UNKNOWN;
|
|
|
c55d09 |
+
|
|
|
c55d09 |
+ if (type_str == NULL)
|
|
|
c55d09 |
+ return rc;
|
|
|
c55d09 |
+
|
|
|
c55d09 |
+ if (STREQC(type_str, "null"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_NULL;
|
|
|
c55d09 |
+ else if (STREQC(type_str, "vc"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_VC;
|
|
|
c55d09 |
+ else if (STREQC(type_str, "pty"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_PTY;
|
|
|
c55d09 |
+ else if (STREQC(type_str, "dev"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_DEV;
|
|
|
c55d09 |
+ else if (STREQC(type_str, "file"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_FILE;
|
|
|
c55d09 |
+ else if (STREQC(type_str, "pipe"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_PIPE;
|
|
|
c55d09 |
+ else if (STREQC(type_str, "stdio"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_STDIO;
|
|
|
c55d09 |
+ else if (STREQC(type_str, "udp"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_UDP;
|
|
|
c55d09 |
+ else if (STREQC(type_str, "tcp"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_TCP;
|
|
|
c55d09 |
+ else if (STREQC(type_str, "unix"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_UNIXSOCK;
|
|
|
c55d09 |
+ else if (STREQC(type_str, "spicevmc"))
|
|
|
c55d09 |
+ rc = CIM_CHARDEV_SOURCE_TYPE_SPICEVMC;
|
|
|
c55d09 |
+
|
|
|
c55d09 |
+ return rc;
|
|
|
c55d09 |
+}
|
|
|
c55d09 |
+
|
|
|
c55d09 |
+static inline const char* chardev_source_type_IDToStr(int type)
|
|
|
c55d09 |
+{
|
|
|
c55d09 |
+ char *type_str = NULL;
|
|
|
c55d09 |
+
|
|
|
c55d09 |
+ switch (type)
|
|
|
c55d09 |
+ {
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_NULL:
|
|
|
c55d09 |
+ type_str = "null";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_VC:
|
|
|
c55d09 |
+ type_str = "vc";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_PTY:
|
|
|
c55d09 |
+ type_str = "pty";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_DEV:
|
|
|
c55d09 |
+ type_str = "dev";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_FILE:
|
|
|
c55d09 |
+ type_str = "file";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_PIPE:
|
|
|
c55d09 |
+ type_str = "pipe";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_STDIO:
|
|
|
c55d09 |
+ type_str = "stdio";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_UDP:
|
|
|
c55d09 |
+ type_str = "udp";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_TCP:
|
|
|
c55d09 |
+ type_str = "tcp";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_UNIXSOCK:
|
|
|
c55d09 |
+ type_str = "unix";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ case CIM_CHARDEV_SOURCE_TYPE_SPICEVMC:
|
|
|
c55d09 |
+ type_str = "spicevmc";
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ default:
|
|
|
c55d09 |
+ break;
|
|
|
c55d09 |
+ }
|
|
|
c55d09 |
+ return type_str;
|
|
|
c55d09 |
+}
|
|
|
c55d09 |
|
|
|
c55d09 |
#endif
|
|
|
c55d09 |
--
|
|
|
c55d09 |
2.1.0
|
|
|
c55d09 |
|