[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Implement HostCPU.{vendor, speed, modelname}.



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID 4b0326c75c5b00ba782dade920a46f68f09dba30
# Parent  caf35cfcdda0f702281982f3e5e919197fefb950
Implement HostCPU.{vendor,speed,modelname}.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/libxen/include/xen_host_cpu.h |   24 ++++++++++++++
 tools/libxen/src/xen_host_cpu.c     |   61 ++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)

diff -r caf35cfcdda0 -r 4b0326c75c5b tools/libxen/include/xen_host_cpu.h
--- a/tools/libxen/include/xen_host_cpu.h       Thu Oct 26 15:53:31 2006 +0100
+++ b/tools/libxen/include/xen_host_cpu.h       Thu Oct 26 15:56:44 2006 +0100
@@ -66,6 +66,9 @@ typedef struct xen_host_cpu_record
     char *uuid;
     struct xen_host_record_opt *host;
     uint64_t number;
+    char *vendor;
+    uint64_t speed;
+    char *modelname;
     struct xen_cpu_feature_set *features;
     double utilisation;
 } xen_host_cpu_record;
@@ -192,6 +195,27 @@ xen_host_cpu_get_number(xen_session *ses
 
 
 /**
+ * Get the vendor field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_vendor(xen_session *session, char **result, xen_host_cpu 
host_cpu);
+
+
+/**
+ * Get the speed field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_speed(xen_session *session, uint64_t *result, xen_host_cpu 
host_cpu);
+
+
+/**
+ * Get the modelname field of the given host_cpu.
+ */
+extern bool
+xen_host_cpu_get_modelname(xen_session *session, char **result, xen_host_cpu 
host_cpu);
+
+
+/**
  * Get the features field of the given host_cpu.
  */
 extern bool
diff -r caf35cfcdda0 -r 4b0326c75c5b tools/libxen/src/xen_host_cpu.c
--- a/tools/libxen/src/xen_host_cpu.c   Thu Oct 26 15:53:31 2006 +0100
+++ b/tools/libxen/src/xen_host_cpu.c   Thu Oct 26 15:56:44 2006 +0100
@@ -48,6 +48,15 @@ static const struct_member xen_host_cpu_
         { .key = "number",
           .type = &abstract_type_int,
           .offset = offsetof(xen_host_cpu_record, number) },
+        { .key = "vendor",
+          .type = &abstract_type_string,
+          .offset = offsetof(xen_host_cpu_record, vendor) },
+        { .key = "speed",
+          .type = &abstract_type_int,
+          .offset = offsetof(xen_host_cpu_record, speed) },
+        { .key = "modelname",
+          .type = &abstract_type_string,
+          .offset = offsetof(xen_host_cpu_record, modelname) },
         { .key = "features",
           .type = &xen_cpu_feature_set_abstract_type_,
           .offset = offsetof(xen_host_cpu_record, features) },
@@ -72,6 +81,8 @@ xen_host_cpu_record_free(xen_host_cpu_re
     free(record->handle);
     free(record->uuid);
     xen_host_record_opt_free(record->host);
+    free(record->vendor);
+    free(record->modelname);
     xen_cpu_feature_set_free(record->features);
     free(record);
 }
@@ -168,6 +179,56 @@ xen_host_cpu_get_number(xen_session *ses
 
 
 bool
+xen_host_cpu_get_vendor(xen_session *session, char **result, xen_host_cpu 
host_cpu)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = host_cpu }
+        };
+
+    abstract_type result_type = abstract_type_string;
+
+    *result = NULL;
+    XEN_CALL_("host_cpu.get_vendor");
+    return session->ok;
+}
+
+
+bool
+xen_host_cpu_get_speed(xen_session *session, uint64_t *result, xen_host_cpu 
host_cpu)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = host_cpu }
+        };
+
+    abstract_type result_type = abstract_type_int;
+
+    XEN_CALL_("host_cpu.get_speed");
+    return session->ok;
+}
+
+
+bool
+xen_host_cpu_get_modelname(xen_session *session, char **result, xen_host_cpu 
host_cpu)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = host_cpu }
+        };
+
+    abstract_type result_type = abstract_type_string;
+
+    *result = NULL;
+    XEN_CALL_("host_cpu.get_modelname");
+    return session->ok;
+}
+
+
+bool
 xen_host_cpu_get_features(xen_session *session, struct xen_cpu_feature_set 
**result, xen_host_cpu host_cpu)
 {
     abstract_value param_values[] =

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.