ia64/xen-unstable

changeset 14815:f3f4f4ca6f61

Added documentation and bindings for host_cpu.features.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Wed Apr 11 21:55:05 2007 +0100 (2007-04-11)
parents 565b5662c880
children 46a592e2b7ea
files docs/xen-api/xenapi-datamodel.tex tools/libxen/include/xen_host_cpu.h tools/libxen/src/xen_host_cpu.c
line diff
     1.1 --- a/docs/xen-api/xenapi-datamodel.tex	Tue Apr 10 19:04:37 2007 +0100
     1.2 +++ b/docs/xen-api/xenapi-datamodel.tex	Wed Apr 11 21:55:05 2007 +0100
     1.3 @@ -6634,7 +6634,8 @@ Quals & Field & Type & Description \\
     1.4  $\mathit{RO}_\mathit{run}$ &  {\tt speed} & int & the speed of the physical CPU \\
     1.5  $\mathit{RO}_\mathit{run}$ &  {\tt modelname} & string & the model name of the physical CPU \\
     1.6  $\mathit{RO}_\mathit{run}$ &  {\tt stepping} & string & the stepping of the physical CPU \\
     1.7 -$\mathit{RO}_\mathit{run}$ &  {\tt flags} & string & the flags of the physical CPU \\
     1.8 +$\mathit{RO}_\mathit{run}$ &  {\tt flags} & string & the flags of the physical CPU (a decoded version of the features field) \\
     1.9 +$\mathit{RO}_\mathit{run}$ &  {\tt features} & string & the physical CPU feature bitmap \\
    1.10  $\mathit{RO}_\mathit{run}$ &  {\tt utilisation} & float & the current CPU utilisation \\
    1.11  \hline
    1.12  \end{longtable}
    1.13 @@ -6916,6 +6917,38 @@ value of the field
    1.14  \vspace{0.3cm}
    1.15  \vspace{0.3cm}
    1.16  \vspace{0.3cm}
    1.17 +\subsubsection{RPC name:~get\_features}
    1.18 +
    1.19 +{\bf Overview:} 
    1.20 +Get the features field of the given host\_cpu.
    1.21 +
    1.22 + \noindent {\bf Signature:} 
    1.23 +\begin{verbatim} string get_features (session_id s, host_cpu ref self)\end{verbatim}
    1.24 +
    1.25 +
    1.26 +\noindent{\bf Arguments:}
    1.27 +
    1.28 + 
    1.29 +\vspace{0.3cm}
    1.30 +\begin{tabular}{|c|c|p{7cm}|}
    1.31 + \hline
    1.32 +{\bf type} & {\bf name} & {\bf description} \\ \hline
    1.33 +{\tt host\_cpu ref } & self & reference to the object \\ \hline 
    1.34 +
    1.35 +\end{tabular}
    1.36 +
    1.37 +\vspace{0.3cm}
    1.38 +
    1.39 + \noindent {\bf Return Type:} 
    1.40 +{\tt 
    1.41 +string
    1.42 +}
    1.43 +
    1.44 +
    1.45 +value of the field
    1.46 +\vspace{0.3cm}
    1.47 +\vspace{0.3cm}
    1.48 +\vspace{0.3cm}
    1.49  \subsubsection{RPC name:~get\_utilisation}
    1.50  
    1.51  {\bf Overview:} 
     2.1 --- a/tools/libxen/include/xen_host_cpu.h	Tue Apr 10 19:04:37 2007 +0100
     2.2 +++ b/tools/libxen/include/xen_host_cpu.h	Wed Apr 11 21:55:05 2007 +0100
     2.3 @@ -70,6 +70,7 @@ typedef struct xen_host_cpu_record
     2.4      char *modelname;
     2.5      char *stepping;
     2.6      char *flags;
     2.7 +    char *features;
     2.8      double utilisation;
     2.9  } xen_host_cpu_record;
    2.10  
    2.11 @@ -223,6 +224,13 @@ xen_host_cpu_get_flags(xen_session *sess
    2.12  
    2.13  
    2.14  /**
    2.15 + * Get the features field of the given host_cpu.
    2.16 + */
    2.17 +extern bool
    2.18 +xen_host_cpu_get_features(xen_session *session, char **result, xen_host_cpu host_cpu);
    2.19 +
    2.20 +
    2.21 +/**
    2.22   * Get the utilisation field of the given host_cpu.
    2.23   */
    2.24  extern bool
     3.1 --- a/tools/libxen/src/xen_host_cpu.c	Tue Apr 10 19:04:37 2007 +0100
     3.2 +++ b/tools/libxen/src/xen_host_cpu.c	Wed Apr 11 21:55:05 2007 +0100
     3.3 @@ -61,6 +61,9 @@ static const struct_member xen_host_cpu_
     3.4          { .key = "flags",
     3.5            .type = &abstract_type_string,
     3.6            .offset = offsetof(xen_host_cpu_record, flags) },
     3.7 +        { .key = "features",
     3.8 +          .type = &abstract_type_string,
     3.9 +          .offset = offsetof(xen_host_cpu_record, features) },
    3.10          { .key = "utilisation",
    3.11            .type = &abstract_type_float,
    3.12            .offset = offsetof(xen_host_cpu_record, utilisation) }
    3.13 @@ -90,6 +93,7 @@ xen_host_cpu_record_free(xen_host_cpu_re
    3.14      free(record->modelname);
    3.15      free(record->stepping);
    3.16      free(record->flags);
    3.17 +    free(record->features);
    3.18      free(record);
    3.19  }
    3.20  
    3.21 @@ -252,6 +256,23 @@ xen_host_cpu_get_flags(xen_session *sess
    3.22  
    3.23  
    3.24  bool
    3.25 +xen_host_cpu_get_features(xen_session *session, char **result, xen_host_cpu host_cpu)
    3.26 +{
    3.27 +    abstract_value param_values[] =
    3.28 +        {
    3.29 +            { .type = &abstract_type_string,
    3.30 +              .u.string_val = host_cpu }
    3.31 +        };
    3.32 +
    3.33 +    abstract_type result_type = abstract_type_string;
    3.34 +
    3.35 +    *result = NULL;
    3.36 +    XEN_CALL_("host_cpu.get_features");
    3.37 +    return session->ok;
    3.38 +}
    3.39 +
    3.40 +
    3.41 +bool
    3.42  xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu)
    3.43  {
    3.44      abstract_value param_values[] =