debuggers.hg
changeset 13747:b9febab4c6cb
Added host.logging, to hold server-side logging configuration.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Signed-off-by: Ewan Mellor <ewan@xensource.com>
author | Ewan Mellor <ewan@xensource.com> |
---|---|
date | Tue Jan 30 12:31:20 2007 +0000 (2007-01-30) |
parents | dc5e6e65bf10 |
children | c440813cc572 |
files | docs/xen-api/xenapi-datamodel.tex tools/libxen/include/xen_host.h tools/libxen/src/xen_host.c |
line diff
1.1 --- a/docs/xen-api/xenapi-datamodel.tex Tue Jan 30 11:57:56 2007 +0000 1.2 +++ b/docs/xen-api/xenapi-datamodel.tex Tue Jan 30 12:31:20 2007 +0000 1.3 @@ -3758,6 +3758,7 @@ Quals & Field & Type & Description \\ 1.4 $\mathit{RO}_\mathit{run}$ & {\tt software\_version} & (string $\rightarrow$ string) Map & version strings \\ 1.5 $\mathit{RW}$ & {\tt other\_config} & (string $\rightarrow$ string) Map & additional configuration \\ 1.6 $\mathit{RO}_\mathit{run}$ & {\tt resident\_VMs} & (VM ref) Set & list of VMs currently resident on host \\ 1.7 +$\mathit{RW}$ & {\tt logging} & (string $\rightarrow$ string) Map & logging configuration \\ 1.8 $\mathit{RO}_\mathit{run}$ & {\tt PIFs} & (PIF ref) Set & physical network interfaces \\ 1.9 $\mathit{RO}_\mathit{run}$ & {\tt PBDs} & (PBD ref) Set & physical blockdevices \\ 1.10 $\mathit{RO}_\mathit{run}$ & {\tt host\_CPUs} & (host\_cpu ref) Set & The physical CPUs on this host \\ 1.11 @@ -4281,6 +4282,143 @@ 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\_logging} 1.16 + 1.17 +{\bf Overview:} 1.18 +Get the logging field of the given host. 1.19 + 1.20 + \noindent {\bf Signature:} 1.21 +\begin{verbatim} ((string -> string) Map) get_logging (session_id s, host 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 host 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\_logging} 1.48 + 1.49 +{\bf Overview:} 1.50 +Set the logging field of the given host. 1.51 + 1.52 + \noindent {\bf Signature:} 1.53 +\begin{verbatim} void set_logging (session_id s, host 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 host 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\_logging} 1.82 + 1.83 +{\bf Overview:} 1.84 +Add the given key-value pair to the logging field of the given host. 1.85 + 1.86 + \noindent {\bf Signature:} 1.87 +\begin{verbatim} void add_to_logging (session_id s, host ref self, string key, string value)\end{verbatim} 1.88 + 1.89 + 1.90 +\noindent{\bf Arguments:} 1.91 + 1.92 + 1.93 +\vspace{0.3cm} 1.94 +\begin{tabular}{|c|c|p{7cm}|} 1.95 + \hline 1.96 +{\bf type} & {\bf name} & {\bf description} \\ \hline 1.97 +{\tt host ref } & self & reference to the object \\ \hline 1.98 + 1.99 +{\tt string } & key & Key to add \\ \hline 1.100 + 1.101 +{\tt string } & value & Value to add \\ \hline 1.102 + 1.103 +\end{tabular} 1.104 + 1.105 +\vspace{0.3cm} 1.106 + 1.107 + \noindent {\bf Return Type:} 1.108 +{\tt 1.109 +void 1.110 +} 1.111 + 1.112 + 1.113 + 1.114 +\vspace{0.3cm} 1.115 +\vspace{0.3cm} 1.116 +\vspace{0.3cm} 1.117 +\subsubsection{RPC name:~remove\_from\_logging} 1.118 + 1.119 +{\bf Overview:} 1.120 +Remove the given key and its corresponding value from the logging field of 1.121 +the given host. If the key is not in that Map, then do nothing. 1.122 + 1.123 + \noindent {\bf Signature:} 1.124 +\begin{verbatim} void remove_from_logging (session_id s, host ref self, string key)\end{verbatim} 1.125 + 1.126 + 1.127 +\noindent{\bf Arguments:} 1.128 + 1.129 + 1.130 +\vspace{0.3cm} 1.131 +\begin{tabular}{|c|c|p{7cm}|} 1.132 + \hline 1.133 +{\bf type} & {\bf name} & {\bf description} \\ \hline 1.134 +{\tt host ref } & self & reference to the object \\ \hline 1.135 + 1.136 +{\tt string } & key & Key to remove \\ \hline 1.137 + 1.138 +\end{tabular} 1.139 + 1.140 +\vspace{0.3cm} 1.141 + 1.142 + \noindent {\bf Return Type:} 1.143 +{\tt 1.144 +void 1.145 +} 1.146 + 1.147 + 1.148 + 1.149 +\vspace{0.3cm} 1.150 +\vspace{0.3cm} 1.151 +\vspace{0.3cm} 1.152 \subsubsection{RPC name:~get\_PIFs} 1.153 1.154 {\bf Overview:}
2.1 --- a/tools/libxen/include/xen_host.h Tue Jan 30 11:57:56 2007 +0000 2.2 +++ b/tools/libxen/include/xen_host.h Tue Jan 30 12:31:20 2007 +0000 2.3 @@ -72,6 +72,7 @@ typedef struct xen_host_record 2.4 xen_string_string_map *software_version; 2.5 xen_string_string_map *other_config; 2.6 struct xen_vm_record_opt_set *resident_vms; 2.7 + xen_string_string_map *logging; 2.8 struct xen_pif_record_opt_set *pifs; 2.9 struct xen_pbd_record_opt_set *pbds; 2.10 struct xen_host_cpu_record_opt_set *host_cpus; 2.11 @@ -234,6 +235,13 @@ xen_host_get_resident_vms(xen_session *s 2.12 2.13 2.14 /** 2.15 + * Get the logging field of the given host. 2.16 + */ 2.17 +extern bool 2.18 +xen_host_get_logging(xen_session *session, xen_string_string_map **result, xen_host host); 2.19 + 2.20 + 2.21 +/** 2.22 * Get the PIFs field of the given host. 2.23 */ 2.24 extern bool 2.25 @@ -293,6 +301,28 @@ xen_host_remove_from_other_config(xen_se 2.26 2.27 2.28 /** 2.29 + * Set the logging field of the given host. 2.30 + */ 2.31 +extern bool 2.32 +xen_host_set_logging(xen_session *session, xen_host host, xen_string_string_map *logging); 2.33 + 2.34 + 2.35 +/** 2.36 + * Add the given key-value pair to the logging field of the given host. 2.37 + */ 2.38 +extern bool 2.39 +xen_host_add_to_logging(xen_session *session, xen_host host, char *key, char *value); 2.40 + 2.41 + 2.42 +/** 2.43 + * Remove the given key and its corresponding value from the logging 2.44 + * field of the given host. If the key is not in that Map, then do nothing. 2.45 + */ 2.46 +extern bool 2.47 +xen_host_remove_from_logging(xen_session *session, xen_host host, char *key); 2.48 + 2.49 + 2.50 +/** 2.51 * Puts the host into a state in which no new VMs can be started. 2.52 * Currently active VMs on the host continue to execute. 2.53 */
3.1 --- a/tools/libxen/src/xen_host.c Tue Jan 30 11:57:56 2007 +0000 3.2 +++ b/tools/libxen/src/xen_host.c Tue Jan 30 12:31:20 2007 +0000 3.3 @@ -59,6 +59,9 @@ static const struct_member xen_host_reco 3.4 { .key = "resident_VMs", 3.5 .type = &abstract_type_ref_set, 3.6 .offset = offsetof(xen_host_record, resident_vms) }, 3.7 + { .key = "logging", 3.8 + .type = &abstract_type_string_string_map, 3.9 + .offset = offsetof(xen_host_record, logging) }, 3.10 { .key = "PIFs", 3.11 .type = &abstract_type_ref_set, 3.12 .offset = offsetof(xen_host_record, pifs) }, 3.13 @@ -94,6 +97,7 @@ xen_host_record_free(xen_host_record *re 3.14 xen_string_string_map_free(record->software_version); 3.15 xen_string_string_map_free(record->other_config); 3.16 xen_vm_record_opt_set_free(record->resident_vms); 3.17 + xen_string_string_map_free(record->logging); 3.18 xen_pif_record_opt_set_free(record->pifs); 3.19 xen_pbd_record_opt_set_free(record->pbds); 3.20 xen_host_cpu_record_opt_set_free(record->host_cpus); 3.21 @@ -275,6 +279,23 @@ xen_host_get_resident_vms(xen_session *s 3.22 3.23 3.24 bool 3.25 +xen_host_get_logging(xen_session *session, xen_string_string_map **result, xen_host host) 3.26 +{ 3.27 + abstract_value param_values[] = 3.28 + { 3.29 + { .type = &abstract_type_string, 3.30 + .u.string_val = host } 3.31 + }; 3.32 + 3.33 + abstract_type result_type = abstract_type_string_string_map; 3.34 + 3.35 + *result = NULL; 3.36 + XEN_CALL_("host.get_logging"); 3.37 + return session->ok; 3.38 +} 3.39 + 3.40 + 3.41 +bool 3.42 xen_host_get_pifs(xen_session *session, struct xen_pif_set **result, xen_host host) 3.43 { 3.44 abstract_value param_values[] = 3.45 @@ -408,6 +429,56 @@ xen_host_remove_from_other_config(xen_se 3.46 3.47 3.48 bool 3.49 +xen_host_set_logging(xen_session *session, xen_host host, xen_string_string_map *logging) 3.50 +{ 3.51 + abstract_value param_values[] = 3.52 + { 3.53 + { .type = &abstract_type_string, 3.54 + .u.string_val = host }, 3.55 + { .type = &abstract_type_string_string_map, 3.56 + .u.set_val = (arbitrary_set *)logging } 3.57 + }; 3.58 + 3.59 + xen_call_(session, "host.set_logging", param_values, 2, NULL, NULL); 3.60 + return session->ok; 3.61 +} 3.62 + 3.63 + 3.64 +bool 3.65 +xen_host_add_to_logging(xen_session *session, xen_host host, char *key, char *value) 3.66 +{ 3.67 + abstract_value param_values[] = 3.68 + { 3.69 + { .type = &abstract_type_string, 3.70 + .u.string_val = host }, 3.71 + { .type = &abstract_type_string, 3.72 + .u.string_val = key }, 3.73 + { .type = &abstract_type_string, 3.74 + .u.string_val = value } 3.75 + }; 3.76 + 3.77 + xen_call_(session, "host.add_to_logging", param_values, 3, NULL, NULL); 3.78 + return session->ok; 3.79 +} 3.80 + 3.81 + 3.82 +bool 3.83 +xen_host_remove_from_logging(xen_session *session, xen_host host, char *key) 3.84 +{ 3.85 + abstract_value param_values[] = 3.86 + { 3.87 + { .type = &abstract_type_string, 3.88 + .u.string_val = host }, 3.89 + { .type = &abstract_type_string, 3.90 + .u.string_val = key } 3.91 + }; 3.92 + 3.93 + xen_call_(session, "host.remove_from_logging", param_values, 2, NULL, NULL); 3.94 + return session->ok; 3.95 +} 3.96 + 3.97 + 3.98 +bool 3.99 xen_host_disable(xen_session *session, xen_host host) 3.100 { 3.101 abstract_value param_values[] =