xentop 显示VM名字不全。Allow full domain name display with xentop
Subject: | [Xen-devel] [PATCH] Allow full domain name display with xentop | ![]() |
---|---|---|
From: | Charles Arnold (carn...@novell.com) | |
Date: | Dec 2, 2009 8:17:07 am | |
List: | com.xensource.lists.xen-devel | |
Attachments: |
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 <carn...@novell.com>
diff -r 176b4c8e2c4b tools/xenstat/xentop/xentop.c--- a/tools/xenstat/xentop/xentop.c Wed Dec 02 13:45:35 2009 +0000+++ b/tools/xenstat/xentop/xentop.c Wed Dec 02 08:46:46 2009 -0700@@ -203,6 +203,7 @@ int show_networks = 0; int show_networks = 0; int show_vbds = 0; int repeat_header = 0;+int show_full_name = 0; #define PROMPT_VAL_LEN 80 char *prompt = NULL; char prompt_val[PROMPT_VAL_LEN];@@ -231,6 +232,7 @@ static void usage(const char *program) "-v, --vcpus output vcpu data\n" "-b, --batch output in batch mode, no user input accepted\n" "-i, --iterations number of iterations before exiting\n"+ "-f, --full-name output the full domain name (not truncated)\n" "\n" XENTOP_BUGSTO, program); return;@@ -427,7 +429,10 @@ int compare_name(xenstat_domain *domain1 /* Prints domain name */ void print_name(xenstat_domain *domain) {- print("%10.10s", xenstat_domain_name(domain));+ if(show_full_name)+ print("%10s", xenstat_domain_name(domain));+ else+ print("%10.10s", xenstat_domain_name(domain)); }
struct {@@ -1089,9 +1094,10 @@ int main(int argc, char **argv) { "delay", required_argument, NULL, 'd' }, { "batch", no_argument, NULL, 'b' }, { "iterations", required_argument, NULL, 'i' },+ { "full-name", no_argument, NULL, 'f' }, { 0, 0, 0, 0 }, };- const char *sopts = "hVnxrvd:bi:";+ const char *sopts = "hVnxrvd:bi:f";
if (atexit(cleanup) != 0) fail("Failed to install cleanup handler.\n");@@ -1129,6 +1135,9 @@ int main(int argc, char **argv) case 'i': iterations = atoi(optarg); loop = 0;+ break;+ case 'f':+ show_full_name = 1; break; } }
_______________________________________________Xen-devel mailing listXen-...@lists.xensource.comhttp://lists.xensource.com/xen-devel
更多文章推荐
- 华为云21天转型微服务实战营全部资源
- kubernetes离线安装KubePi
- OpenEuler/Centos安装containerd容器,cni,nerdctl,buildkit,runc
- K8s网络组件之Flannel:VXLAN模式
- 在 Kubernetess 中使用 DNS 和 Headless Service 发现运行中的 Pod
- K8s网络组件之Calico:IPIP工作模式
- K8s网络组件之Calico:Route Reflector 模式(RR)
- K8s 高性能网络组件 Calico 入门教程
- 华为云基于ServiceStage的微服务开发与部署的实验过程问题
- 如何体验华为云ServiceStage的源码部署功能?
<< 上一篇