const char *db_dir;
int torture;
const char *logfile;
+ const char *events;
} ctdb_cmdline = {
.nlist = NULL,
.transport = "tcp",
.self_connect = 0,
.db_dir = NULL,
.torture = 0,
- .logfile = NULL
+ .logfile = NULL,
};
+enum {OPT_EVENTSYSTEM=1};
+
+static void ctdb_cmdline_callback(poptContext con,
+ enum poptCallbackReason reason,
+ const struct poptOption *opt,
+ const char *arg, const void *data)
+{
+ switch (opt->val) {
+ case OPT_EVENTSYSTEM:
+ event_set_default_backend(arg);
+ break;
+ }
+}
+
struct poptOption popt_ctdb_cmdline[] = {
+ { NULL, 0, POPT_ARG_CALLBACK, (void *)ctdb_cmdline_callback },
{ "nlist", 0, POPT_ARG_STRING, &ctdb_cmdline.nlist, 0, "node list file", "filename" },
{ "listen", 0, POPT_ARG_STRING, &ctdb_cmdline.myaddress, 0, "address to listen on", "address" },
{ "socket", 0, POPT_ARG_STRING, &ctdb_cmdline.socketname, 0, "local socket name", "filename" },
{ "dbdir", 0, POPT_ARG_STRING, &ctdb_cmdline.db_dir, 0, "directory for the tdb files", NULL },
{ "torture", 0, POPT_ARG_NONE, &ctdb_cmdline.torture, 0, "enable nastiness in library", NULL },
{ "logfile", 0, POPT_ARG_STRING, &ctdb_cmdline.logfile, 0, "log file location", "filename" },
+ { "events", 0, POPT_ARG_STRING, NULL, OPT_EVENTSYSTEM, "event system", NULL },
{ NULL }
};
XXX generation==0 (==invalid) and let the recovery tool populate this
XXX table for the daemons.
*/
- ctdb->vnn_map = talloc_zero(ctdb, struct ctdb_vnn_map);
+ ctdb->vnn_map = talloc_zero_size(ctdb, offsetof(struct ctdb_vnn_map, map) + 4*ctdb->num_nodes);
if (ctdb->vnn_map == NULL) {
DEBUG(0,(__location__ " Unable to allocate vnn_map structure\n"));
exit(1);
}
ctdb->vnn_map->generation = 1;
ctdb->vnn_map->size = ctdb->num_nodes;
- ctdb->vnn_map->map = talloc_array(ctdb->vnn_map, uint32_t, ctdb->vnn_map->size);
- if (ctdb->vnn_map->map == NULL) {
- DEBUG(0,(__location__ " Unable to allocate vnn_map->map structure\n"));
- exit(1);
- }
for(i=0;i<ctdb->vnn_map->size;i++){
ctdb->vnn_map->map[i] = i%ctdb->num_nodes;
}