I have several domains with names in the region of 15 characters, making
xentop's display less-than-readable. While code to dynamically resize
the column to fit as appropriate would perhaps be ideal, this
quick-and-dirty patch just changes the default from 10 to 15.
BTW, it still displays no name for my dom0 (presumably still getting a
null return value from that call?) but no longer segfaults. "xm list",
by contrast, correctly displays the name as "Domain-0".
diff -r 995e94c4802e tools/xenstat/xentop/xentop.c
--- a/tools/xenstat/xentop/xentop.c Fri Nov 11 18:11:13 2005
+++ b/tools/xenstat/xentop/xentop.c Tue Nov 29 11:45:37 2005
@@ -128,7 +128,7 @@
} field;
field fields[] = {
- { FIELD_NAME, "NAME", 10, compare_name, print_name },
+ { FIELD_NAME, "NAME", 15, compare_name, print_name },
{ FIELD_STATE, "STATE", 6, compare_state, print_state },
{ FIELD_CPU, "CPU(sec)", 10, compare_cpu, print_cpu },
{ FIELD_CPU_PCT, "CPU(%)", 6, compare_cpu_pct, print_cpu_pct },
@@ -354,7 +354,7 @@
/* Prints domain name */
void print_name(xenstat_domain *domain)
{
- print("%10s", xenstat_domain_name(domain));
+ print("%15s", xenstat_domain_name(domain));
}
struct {
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|