[DRBD-cvs] svn commit by lars - r2864 - trunk/user - state, cstate, dstate commands need to recognize and re

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Tue Apr 24 11:34:48 CEST 2007


Author: lars
Date: 2007-04-24 11:34:47 +0200 (Tue, 24 Apr 2007)
New Revision: 2864

Modified:
   trunk/user/drbdsetup.c
Log:
state, cstate, dstate commands need to recognize and report an Unconfigured device

Modified: trunk/user/drbdsetup.c
===================================================================
--- trunk/user/drbdsetup.c	2007-04-20 13:28:36 UTC (rev 2863)
+++ trunk/user/drbdsetup.c	2007-04-24 09:34:47 UTC (rev 2864)
@@ -1079,7 +1079,12 @@
 {
 	drbd_state_t state;
 	consume_tag_int(T_state_i,rtl,(int*)&state.i);
-	printf("%s/%s\n",roles_to_name(state.role),roles_to_name(state.peer));
+	if ( state.conn == StandAlone &&
+	     state.disk == Diskless) {
+		printf("Unconfigured\n");
+	} else {
+		printf("%s/%s\n",roles_to_name(state.role),roles_to_name(state.peer));
+	}
 	return 0;
 }
 
@@ -1089,7 +1094,12 @@
 {
 	drbd_state_t state;
 	consume_tag_int(T_state_i,rtl,(int*)&state.i);
-	printf("%s\n",conns_to_name(state.conn));
+	if ( state.conn == StandAlone &&
+	     state.disk == Diskless) {
+		printf("Unconfigured\n");
+	} else {
+		printf("%s\n",conns_to_name(state.conn));
+	}
 	return 0;
 }
 
@@ -1099,7 +1109,12 @@
 {
 	drbd_state_t state;
 	consume_tag_int(T_state_i,rtl,(int*)&state.i);
-	printf("%s/%s\n",disks_to_name(state.disk),disks_to_name(state.pdsk));
+	if ( state.conn == StandAlone &&
+	     state.disk == Diskless) {
+		printf("Unconfigured\n");
+	} else {
+		printf("%s/%s\n",disks_to_name(state.disk),disks_to_name(state.pdsk));
+	}
 	return 0;
 }
 



More information about the drbd-cvs mailing list