[Sheepdog] [PATCH] Return EXIT_MISSING from vdi setattr and getattr when VDI is not found

Chris Webb chris at arachsys.com
Thu Jul 28 13:41:42 CEST 2011


Previously, a general EXIT_FAILURE was returned in this case, which is hard to
distinguish from other cluster failures.

Signed-off-by: Chris Webb <chris at arachsys.com>
---
 collie/collie.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/collie/collie.c b/collie/collie.c
index 853d8b6..ae33e0c 100644
--- a/collie/collie.c
+++ b/collie/collie.c
@@ -979,6 +979,9 @@ reread:
 		} else if (ret == SD_RES_NO_OBJ) {
 			fprintf(stderr, "no such attribute, %s\n", key);
 			return EXIT_MISSING;
+		} else if (ret == SD_RES_NO_VDI) {
+			fprintf(stderr, "vdi not found\n");
+			return EXIT_MISSING;
 		} else
 			fprintf(stderr, "failed to find attr oid, %s\n",
 				sd_strerror(ret));
@@ -1063,6 +1066,9 @@ static int vdi_getattr(int argc, char **argv)
 	if (ret == SD_RES_NO_OBJ) {
 		fprintf(stderr, "no such attribute, %s\n", key);
 		return EXIT_MISSING;
+	} else if (ret == SD_RES_NO_VDI) {
+		fprintf(stderr, "vdi not found\n");
+		return EXIT_MISSING;
 	} else if (ret) {
 		fprintf(stderr, "failed to find attr oid, %s\n",
 			sd_strerror(ret));
-- 
1.7.5.4




More information about the sheepdog mailing list