Skip to contentSkip to conversation

Mind resizing xentop's domain name field? (and the null-dom0-name thing)

PATCH Charles Duffy 1 participant 1 message Nov 29, 2005

lore
Share & tools
lore
#0 lore raw

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".

tools/xenstat/xentop/xentop.c Tue Nov 29 11:45:37 2005 renamed from tools/xenstat/xentop/xentop.c Fri Nov 11 18:11:13 2005 +2 -2
diff -r 995e94c4802e tools/xenstat/xentop/xentop.c
@@ -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 {