From: "Charles Arnold" Subject: [PATCH] Allow full domain name display with xentop Date: Wed, 02 Dec 2009 09:17:45 -0700 Message-ID: <4B1630B90200009100057F28@sinclair.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part9FB5CF39.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=__Part9FB5CF39.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Add a '-f' option to xentop to allow the full domain name to be displayed. = This is the original behavior which can cause the display to be unaligned.= Customers have requested this because only the trailing characters of = their domain names are unique and therefore cannot be distinguished when = the display is limited to a 10 character width. Signed-off-by: Charles Arnold --=__Part9FB5CF39.0__= Content-Type: text/plain; name="xentop-show-full-name.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xentop-show-full-name.patch" diff -r 176b4c8e2c4b tools/xenstat/xentop/xentop.c=0A--- a/tools/xenstat/xe= ntop/xentop.c Wed Dec 02 13:45:35 2009 +0000=0A+++ b/tools/xenstat/xentop= /xentop.c Wed Dec 02 08:46:46 2009 -0700=0A@@ -203,6 +203,7 @@ int = show_networks =3D 0;=0A int show_networks =3D 0;=0A int show_vbds =3D = 0;=0A int repeat_header =3D 0;=0A+int show_full_name =3D 0;=0A #define = PROMPT_VAL_LEN 80=0A char *prompt =3D NULL;=0A char prompt_val[PROMPT_VAL_L= EN];=0A@@ -231,6 +232,7 @@ static void usage(const char *program)=0A = "-v, --vcpus output vcpu data\n"=0A "-b, = --batch output in batch mode, no user input accepted\n"=0A = "-i, --iterations number of iterations before exiting\n"=0A+ = "-f, --full-name output the full domain name (not truncated)\n"=0A= "\n" XENTOP_BUGSTO,=0A program);=0A return;=0A@= @ -427,7 +429,10 @@ int compare_name(xenstat_domain *domain1=0A /* Prints = domain name */=0A void print_name(xenstat_domain *domain)=0A {=0A- = print("%10.10s", xenstat_domain_name(domain));=0A+ if(show_full_name)= =0A+ print("%10s", xenstat_domain_name(domain));=0A+ else=0A+ = print("%10.10s", xenstat_domain_name(domain));=0A }=0A =0A struct = {=0A@@ -1089,9 +1094,10 @@ int main(int argc, char **argv)=0A { = "delay", required_argument, NULL, 'd' },=0A { "batch", = no_argument, NULL, 'b' },=0A { "iterations", = required_argument, NULL, 'i' },=0A+ { "full-name", = no_argument, NULL, 'f' },=0A { 0, 0, 0, 0 },=0A = };=0A- const char *sopts =3D "hVnxrvd:bi:";=0A+ const char *sopts = =3D "hVnxrvd:bi:f";=0A =0A if (atexit(cleanup) !=3D 0)=0A = fail("Failed to install cleanup handler.\n");=0A@@ -1129,6 +1135,9 @@ int = main(int argc, char **argv)=0A case 'i':=0A = iterations =3D atoi(optarg);=0A loop =3D 0;=0A+ = break;=0A+ case 'f':=0A+ show_full_n= ame =3D 1;=0A break;=0A }=0A }=0A --=__Part9FB5CF39.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part9FB5CF39.0__=--