mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
Added Console.other_config to the docs (Xend already has this).
Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
cdbec983af
commit
c2592685ff
3 files changed
+246
-1
No files matched your search
@@ -10887,6 +10887,7 @@ $\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object ref
|
||||
$\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}
|
||||
|
||||
@@ -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 @@ extern bool
|
||||
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
|
||||
@@ -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_record_struct_members[] =
|
||||
.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_record *record)
|
||||
free(record->uuid);
|
||||
free(record->location);
|
||||
xen_vm_record_opt_free(record->vm);
|
||||
xen_string_string_map_free(record->other_config);
|
||||
free(record);
|
||||
}
|
||||
|
||||
@@ -197,6 +202,73 @@ xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console)
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||