1aeef05
From bf3a1ec00a0f8c25d67a1675f5e4e1bd0e7daabd Mon Sep 17 00:00:00 2001
1aeef05
From: Ryan McCabe <rmccabe@redhat.com>
1aeef05
Date: Sun, 3 Nov 2013 12:44:49 -0500
1aeef05
Subject: [PATCH 1/2] fence_virt/fence_xvm: Print status when invoked with -o
1aeef05
 status
1aeef05
1aeef05
Previously no status was printed to stdout when fence_virt and fence_xvm
1aeef05
were invoked with the -o status flag. The exit code of the program was
1aeef05
the only way to determine the result of the status operation. This
1aeef05
patch causes fence_virt and fence_xvm to additionally print
1aeef05
either "Status: ON" or "Status: OFF" when it is able to determine
1aeef05
the status.
1aeef05
1aeef05
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
1aeef05
---
1aeef05
 client/main.c | 5 +++++
1aeef05
 1 file changed, 5 insertions(+)
1aeef05
1aeef05
diff --git a/client/main.c b/client/main.c
1aeef05
index 3c72d08..7be4a8e 100644
1aeef05
--- a/client/main.c
1aeef05
+++ b/client/main.c
1aeef05
@@ -138,7 +138,12 @@ main(int argc, char **argv)
1aeef05
 
1aeef05
 	switch(ret) {
1aeef05
 	case RESP_OFF:
1aeef05
+		if (args.op == FENCE_STATUS)
1aeef05
+			printf("Status: OFF\n");
1aeef05
+		break;
1aeef05
 	case 0:
1aeef05
+		if (args.op == FENCE_STATUS)
1aeef05
+			printf("Status: ON\n");
1aeef05
 		break;
1aeef05
 	case RESP_FAIL:
1aeef05
 		printf("Operation failed\n");
1aeef05
-- 
1aeef05
1.8.3.1
1aeef05