vswitch: Pass --monitor to secchan processes, to allow monitoring them.
authorBen Pfaff <blp@nicira.com>
Fri, 19 Dec 2008 23:10:18 +0000 (15:10 -0800)
committerBen Pfaff <blp@nicira.com>
Sat, 20 Dec 2008 00:32:18 +0000 (16:32 -0800)
vswitchd/bridge.c

index 0e88885e7d115df849ce53c779ac0c17ac11fa7e..94baf3959c8b899d9e5b8283cbb23642605d43ae 100644 (file)
 #include <openflow/openflow-netlink.h>
 #include <signal.h>
 #include <stdlib.h>
+#include <sys/stat.h>
 #include <sys/socket.h>
 #include <unistd.h>
 #include "cfg.h"
+#include "dirs.h"
 #include "dpif.h"
 #include "flow.h"
 #include "list.h"
@@ -295,6 +297,7 @@ static struct bridge *
 bridge_create(const char *name)
 {
     struct bridge *br;
+    struct stat s;
     struct svec argv;
     char *dp_name;
     int sockets[2];
@@ -352,6 +355,11 @@ bridge_create(const char *name)
     svec_add(&argv, "--fail=closed");
     svec_add(&argv, "--max-backoff=1");
     svec_add(&argv, "--no-stp");
+    if (!stat(ofp_rundir, &s)) {
+        svec_add_nocopy(&argv,
+                        xasprintf("--monitor=punix:%s/secchan%d.monitor",
+                                  ofp_rundir, br->dp_idx));
+    }
     svec_add_nocopy(&argv,
                     xasprintf("-vPATTERN:console:%s|secchan(nl:%d)|%s",
                               "%d{%b %d %H:%M:%S}",