ia64/xen-unstable

changeset 14044:988b90c6b4f3

Added Console.other_config to the docs (Xend already has this).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Feb 20 19:38:24 2007 +0000 (2007-02-20)
parents be35eed950da
children 7819d9332fba
files docs/xen-api/xenapi-datamodel.tex tools/libxen/include/xen_console.h tools/libxen/src/xen_console.c
line diff
     1.1 --- a/docs/xen-api/xenapi-datamodel.tex	Tue Feb 20 19:23:28 2007 +0000
     1.2 +++ b/docs/xen-api/xenapi-datamodel.tex	Tue Feb 20 19:38:24 2007 +0000
     1.3 @@ -10887,6 +10887,7 @@ Quals & Field & Type & Description \\
     1.4  $\mathit{RO}_\mathit{run}$ &  {\tt protocol} & console\_protocol & the protocol used by this console \\
     1.5  $\mathit{RO}_\mathit{run}$ &  {\tt location} & string & URI for the console service \\
     1.6  $\mathit{RO}_\mathit{run}$ &  {\tt VM} & VM ref & VM to which this console is attached \\
     1.7 +$\mathit{RW}$ &  {\tt other\_config} & (string $\rightarrow$ string) Map & additional configuration \\
     1.8  \hline
     1.9  \end{longtable}
    1.10  \subsection{Additional RPCs associated with class: console}
    1.11 @@ -11018,6 +11019,145 @@ value of the field
    1.12  \vspace{0.3cm}
    1.13  \vspace{0.3cm}
    1.14  \vspace{0.3cm}
    1.15 +\subsubsection{RPC name:~get\_other\_config}
    1.16 +
    1.17 +{\bf Overview:} 
    1.18 +Get the other\_config field of the given console.
    1.19 +
    1.20 + \noindent {\bf Signature:} 
    1.21 +\begin{verbatim} ((string -> string) Map) get_other_config (session_id s, console ref self)\end{verbatim}
    1.22 +
    1.23 +
    1.24 +\noindent{\bf Arguments:}
    1.25 +
    1.26 + 
    1.27 +\vspace{0.3cm}
    1.28 +\begin{tabular}{|c|c|p{7cm}|}
    1.29 + \hline
    1.30 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.31 +{\tt console ref } & self & reference to the object \\ \hline 
    1.32 +
    1.33 +\end{tabular}
    1.34 +
    1.35 +\vspace{0.3cm}
    1.36 +
    1.37 + \noindent {\bf Return Type:} 
    1.38 +{\tt 
    1.39 +(string $\rightarrow$ string) Map
    1.40 +}
    1.41 +
    1.42 +
    1.43 +value of the field
    1.44 +\vspace{0.3cm}
    1.45 +\vspace{0.3cm}
    1.46 +\vspace{0.3cm}
    1.47 +\subsubsection{RPC name:~set\_other\_config}
    1.48 +
    1.49 +{\bf Overview:} 
    1.50 +Set the other\_config field of the given console.
    1.51 +
    1.52 + \noindent {\bf Signature:} 
    1.53 +\begin{verbatim} void set_other_config (session_id s, console ref self, (string -> string) Map value)\end{verbatim}
    1.54 +
    1.55 +
    1.56 +\noindent{\bf Arguments:}
    1.57 +
    1.58 + 
    1.59 +\vspace{0.3cm}
    1.60 +\begin{tabular}{|c|c|p{7cm}|}
    1.61 + \hline
    1.62 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.63 +{\tt console ref } & self & reference to the object \\ \hline 
    1.64 +
    1.65 +{\tt (string $\rightarrow$ string) Map } & value & New value to set \\ \hline 
    1.66 +
    1.67 +\end{tabular}
    1.68 +
    1.69 +\vspace{0.3cm}
    1.70 +
    1.71 + \noindent {\bf Return Type:} 
    1.72 +{\tt 
    1.73 +void
    1.74 +}
    1.75 +
    1.76 +
    1.77 +
    1.78 +\vspace{0.3cm}
    1.79 +\vspace{0.3cm}
    1.80 +\vspace{0.3cm}
    1.81 +\subsubsection{RPC name:~add\_to\_other\_config}
    1.82 +
    1.83 +{\bf Overview:} 
    1.84 +Add the given key-value pair to the other\_config field of the given
    1.85 +console.
    1.86 +
    1.87 + \noindent {\bf Signature:} 
    1.88 +\begin{verbatim} void add_to_other_config (session_id s, console ref self, string key, string value)\end{verbatim}
    1.89 +
    1.90 +
    1.91 +\noindent{\bf Arguments:}
    1.92 +
    1.93 + 
    1.94 +\vspace{0.3cm}
    1.95 +\begin{tabular}{|c|c|p{7cm}|}
    1.96 + \hline
    1.97 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.98 +{\tt console ref } & self & reference to the object \\ \hline 
    1.99 +
   1.100 +{\tt string } & key & Key to add \\ \hline 
   1.101 +
   1.102 +{\tt string } & value & Value to add \\ \hline 
   1.103 +
   1.104 +\end{tabular}
   1.105 +
   1.106 +\vspace{0.3cm}
   1.107 +
   1.108 + \noindent {\bf Return Type:} 
   1.109 +{\tt 
   1.110 +void
   1.111 +}
   1.112 +
   1.113 +
   1.114 +
   1.115 +\vspace{0.3cm}
   1.116 +\vspace{0.3cm}
   1.117 +\vspace{0.3cm}
   1.118 +\subsubsection{RPC name:~remove\_from\_other\_config}
   1.119 +
   1.120 +{\bf Overview:} 
   1.121 +Remove the given key and its corresponding value from the other\_config
   1.122 +field of the given console.  If the key is not in that Map, then do
   1.123 +nothing.
   1.124 +
   1.125 + \noindent {\bf Signature:} 
   1.126 +\begin{verbatim} void remove_from_other_config (session_id s, console ref self, string key)\end{verbatim}
   1.127 +
   1.128 +
   1.129 +\noindent{\bf Arguments:}
   1.130 +
   1.131 + 
   1.132 +\vspace{0.3cm}
   1.133 +\begin{tabular}{|c|c|p{7cm}|}
   1.134 + \hline
   1.135 +{\bf type} & {\bf name} & {\bf description} \\ \hline
   1.136 +{\tt console ref } & self & reference to the object \\ \hline 
   1.137 +
   1.138 +{\tt string } & key & Key to remove \\ \hline 
   1.139 +
   1.140 +\end{tabular}
   1.141 +
   1.142 +\vspace{0.3cm}
   1.143 +
   1.144 + \noindent {\bf Return Type:} 
   1.145 +{\tt 
   1.146 +void
   1.147 +}
   1.148 +
   1.149 +
   1.150 +
   1.151 +\vspace{0.3cm}
   1.152 +\vspace{0.3cm}
   1.153 +\vspace{0.3cm}
   1.154  \subsubsection{RPC name:~create}
   1.155  
   1.156  {\bf Overview:} 
     2.1 --- a/tools/libxen/include/xen_console.h	Tue Feb 20 19:23:28 2007 +0000
     2.2 +++ b/tools/libxen/include/xen_console.h	Tue Feb 20 19:38:24 2007 +0000
     2.3 @@ -22,6 +22,7 @@
     2.4  #include "xen_common.h"
     2.5  #include "xen_console_decl.h"
     2.6  #include "xen_console_protocol.h"
     2.7 +#include "xen_string_string_map.h"
     2.8  #include "xen_vm_decl.h"
     2.9  
    2.10  
    2.11 @@ -67,6 +68,7 @@ typedef struct xen_console_record
    2.12      enum xen_console_protocol protocol;
    2.13      char *location;
    2.14      struct xen_vm_record_opt *vm;
    2.15 +    xen_string_string_map *other_config;
    2.16  } xen_console_record;
    2.17  
    2.18  /**
    2.19 @@ -204,4 +206,35 @@ extern bool
    2.20  xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
    2.21  
    2.22  
    2.23 +/**
    2.24 + * Get the other_config field of the given console.
    2.25 + */
    2.26 +extern bool
    2.27 +xen_console_get_other_config(xen_session *session, xen_string_string_map **result, xen_console console);
    2.28 +
    2.29 +
    2.30 +/**
    2.31 + * Set the other_config field of the given console.
    2.32 + */
    2.33 +extern bool
    2.34 +xen_console_set_other_config(xen_session *session, xen_console console, xen_string_string_map *other_config);
    2.35 +
    2.36 +
    2.37 +/**
    2.38 + * Add the given key-value pair to the other_config field of the given
    2.39 + * console.
    2.40 + */
    2.41 +extern bool
    2.42 +xen_console_add_to_other_config(xen_session *session, xen_console console, char *key, char *value);
    2.43 +
    2.44 +
    2.45 +/**
    2.46 + * Remove the given key and its corresponding value from the
    2.47 + * other_config field of the given console.  If the key is not in that Map,
    2.48 + * then do nothing.
    2.49 + */
    2.50 +extern bool
    2.51 +xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key);
    2.52 +
    2.53 +
    2.54  #endif
     3.1 --- a/tools/libxen/src/xen_console.c	Tue Feb 20 19:23:28 2007 +0000
     3.2 +++ b/tools/libxen/src/xen_console.c	Tue Feb 20 19:38:24 2007 +0000
     3.3 @@ -24,6 +24,7 @@
     3.4  #include "xen_console.h"
     3.5  #include "xen_console_protocol_internal.h"
     3.6  #include "xen_internal.h"
     3.7 +#include "xen_string_string_map.h"
     3.8  #include "xen_vm.h"
     3.9  
    3.10  
    3.11 @@ -49,7 +50,10 @@ static const struct_member xen_console_r
    3.12            .offset = offsetof(xen_console_record, location) },
    3.13          { .key = "VM",
    3.14            .type = &abstract_type_ref,
    3.15 -          .offset = offsetof(xen_console_record, vm) }
    3.16 +          .offset = offsetof(xen_console_record, vm) },
    3.17 +        { .key = "other_config",
    3.18 +          .type = &abstract_type_string_string_map,
    3.19 +          .offset = offsetof(xen_console_record, other_config) }
    3.20      };
    3.21  
    3.22  const abstract_type xen_console_record_abstract_type_ =
    3.23 @@ -73,6 +77,7 @@ xen_console_record_free(xen_console_reco
    3.24      free(record->uuid);
    3.25      free(record->location);
    3.26      xen_vm_record_opt_free(record->vm);
    3.27 +    xen_string_string_map_free(record->other_config);
    3.28      free(record);
    3.29  }
    3.30  
    3.31 @@ -198,6 +203,73 @@ xen_console_get_vm(xen_session *session,
    3.32  
    3.33  
    3.34  bool
    3.35 +xen_console_get_other_config(xen_session *session, xen_string_string_map **result, xen_console console)
    3.36 +{
    3.37 +    abstract_value param_values[] =
    3.38 +        {
    3.39 +            { .type = &abstract_type_string,
    3.40 +              .u.string_val = console }
    3.41 +        };
    3.42 +
    3.43 +    abstract_type result_type = abstract_type_string_string_map;
    3.44 +
    3.45 +    *result = NULL;
    3.46 +    XEN_CALL_("console.get_other_config");
    3.47 +    return session->ok;
    3.48 +}
    3.49 +
    3.50 +
    3.51 +bool
    3.52 +xen_console_set_other_config(xen_session *session, xen_console console, xen_string_string_map *other_config)
    3.53 +{
    3.54 +    abstract_value param_values[] =
    3.55 +        {
    3.56 +            { .type = &abstract_type_string,
    3.57 +              .u.string_val = console },
    3.58 +            { .type = &abstract_type_string_string_map,
    3.59 +              .u.set_val = (arbitrary_set *)other_config }
    3.60 +        };
    3.61 +
    3.62 +    xen_call_(session, "console.set_other_config", param_values, 2, NULL, NULL);
    3.63 +    return session->ok;
    3.64 +}
    3.65 +
    3.66 +
    3.67 +bool
    3.68 +xen_console_add_to_other_config(xen_session *session, xen_console console, char *key, char *value)
    3.69 +{
    3.70 +    abstract_value param_values[] =
    3.71 +        {
    3.72 +            { .type = &abstract_type_string,
    3.73 +              .u.string_val = console },
    3.74 +            { .type = &abstract_type_string,
    3.75 +              .u.string_val = key },
    3.76 +            { .type = &abstract_type_string,
    3.77 +              .u.string_val = value }
    3.78 +        };
    3.79 +
    3.80 +    xen_call_(session, "console.add_to_other_config", param_values, 3, NULL, NULL);
    3.81 +    return session->ok;
    3.82 +}
    3.83 +
    3.84 +
    3.85 +bool
    3.86 +xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key)
    3.87 +{
    3.88 +    abstract_value param_values[] =
    3.89 +        {
    3.90 +            { .type = &abstract_type_string,
    3.91 +              .u.string_val = console },
    3.92 +            { .type = &abstract_type_string,
    3.93 +              .u.string_val = key }
    3.94 +        };
    3.95 +
    3.96 +    xen_call_(session, "console.remove_from_other_config", param_values, 2, NULL, NULL);
    3.97 +    return session->ok;
    3.98 +}
    3.99 +
   3.100 +
   3.101 +bool
   3.102  xen_console_get_uuid(xen_session *session, char **result, xen_console console)
   3.103  {
   3.104      *result = session->ok ? xen_strdup_((char *)console) : NULL;