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

  $ ./kvm list
    PID GUEST
   2820 guest-2820

Cc: Ingo Molnar <[email protected]>
Cc: Sasha Levin <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
---
 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);
 }
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to