From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [PATCH 1 of 2] xl: Refactor sched_domain_output to have a callback for pool information
Date: Fri, 2 Mar 2012 10:51:58 +0000 [thread overview]
Message-ID: <70b0b974a29b58ffa7ad.1330685518@kodo2> (raw)
In-Reply-To: <patchbomb.1330685517@kodo2>
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@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
diff -r 5e38c834f795 -r 70b0b974a29b tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Thu Mar 01 19:00:09 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c Fri Mar 02 10:45:06 2012 +0000
@@ -4055,13 +4055,23 @@ static int sched_sedf_domain_output(
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;
@@ -4089,9 +4099,7 @@ static int sched_domain_output(
(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++) {
@@ -4167,7 +4175,9 @@ int main_sched_credit(int argc, char **a
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);
@@ -4244,7 +4254,9 @@ int main_sched_credit2(int argc, char **
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);
@@ -4347,7 +4359,9 @@ int main_sched_sedf(int argc, char **arg
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);
next prev parent reply other threads:[~2012-03-02 10:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 10:51 [PATCH 0 of 2] [refresh] Implement xl interface for setting credit 1 scheduler parameters George Dunlap
2012-03-02 10:51 ` George Dunlap [this message]
2012-03-02 10:51 ` [PATCH 2 of 2] xl: Implement sched-credit schedule parameter command-line interface George Dunlap
2012-03-14 14:06 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=70b0b974a29b58ffa7ad.1330685518@kodo2 \
--to=george.dunlap@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).