# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1176228277 -3600
# Node ID 565b5662c880e81ab528e51a6c89dbe81e8154fe
# Parent 369dfbf298ef40ece1f16499172c0cca968ac4de
Added docs and bindings for VM_metrics.state.
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
docs/xen-api/xenapi-datamodel.tex | 33 +++++++++++++++++++++++++++++++++
tools/libxen/include/xen_vm_metrics.h | 9 +++++++++
tools/libxen/src/xen_vm_metrics.c | 21 +++++++++++++++++++++
3 files changed, 63 insertions(+)
diff -r 369dfbf298ef -r 565b5662c880 docs/xen-api/xenapi-datamodel.tex
--- a/docs/xen-api/xenapi-datamodel.tex Wed Apr 11 18:39:05 2007 +0100
+++ b/docs/xen-api/xenapi-datamodel.tex Tue Apr 10 19:04:37 2007 +0100
@@ -4184,6 +4184,7 @@ Quals & Field & Type & Description \\
$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/utilisation} & (int $\rightarrow$
float) Map & Utilisation for all of guest's current VCPUs \\
$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/CPU} & (int $\rightarrow$ int) Map &
VCPU to PCPU map \\
$\mathit{RO}_\mathit{run}$ & {\tt VCPUs/params} & (string $\rightarrow$
string) Map & The live equivalent to VM.VCPUs\_params \\
+$\mathit{RO}_\mathit{run}$ & {\tt state} & string Set & The state of the
guest, eg blocked, dying etc \\
$\mathit{RO}_\mathit{run}$ & {\tt start\_time} & datetime & Time at which
this VM was last booted \\
$\mathit{RO}_\mathit{run}$ & {\tt last\_updated} & datetime & Time at which
this information was last updated \\
\hline
@@ -4395,6 +4396,38 @@ Get the VCPUs/params field of the given
\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:~get\_state}
+
+{\bf Overview:}
+Get the state field of the given VM\_metrics.
+
+ \noindent {\bf Signature:}
+\begin{verbatim} (string Set) get_state (session_id s, VM_metrics 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 VM\_metrics ref } & self & reference to the object \\ \hline
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:}
+{\tt
+string Set
}
diff -r 369dfbf298ef -r 565b5662c880 tools/libxen/include/xen_vm_metrics.h
--- a/tools/libxen/include/xen_vm_metrics.h Wed Apr 11 18:39:05 2007 +0100
+++ b/tools/libxen/include/xen_vm_metrics.h Tue Apr 10 19:04:37 2007 +0100
@@ -22,6 +22,7 @@
#include "xen_common.h"
#include "xen_int_float_map.h"
#include "xen_int_int_map.h"
+#include "xen_string_set.h"
#include "xen_string_string_map.h"
#include "xen_vm_metrics_decl.h"
@@ -70,6 +71,7 @@ typedef struct xen_vm_metrics_record
xen_int_float_map *vcpus_utilisation;
xen_int_int_map *vcpus_cpu;
xen_string_string_map *vcpus_params;
+ struct xen_string_set *state;
time_t start_time;
time_t last_updated;
} xen_vm_metrics_record;
@@ -210,6 +212,13 @@ xen_vm_metrics_get_vcpus_params(xen_sess
/**
+ * Get the state field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_state(xen_session *session, struct xen_string_set **result,
xen_vm_metrics vm_metrics);
+
+
+/**
* Get the start_time field of the given VM_metrics.
*/
extern bool
diff -r 369dfbf298ef -r 565b5662c880 tools/libxen/src/xen_vm_metrics.c
--- a/tools/libxen/src/xen_vm_metrics.c Wed Apr 11 18:39:05 2007 +0100
+++ b/tools/libxen/src/xen_vm_metrics.c Tue Apr 10 19:04:37 2007 +0100
@@ -57,6 +57,9 @@ static const struct_member xen_vm_metric
{ .key = "VCPUs_params",
.type = &abstract_type_string_string_map,
.offset = offsetof(xen_vm_metrics_record, vcpus_params) },
+ { .key = "state",
+ .type = &abstract_type_string_set,
+ .offset = offsetof(xen_vm_metrics_record, state) },
{ .key = "start_time",
.type = &abstract_type_datetime,
.offset = offsetof(xen_vm_metrics_record, start_time) },
@@ -87,6 +90,7 @@ xen_vm_metrics_record_free(xen_vm_metric
xen_int_float_map_free(record->vcpus_utilisation);
xen_int_int_map_free(record->vcpus_cpu);
xen_string_string_map_free(record->vcpus_params);
+ xen_string_set_free(record->state);
free(record);
}
@@ -215,6 +219,23 @@ xen_vm_metrics_get_vcpus_params(xen_sess
bool
+xen_vm_metrics_get_state(xen_session *session, struct xen_string_set **result,
xen_vm_metrics vm_metrics)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_string,
+ .u.string_val = vm_metrics }
+ };
+
+ abstract_type result_type = abstract_type_string_set;
+
+ *result = NULL;
+ XEN_CALL_("VM_metrics.get_state");
+ return session->ok;
+}
+
+
+bool
xen_vm_metrics_get_start_time(xen_session *session, time_t *result,
xen_vm_metrics vm_metrics)
{
abstract_value param_values[] =
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|