aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxen/include
diff options
context:
space:
mode:
authorEwan Mellor <ewan@xensource.com>2007-04-09 17:09:21 +0100
committerEwan Mellor <ewan@xensource.com>2007-04-09 17:09:21 +0100
commit6492f2ffbf3fadb112a5e819c1afb56cd258893c (patch)
tree23acde499a940cb3a4597adfabf64a7687b6fa8c /tools/libxen/include
parent668fbded84ff31d548ae5e84419b2acab88600e2 (diff)
downloadxen-6492f2ffbf3fadb112a5e819c1afb56cd258893c.tar.gz
xen-6492f2ffbf3fadb112a5e819c1afb56cd258893c.tar.bz2
xen-6492f2ffbf3fadb112a5e819c1afb56cd258893c.zip
Added documentation, C bindings, and a test for VM_metrics.{start_time,
VCPUs_CPU,VCPUs_params}. Changed VM_metrics.start_time to be a DateTime, not an integer. Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/libxen/include')
-rw-r--r--tools/libxen/include/xen_int_int_map.h53
-rw-r--r--tools/libxen/include/xen_internal.h1
-rw-r--r--tools/libxen/include/xen_vm_metrics.h26
3 files changed, 80 insertions, 0 deletions
diff --git a/tools/libxen/include/xen_int_int_map.h b/tools/libxen/include/xen_int_int_map.h
new file mode 100644
index 0000000000..5d11e146b0
--- /dev/null
+++ b/tools/libxen/include/xen_int_int_map.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef XEN_INT_INT_MAP_H
+#define XEN_INT_INT_MAP_H
+
+
+#include "xen_common.h"
+
+
+typedef struct xen_int_int_map_contents
+{
+ int64_t key;
+ int64_t val;
+} xen_int_int_map_contents;
+
+
+typedef struct xen_int_int_map
+{
+ size_t size;
+ xen_int_int_map_contents contents[];
+} xen_int_int_map;
+
+/**
+ * Allocate a xen_int_int_map of the given size.
+ */
+extern xen_int_int_map *
+xen_int_int_map_alloc(size_t size);
+
+/**
+ * Free the given xen_int_int_map, and all referenced values. The
+ * given map must have been allocated by this library.
+ */
+extern void
+xen_int_int_map_free(xen_int_int_map *map);
+
+
+#endif
diff --git a/tools/libxen/include/xen_internal.h b/tools/libxen/include/xen_internal.h
index ac50de20b2..aad061fe56 100644
--- a/tools/libxen/include/xen_internal.h
+++ b/tools/libxen/include/xen_internal.h
@@ -86,6 +86,7 @@ extern const abstract_type abstract_type_ref_set;
extern const abstract_type abstract_type_string_string_map;
extern const abstract_type abstract_type_int_float_map;
+extern const abstract_type abstract_type_int_int_map;
typedef struct abstract_value
diff --git a/tools/libxen/include/xen_vm_metrics.h b/tools/libxen/include/xen_vm_metrics.h
index d686a7c99f..4b64b5953e 100644
--- a/tools/libxen/include/xen_vm_metrics.h
+++ b/tools/libxen/include/xen_vm_metrics.h
@@ -21,6 +21,8 @@
#include "xen_common.h"
#include "xen_int_float_map.h"
+#include "xen_int_int_map.h"
+#include "xen_string_string_map.h"
#include "xen_vm_metrics_decl.h"
@@ -66,6 +68,9 @@ typedef struct xen_vm_metrics_record
int64_t memory_actual;
int64_t vcpus_number;
xen_int_float_map *vcpus_utilisation;
+ xen_int_int_map *vcpus_cpu;
+ xen_string_string_map *vcpus_params;
+ time_t start_time;
time_t last_updated;
} xen_vm_metrics_record;
@@ -191,6 +196,27 @@ xen_vm_metrics_get_vcpus_utilisation(xen_session *session, xen_int_float_map **r
/**
+ * Get the VCPUs/CPU field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_cpu(xen_session *session, xen_int_int_map **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the VCPUs/params field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the start_time field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_start_time(xen_session *session, time_t *result, xen_vm_metrics vm_metrics);
+
+
+/**
* Get the last_updated field of the given VM_metrics.
*/
extern bool