[tip:tools/kvm] kvm tools: Improve 'kvm list' output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  96d3c1f8bddd2ad3d9ca351a76ac30be91bad216
Gitweb:     http://git.kernel.org/tip/96d3c1f8bddd2ad3d9ca351a76ac30be91bad216
Author:     Pekka Enberg <penberg@xxxxxxxxxx>
AuthorDate: Wed, 10 Aug 2011 21:20:22 +0300
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Wed, 10 Aug 2011 21:20:22 +0300

kvm tools: Improve 'kvm list' output

This patch improves 'kvm list' output to look more like 'ps':

  $ ./kvm list
    PID GUEST
   2820 guest-2820

Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Sasha Levin <levinsasha928@xxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/builtin-list.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/kvm/builtin-list.c b/tools/kvm/builtin-list.c
index 43f37f2..34cc03b 100644
--- a/tools/kvm/builtin-list.c
+++ b/tools/kvm/builtin-list.c
@@ -25,7 +25,7 @@ static int print_guest(const char *name, int pid)
 	if (strncmp(comm, PROCESS_NAME, strlen(PROCESS_NAME)))
 		goto cleanup;
 
-	printf("%s (PID: %d)\n", name, pid);
+	printf("%5d %s\n", pid, name);
 
 	free(comm);
 
@@ -45,5 +45,7 @@ cleanup:
 
 int kvm_cmd_list(int argc, const char **argv, const char *prefix)
 {
+	printf("  PID GUEST\n");
+
 	return kvm__enumerate_instances(print_guest);
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux