This patch changes 'kvm list' default output to look as follows:

  [penberg@tux kvm]$ ./kvm list
    PID GUEST
   8156 guest-8156
        default (not running)
        test-box (not running)

Cc: Asias He <[email protected]>
Cc: Cyrill Gorcunov <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Sasha Levin <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
---
 tools/kvm/builtin-list.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/tools/kvm/builtin-list.c b/tools/kvm/builtin-list.c
index 12e2537..2ff3472 100644
--- a/tools/kvm/builtin-list.c
+++ b/tools/kvm/builtin-list.c
@@ -91,8 +91,6 @@ cleanup:
 
 static int kvm_list_running_instances(void)
 {
-       printf("  PID GUEST\n");
-
        return kvm__enumerate_instances(print_guest);
 }
 
@@ -107,13 +105,11 @@ static int kvm_list_rootfs(void)
        if (dir == NULL)
                return -1;
 
-       printf("  ROOTFS\n");
-
        while ((dirent = readdir(dir))) {
                if (dirent->d_type == DT_DIR &&
                        strcmp(dirent->d_name, ".") &&
                        strcmp(dirent->d_name, ".."))
-                       printf("%s\n", dirent->d_name);
+                       printf("      %s (not running)\n", dirent->d_name);
        }
 
        return 0;
@@ -136,7 +132,9 @@ int kvm_cmd_list(int argc, const char **argv, const char 
*prefix)
        parse_setup_options(argc, argv);
 
        if (!run && !rootfs)
-               kvm_list_help();
+               run = rootfs = true;
+
+       printf("  PID GUEST\n");
 
        if (run) {
                r = kvm_list_running_instances();
-- 
1.7.6.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