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

[Xen-changelog] [xen-unstable] xl: Refactor sched_domain_output to have a callback for pool information



# HG changeset patch
# User George Dunlap <george.dunlap@xxxxxxxxxxxxx>
# Date 1331733898 0
# Node ID 847f05b8d3001303485d53de24ce40b8eb905920
# Parent  20c8a7db63d160e95fcf5c8e2f9d31923d336316
xl: Refactor sched_domain_output to have a callback for pool information

Allow a scheduler to provide a callback to display pool-wide information,
providing a default.  This is in preparation for displaying pool-wide
scheduler parameters on this line.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 20c8a7db63d1 -r 847f05b8d300 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed Mar 14 11:40:44 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Wed Mar 14 14:04:58 2012 +0000
@@ -4056,13 +4056,23 @@
     return 0;
 }
 
-static int sched_domain_output(
-    libxl_scheduler sched, int (*output)(int), const char *cpupool)
+static int sched_default_pool_output(uint32_t poolid)
+{
+    char *poolname;
+
+    poolname = libxl_cpupoolid_to_name(ctx, poolid);
+    printf("Cpupool %s:\n",
+           poolname);
+    free(poolname);
+    return 0;
+}
+
+static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
+                               int (*pooloutput)(uint32_t), const char 
*cpupool)
 {
     libxl_dominfo *info;
     libxl_cpupoolinfo *poolinfo = NULL;
     uint32_t poolid;
-    char *poolname;
     int nb_domain, n_pools = 0, i, p;
     int rc = 0;
 
@@ -4090,9 +4100,7 @@
             (cpupool && (poolid != poolinfo[p].poolid)))
             continue;
 
-        poolname = libxl_cpupoolid_to_name(ctx, poolinfo[p].poolid);
-        printf("Cpupool %s:\n", poolname);
-        free(poolname);
+        pooloutput(poolinfo[p].poolid);
 
         output(-1);
         for (i = 0; i < nb_domain; i++) {
@@ -4168,7 +4176,9 @@
 
     if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
-                                    sched_credit_domain_output, cpupool);
+                                    sched_credit_domain_output,
+                                    sched_default_pool_output,
+                                    cpupool);
     } else {
         find_domain(dom);
 
@@ -4245,7 +4255,9 @@
 
     if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
-                                    sched_credit2_domain_output, cpupool);
+                                    sched_credit2_domain_output,
+                                    sched_default_pool_output,
+                                    cpupool);
     } else {
         find_domain(dom);
 
@@ -4348,7 +4360,9 @@
 
     if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_SEDF,
-                                    sched_sedf_domain_output, cpupool);
+                                    sched_sedf_domain_output,
+                                    sched_default_pool_output,
+                                    cpupool);
     } else {
         find_domain(dom);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.