# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1172000304 0
# Node ID 988b90c6b4f3b628430a73b5562e65c859953173
# Parent be35eed950da0f39d3d41f738f340707e01c4cbd
Added Console.other_config to the docs (Xend already has this).
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
docs/xen-api/xenapi-datamodel.tex | 140 +++++++++++++++++++++++++++++++++++++
tools/libxen/include/xen_console.h | 33 ++++++++
tools/libxen/src/xen_console.c | 74 +++++++++++++++++++
3 files changed, 246 insertions(+), 1 deletion(-)
diff -r be35eed950da -r 988b90c6b4f3 docs/xen-api/xenapi-datamodel.tex
--- a/docs/xen-api/xenapi-datamodel.tex Tue Feb 20 19:23:28 2007 +0000
+++ b/docs/xen-api/xenapi-datamodel.tex Tue Feb 20 19:38:24 2007 +0000
@@ -10887,6 +10887,7 @@ Quals & Field & Type & Description \\
$\mathit{RO}_\mathit{run}$ & {\tt protocol} & console\_protocol & the
protocol used by this console \\
$\mathit{RO}_\mathit{run}$ & {\tt location} & string & URI for the console
service \\
$\mathit{RO}_\mathit{run}$ & {\tt VM} & VM ref & VM to which this console is
attached \\
+$\mathit{RW}$ & {\tt other\_config} & (string $\rightarrow$ string) Map &
additional configuration \\
\hline
\end{longtable}
\subsection{Additional RPCs associated with class: console}
@@ -11015,6 +11016,145 @@ VM ref
value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_other\_config}
+
+{\bf Overview:}
+Get the other\_config field of the given console.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} ((string -> string) Map) get_other_config (session_id s,
console ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt console ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+(string $\rightarrow$ string) Map
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~set\_other\_config}
+
+{\bf Overview:}
+Set the other\_config field of the given console.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void set_other_config (session_id s, console ref self,
(string -> string) Map value)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt console ref } & self & reference to the object \\ \hline
+
+{\tt (string $\rightarrow$ string) Map } & value & New value to set \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~add\_to\_other\_config}
+
+{\bf Overview:}
+Add the given key-value pair to the other\_config field of the given
+console.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void add_to_other_config (session_id s, console ref self,
string key, string value)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt console ref } & self & reference to the object \\ \hline
+
+{\tt string } & key & Key to add \\ \hline
+
+{\tt string } & value & Value to add \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~remove\_from\_other\_config}
+
+{\bf Overview:}
+Remove the given key and its corresponding value from the other\_config
+field of the given console. If the key is not in that Map, then do
+nothing.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} void remove_from_other_config (session_id s, console ref
self, string key)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt console ref } & self & reference to the object \\ \hline
+
+{\tt string } & key & Key to remove \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+void
+}
+
+
+
\vspace{0.3cm}
\vspace{0.3cm}
\vspace{0.3cm}
diff -r be35eed950da -r 988b90c6b4f3 tools/libxen/include/xen_console.h
--- a/tools/libxen/include/xen_console.h Tue Feb 20 19:23:28 2007 +0000
+++ b/tools/libxen/include/xen_console.h Tue Feb 20 19:38:24 2007 +0000
@@ -22,6 +22,7 @@
#include "xen_common.h"
#include "xen_console_decl.h"
#include "xen_console_protocol.h"
+#include "xen_string_string_map.h"
#include "xen_vm_decl.h"
@@ -67,6 +68,7 @@ typedef struct xen_console_record
enum xen_console_protocol protocol;
char *location;
struct xen_vm_record_opt *vm;
+ xen_string_string_map *other_config;
} xen_console_record;
/**
@@ -204,4 +206,35 @@ xen_console_get_vm(xen_session *session,
xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
+/**
+ * Get the other_config field of the given console.
+ */
+extern bool
+xen_console_get_other_config(xen_session *session, xen_string_string_map
**result, xen_console console);
+
+
+/**
+ * Set the other_config field of the given console.
+ */
+extern bool
+xen_console_set_other_config(xen_session *session, xen_console console,
xen_string_string_map *other_config);
+
+
+/**
+ * Add the given key-value pair to the other_config field of the given
+ * console.
+ */
+extern bool
+xen_console_add_to_other_config(xen_session *session, xen_console console,
char *key, char *value);
+
+
+/**
+ * Remove the given key and its corresponding value from the
+ * other_config field of the given console. If the key is not in that Map,
+ * then do nothing.
+ */
+extern bool
+xen_console_remove_from_other_config(xen_session *session, xen_console
console, char *key);
+
+
#endif
diff -r be35eed950da -r 988b90c6b4f3 tools/libxen/src/xen_console.c
--- a/tools/libxen/src/xen_console.c Tue Feb 20 19:23:28 2007 +0000
+++ b/tools/libxen/src/xen_console.c Tue Feb 20 19:38:24 2007 +0000
@@ -24,6 +24,7 @@
#include "xen_console.h"
#include "xen_console_protocol_internal.h"
#include "xen_internal.h"
+#include "xen_string_string_map.h"
#include "xen_vm.h"
@@ -49,7 +50,10 @@ static const struct_member xen_console_r
.offset = offsetof(xen_console_record, location) },
{ .key = "VM",
.type = &abstract_type_ref,
- .offset = offsetof(xen_console_record, vm) }
+ .offset = offsetof(xen_console_record, vm) },
+ { .key = "other_config",
+ .type = &abstract_type_string_string_map,
+ .offset = offsetof(xen_console_record, other_config) }
};
const abstract_type xen_console_record_abstract_type_ =
@@ -73,6 +77,7 @@ xen_console_record_free(xen_console_reco
free(record->uuid);
free(record->location);
xen_vm_record_opt_free(record->vm);
+ xen_string_string_map_free(record->other_config);
free(record);
}
@@ -198,6 +203,73 @@ xen_console_get_vm(xen_session *session,
bool
+xen_console_get_other_config(xen_session *session, xen_string_string_map
**result, xen_console console)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = console }
+ };
+
+ abstract_type result_type = abstract_type_string_string_map;
+
+ *result = NULL;
+ XEN_CALL_("console.get_other_config");
+ return session->ok;
+}
+
+
+bool
+xen_console_set_other_config(xen_session *session, xen_console console,
xen_string_string_map *other_config)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = console },
+ { .type = &abstract_type_string_string_map,
+ .u.set_val = (arbitrary_set *)other_config }
+ };
+
+ xen_call_(session, "console.set_other_config", param_values, 2, NULL,
NULL);
+ return session->ok;
+}
+
+
+bool
+xen_console_add_to_other_config(xen_session *session, xen_console console,
char *key, char *value)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = console },
+ { .type = &abstract_type_string,
+ .u.string_val = key },
+ { .type = &abstract_type_string,
+ .u.string_val = value }
+ };
+
+ xen_call_(session, "console.add_to_other_config", param_values, 3, NULL,
NULL);
+ return session->ok;
+}
+
+
+bool
+xen_console_remove_from_other_config(xen_session *session, xen_console
console, char *key)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = console },
+ { .type = &abstract_type_string,
+ .u.string_val = key }
+ };
+
+ xen_call_(session, "console.remove_from_other_config", param_values, 2,
NULL, NULL);
+ return session->ok;
+}
+
+
+bool
xen_console_get_uuid(xen_session *session, char **result, xen_console console)
{
*result = session->ok ? xen_strdup_((char *)console) : NULL;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|