* config_commit - commit a configuration
* @c: new configuration
* @type: type of reconfiguration (RECONFIG_SOFT or RECONFIG_HARD)
- * @timeout: timeout for undo (or 0 for no timeout)
+ * @timeout: timeout for undo (in seconds; or 0 for no timeout)
*
* When a configuration is parsed and prepared for use, the
* config_commit() function starts the process of reconfiguration.
* are accepted.
*/
int
-config_commit(struct config *c, int type, int timeout)
+config_commit(struct config *c, int type, uint timeout)
{
if (shutting_down)
{
}
undo_available = 1;
- if (timeout > 0)
- tm_start(config_timer, timeout);
+ if (timeout)
+ tm2_start(config_timer, timeout S);
else
- tm_stop(config_timer);
+ tm2_stop(config_timer);
if (configuring)
{
struct timeformat tf_proto; /* Time format for 'show protocol' */
struct timeformat tf_log; /* Time format for the logfile */
struct timeformat tf_base; /* Time format for other purposes */
- u32 gr_wait; /* Graceful restart wait timeout */
+ u32 gr_wait; /* Graceful restart wait timeout (sec) */
int cli_debug; /* Tracing of CLI connections and commands */
int latency_debug; /* I/O loop tracks duration of each event */
int config_parse(struct config *);
int cli_parse(struct config *);
void config_free(struct config *);
-int config_commit(struct config *, int type, int timeout);
+int config_commit(struct config *, int type, uint timeout);
int config_confirm(void);
int config_undo(void);
void config_init(void);
}
graceful_restart_state = GRS_ACTIVE;
- gr_wait_timer = tm_new(proto_pool);
- gr_wait_timer->hook = graceful_restart_done;
- tm_start(gr_wait_timer, config->gr_wait);
+ gr_wait_timer = tm2_new_init(proto_pool, graceful_restart_done, NULL, 0, 0);
+ tm2_start(gr_wait_timer, config->gr_wait S);
}
/**
graceful_restart_locks--;
if ((graceful_restart_state == GRS_ACTIVE) && !graceful_restart_locks)
- tm_start(gr_wait_timer, 0);
+ tm2_start(gr_wait_timer, 0);
}
p->down_sched = restart ? PDS_RESTART : PDS_DISABLE;
p->down_code = code;
- tm_start_max(proto_shutdown_timer, restart ? 2 : 0);
+ tm2_start_max(proto_shutdown_timer, restart ? 250 MS : 0);
}
}
void
-cmd_reconfig(char *name, int type, int timeout)
+cmd_reconfig(char *name, int type, uint timeout)
{
if (cli_access_restricted())
return;
void async_dump(void);
void async_shutdown(void);
void cmd_check_config(char *name);
-void cmd_reconfig(char *name, int type, int timeout);
+void cmd_reconfig(char *name, int type, uint timeout);
void cmd_reconfig_confirm(void);
void cmd_reconfig_undo(void);
void cmd_shutdown(void);