mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-15 18:05:49 +00:00
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@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
committed by
Will Deacon
parent
5fd5abef73
commit
8a09361d6a
+3
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user