WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Implement HostCPU.{vendor, speed, modelname}.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 02 Nov 2006 22:09:33 +0000
Delivery-date: Thu, 02 Nov 2006 21:30:33 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Implement HostCPU.{vendor, speed, modelname}., Xen patchbot-unstable <=