]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
report number of frozen/thawed nodes
authorAndrew Tridgell <tridge@samba.org>
Sat, 12 May 2007 05:44:56 +0000 (15:44 +1000)
committerAndrew Tridgell <tridge@samba.org>
Sat, 12 May 2007 05:44:56 +0000 (15:44 +1000)
(This used to be ctdb commit 997720bc0e15d882aefed3464fe285674beed691)

ctdb/tools/ctdb_control.c

index 6db4c8480d2a0afdf2903cc0683586ceccefe4b5..5c24bdb70a4b1913bf840c6b28cd758ffb1d9a17 100644 (file)
@@ -806,7 +806,7 @@ static int control_debug(struct ctdb_context *ctdb, int argc, const char **argv)
  */
 static int control_freeze(struct ctdb_context *ctdb, int argc, const char **argv)
 {
-       int ret=0;
+       int ret=0, count=0;
        uint32_t vnn, i;
        uint32_t *nodes;
        uint32_t num_nodes;
@@ -830,9 +830,12 @@ static int control_freeze(struct ctdb_context *ctdb, int argc, const char **argv
                int res = ctdb_ctrl_freeze(ctdb, timeval_current_ofs(5, 0), nodes[i]);
                if (res != 0) {
                        printf("Warning: Unable to freeze node %u\n", nodes[i]);
+               } else {
+                       count++;
                }
                ret |= res;
        }
+       printf("Froze %u nodes\n", count);
        talloc_free(nodes);
        return 0;
 }
@@ -842,7 +845,7 @@ static int control_freeze(struct ctdb_context *ctdb, int argc, const char **argv
  */
 static int control_thaw(struct ctdb_context *ctdb, int argc, const char **argv)
 {
-       int ret=0;
+       int ret=0, count=0;
        uint32_t vnn, i;
        uint32_t *nodes;
        uint32_t num_nodes;
@@ -866,9 +869,12 @@ static int control_thaw(struct ctdb_context *ctdb, int argc, const char **argv)
                int res = ctdb_ctrl_thaw(ctdb, timeval_current_ofs(5, 0), nodes[i]);
                if (res != 0) {
                        printf("Warning: Unable to thaw node %u\n", nodes[i]);
+               } else {
+                       count++;
                }
                ret |= res;
        }
+       printf("Thawed %u nodes\n", count);
        talloc_free(nodes);
        return 0;
 }