mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/6] kvm tools: Return error status in lkvm list
@ 2013-02-06  8:19 Michael Ellerman
  2013-02-06  8:19 ` [PATCH 2/6] kvm tools: More error handling in the ipc code Michael Ellerman
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Michael Ellerman @ 2013-02-06  8:19 UTC (permalink / raw)
  To: penberg; +Cc: kvm, linux-kernel

Currently list always returns 0, even if there was an error. Instead
have it accumulate any errors and return that.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 tools/kvm/builtin-list.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/builtin-list.c b/tools/kvm/builtin-list.c
index 9299f17..c35be93 100644
--- a/tools/kvm/builtin-list.c
+++ b/tools/kvm/builtin-list.c
@@ -123,7 +123,7 @@ static void parse_setup_options(int argc, const char **argv)
 
 int kvm_cmd_list(int argc, const char **argv, const char *prefix)
 {
-	int r;
+	int status, r;
 
 	parse_setup_options(argc, argv);
 
@@ -133,17 +133,23 @@ int kvm_cmd_list(int argc, const char **argv, const char *prefix)
 	printf("%6s %-20s %s\n", "PID", "NAME", "STATE");
 	printf("------------------------------------\n");
 
+	status = 0;
+
 	if (run) {
 		r = kvm_list_running_instances();
 		if (r < 0)
 			perror("Error listing instances");
+
+		status |= r;
 	}
 
 	if (rootfs) {
 		r = kvm_list_rootfs();
 		if (r < 0)
 			perror("Error listing rootfs");
+
+		status |= r;
 	}
 
-	return 0;
+	return status;
 }
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-02-06 11:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06  8:19 [PATCH 1/6] kvm tools: Return error status in lkvm list Michael Ellerman
2013-02-06  8:19 ` [PATCH 2/6] kvm tools: More error handling in the ipc code Michael Ellerman
2013-02-06  8:19 ` [PATCH 3/6] kvm tools: Rework stdio/stdout handling to support redirection Michael Ellerman
2013-02-06  8:19 ` [PATCH 4/6] kvm tools: powerpc: Fix buglet in xics_init() handling of nrcpus Michael Ellerman
2013-02-06  8:19 ` [PATCH 5/6] kvm tools: powerpc: Add cpu info entry for POWER8 Michael Ellerman
2013-02-06  8:19 ` [PATCH 6/6] kvm tools: powerpc: Only emit TB freq if it's non-zero Michael Ellerman
2013-02-06 11:16 ` [PATCH 1/6] kvm tools: Return error status in lkvm list Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®