[ovs-dev] [PATCH 3/4] brcompatd: Add appctl "reload" command
Justin Pettit
jpettit at nicira.com
Fri Sep 11 16:34:49 UTC 2009
It would be useful to be able to tell ovs-brcompatd to reopen its log
file. Call this "brcompatd/reload" to match the mechanism to have
ovs-vswitchd do the same thing.
---
vswitchd/ovs-brcompatd.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/vswitchd/ovs-brcompatd.c b/vswitchd/ovs-brcompatd.c
index 50ed632..ef99094 100644
--- a/vswitchd/ovs-brcompatd.c
+++ b/vswitchd/ovs-brcompatd.c
@@ -72,6 +72,7 @@ enum bmc_action {
static void parse_options(int argc, char *argv[]);
static void usage(void) NO_RETURN;
+static void reload(struct unixctl_conn *, const char *args);
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 60);
@@ -1096,6 +1097,7 @@ main(int argc, char *argv[])
if (retval) {
ovs_fatal(retval, "could not listen for vlog connections");
}
+ unixctl_command_register("brcompatd/reload", reload);
if (brc_open(&brc_sock)) {
ovs_fatal(0, "could not open brcompat socket. Check "
@@ -1144,6 +1146,13 @@ main(int argc, char *argv[])
}
static void
+reload(struct unixctl_conn *conn, const char *args UNUSED)
+{
+ vlog_reopen_log_file();
+ unixctl_command_reply(conn, 202, NULL);
+}
+
+static void
validate_appctl_command(void)
{
const char *p;
--
1.6.4
More information about the dev
mailing list