Merge "citrix" branch into "master".
authorBen Pfaff <blp@nicira.com>
Thu, 25 Mar 2010 19:30:05 +0000 (12:30 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 25 Mar 2010 19:30:05 +0000 (12:30 -0700)
This merge is long overdue, simply because I forgot that there were
outstanding changes on "citrix" that had not yet been merged.

The important fix here is the addition of mlockall.  This fixes some
bugs seen under stressful conditions in XenServer.

1  2 
ChangeLog
configure.ac
vswitchd/ovs-vswitchd.8.in
vswitchd/ovs-vswitchd.c
xenserver/etc_init.d_vswitch
xenserver/usr_share_vswitch_scripts_sysconfig.template

diff --combined ChangeLog
+++ b/ChangeLog
@@@ -1,17 -1,7 +1,22 @@@
 +v0.99.2 - 18 Feb 2010
 +---------------------
 +    - Bug fixes
 +
 +v0.99.1 - 25 Jan 2010
 +---------------------
 +    - Add support for sFlow(R)
 +    - Make headers compatible with C++
 +    - Bug fixes
 +
 +v0.99.0 - 14 Jan 2010
 +---------------------
 +    - User-space forwarding engine
 +    - Bug fixes
++      
+ v0.90.7 - 29 Nov 2009
+ ---------------------
+     - Add support for NetFlow active timeouts
+     - Bug fixes
  
  v0.90.6 - 6 Oct 2009
  --------------------
diff --combined configure.ac
@@@ -1,4 -1,4 +1,4 @@@
 -# Copyright (c) 2008, 2009 Nicira Networks
 +# Copyright (c) 2008, 2009, 2010 Nicira Networks
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
 -AC_PREREQ(2.60)
 -AC_INIT(openvswitch, 0.90.7, ovs-bugs@openvswitch.org)
 +AC_PREREQ(2.64)
 +AC_INIT(openvswitch, 0.99.2, ovs-bugs@openvswitch.org)
  NX_BUILDNR
  AC_CONFIG_SRCDIR([datapath/datapath.c])
  AC_CONFIG_MACRO_DIR([m4])
  AC_CONFIG_AUX_DIR([build-aux])
  AC_CONFIG_HEADERS([config.h])
 +AC_CONFIG_TESTDIR([tests])
  AM_INIT_AUTOMAKE
  
  AC_PROG_CC
@@@ -38,9 -37,6 +38,9 @@@ AC_USE_SYSTEM_EXTENSION
  AC_C_BIGENDIAN
  AC_SYS_LARGEFILE
  
 +AC_SEARCH_LIBS([pow], [m])
 +
 +OVS_CHECK_COVERAGE
  OVS_CHECK_NDEBUG
  OVS_CHECK_NETLINK
  OVS_CHECK_OPENSSL
@@@ -48,11 -44,9 +48,12 @@@ OVS_CHECK_LOGDI
  OVS_CHECK_CURSES
  OVS_CHECK_LINUX_VT_H
  OVS_CHECK_PCRE
 +OVS_CHECK_PYTHON
  OVS_CHECK_IF_PACKET
  OVS_CHECK_STRTOK_R
 +AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec, struct stat.st_mtimensec],
 +  [], [], [[#include <sys/stat.h>]])
+ AC_CHECK_FUNCS([mlockall])
  
  OVS_CHECK_PKIDIR
  OVS_CHECK_RUNDIR
@@@ -60,6 -54,7 +61,6 @@@ OVS_CHECK_MALLOC_HOOK
  OVS_CHECK_VALGRIND
  OVS_CHECK_TTY_LOCK_DIR
  OVS_CHECK_SOCKET_LIBS
 -OVS_CHECK_FAULT_LIBS
  
  AC_CHECK_FUNCS([strsignal])
  
@@@ -78,20 -73,15 +79,20 @@@ OVS_ENABLE_OPTION([-Wold-style-definiti
  OVS_ENABLE_OPTION([-Wmissing-prototypes])
  OVS_ENABLE_OPTION([-Wmissing-field-initializers])
  OVS_ENABLE_OPTION([-Wno-override-init])
 +OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED])
  
  AC_ARG_VAR(KARCH, [Kernel Architecture String])
  AC_SUBST(KARCH)
 -OVS_CHECK_LINUX(l26, 2.6, KSRC26, L26_ENABLED)
 +OVS_CHECK_LINUX26
  
  AC_CONFIG_FILES([Makefile 
  datapath/Makefile 
  datapath/linux-2.6/Kbuild
  datapath/linux-2.6/Makefile
 -datapath/linux-2.6/Makefile.main])
 +datapath/linux-2.6/Makefile.main
 +tests/atlocal])
 +
 +dnl This makes sure that include/openflow gets created in the build directory.
 +AC_CONFIG_COMMANDS([include/openflow/openflow.h.stamp])
  
  AC_OUTPUT
@@@ -4,36 -4,32 +4,36 @@@
  .  ns
  .  IP "\\$1"
  ..
 -.TH ovs\-vswitchd 8 "March 2009" "Open vSwitch" "Open vSwitch Manual"
 +.TH ovs\-vswitchd 8 "June 2009" "Open vSwitch" "Open vSwitch Manual"
  .ds PN ovs\-vswitchd
  .
  .SH NAME
 -ovs\-vswitchd \- virtual switch daemon
 +ovs\-vswitchd \- Open vSwitch daemon
  .
  .SH SYNOPSIS
  .B ovs\-vswitchd
 -\fIconfig\fR
 +\fIdatabase\fR
  .
  .SH DESCRIPTION
 -A daemon that manages and controls any number of virtual switches on
 -the local machine.
 +A daemon that manages and controls any number of Open vSwitch switches 
 +on the local machine.
  .PP
 -The mandatory \fIconfig\fR argument specifies a configuration file.
 -For a description of \fBovs\-vswitchd\fR configuration syntax, see
 -\fBovs\-vswitchd.conf\fR(5).
 +The mandatory \fIdatabase\fR argument specifies the
 +\fBovsdb\-server\fR from which \fBovs\-vswitchd\fR's configuration
 +should be retrieved.  It takes one of the following forms:
 +.so ovsdb/remote-active.man
  .PP
 -At startup or upon receipt of a \fBSIGHUP\fR signal, \fBovs\-vswitchd\fR
 -reads the configuration file.  It sets up Open vSwitch datapaths and then 
 -operates switching across each bridge described in its configuration 
 -files.  If a logfile was specified on the command line it will also 
 -be opened or reopened.
 +\fBovs\-vswitchd\fR retrieves its configuration from \fIdatabase\fR at
 +startup.  It sets up Open vSwitch datapaths and then operates
 +switching across each bridge described in its configuration files.  As
 +the database changes, \fBovs\-vswitchd\fR automatically updates its
 +configuration to match.
  .PP
 -\fBovs\-vswitchd\fR virtual switches may be configured with any of the
 -following features:
 +Upon receipt of a SIGHUP signal, \fBovs\-vswitchd\fR reopens its log
 +file, if one was specified on the command line.
 +.PP
 +\fBovs\-vswitchd\fR switches may be configured with any of the following 
 +features:
  .
  .IP \(bu
  L2 switching with MAC learning.
@@@ -52,14 -48,11 +52,14 @@@ Port mirroring, with optional VLAN tagg
  NetFlow v5 flow logging.
  .
  .IP \(bu
 +sFlow(R) monitoring.
 +.
 +.IP \(bu
  Connectivity to an external OpenFlow controller, such as NOX.
  .
  .PP
  Only a single instance of \fBovs\-vswitchd\fR is intended to run at a time.
 -A single \fBovs\-vswitchd\fR can manage any number of virtual switches, up
 +A single \fBovs\-vswitchd\fR can manage any number of switch instances, up
  to the maximum number of supported Open vSwitch datapaths.
  .PP
  \fBovs\-vswitchd\fR does all the necessary management of Open vSwitch datapaths
@@@ -69,11 -62,22 +69,22 @@@ to modify datapaths when \fBovs\-vswitc
  its operation.  (\fBovs\-dpctl\fR may still be useful for diagnostics.)
  .PP
  An Open vSwitch datapath kernel module must be loaded for \fBovs\-vswitchd\fR
 -to be useful.  Please refer to the \fBINSTALL\fR file included in the
 +to be useful.  Please refer to the \fBINSTALL.Linux\fR file included in the
  Open vSwitch distribution for instructions on how to build and load
  the Open vSwitch kernel module.
  .PP
  .SH OPTIONS
+ .IP "\fB--mlockall\fR"
+ Causes \fBovs\-vswitchd\fR to call the \fBmlockall()\fR function, to
+ attempt to lock all of its process memory into physical RAM,
+ preventing the kernel from paging any of its memory to disk.  This
+ helps to avoid networking interruptions due to system memory pressure.
+ .IP
+ Some systems do not support \fBmlockall()\fR at all, and other systems
+ only allow privileged users, such as the superuser, to use it.
+ \fBovs\-vswitchd\fR emits a log message if \fBmlockall()\fR is
+ unavailable or unsuccessful.
+ .
  .IP "\fB--fake-proc-net\fR"
  Causes \fBovs\-vswitchd\fR to simulate some files in \fB/proc/net/vlan\fR
  and \fB/proc/net/bonding\fR that some legacy software expects to
@@@ -82,9 -86,6 +93,9 @@@ actually in use.  It requires the \fBbr
  to be loaded.
  .
  .so lib/daemon.man
 +.SS "Public Key Infrastructure Options"
 +.so lib/ssl.man
 +.so lib/ssl-bootstrap.man
  .so lib/vlog.man
  .so lib/common.man
  .so lib/leak-checker.man
  \fBovs\-appctl\fR(8) can send commands to a running
  \fBovs\-vswitchd\fR process.  The currently supported commands are
  described below.  The command descriptions assume an understanding of
 -how to configure Open vSwitch, as described in
 -\fBovs-vswitchd.conf\fR(5).
 -.SS "OVS\-VSWITCHD COMMANDS"
 -These commands manage the \fBovs-vswitchd\fR process.
 -.IP "\fBvswitchd/reload\fR"
 -Reloads the \fBovs\-vswitchd\fR configuration file, as if a
 -\fBSIGHUP\fR signal were received.  The command completes only after
 -reloading is finished, in particular after all datapaths have been
 -created and destroyed and ports added and removed as specified by the
 -new configuration.
 +how to configure Open vSwitch.
  .SS "BRIDGE COMMANDS"
  These commands manage bridges.
  .IP "\fBfdb/show\fR \fIbridge\fR"
@@@ -149,12 -159,10 +160,12 @@@ updelay (or downdelay)
  .IP
  This setting is not permanent: it persists only until the carrier
  status of \fIslave\fR changes.
 +.IP "\fBbond/hash\fR \fImac\fR"
 +Returns the hash value which would be used for \fImac\fR.
  .
  .so lib/vlog-unixctl.man
  .SH "SEE ALSO"
  .BR ovs\-appctl (8),
 -.BR ovs\-vswitchd.conf (5),
  .BR ovs\-brcompatd (8),
 -\fBINSTALL\fR in the Open vSwitch distribution.
 +.BR ovsdb\-server (1),
 +\fBINSTALL.Linux\fR in the Open vSwitch distribution.
diff --combined vswitchd/ovs-vswitchd.c
@@@ -1,4 -1,4 +1,4 @@@
 -/* Copyright (c) 2008, 2009 Nicira Networks
 +/* Copyright (c) 2008, 2009, 2010 Nicira Networks
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
  #include <signal.h>
  #include <stdlib.h>
  #include <string.h>
+ #ifdef HAVE_MLOCKALL
+ #include <sys/mman.h>
+ #endif
  
  #include "bridge.h"
 -#include "cfg.h"
  #include "command-line.h"
  #include "compiler.h"
  #include "daemon.h"
 -#include "fault.h"
 +#include "dpif.h"
  #include "leak-checker.h"
 -#include "mgmt.h"
 -#include "ovs-vswitchd.h"
 +#include "netdev.h"
 +#include "ovsdb-idl.h"
  #include "poll-loop.h"
 -#include "port.h"
  #include "proc-net-compat.h"
  #include "process.h"
  #include "signals.h"
 +#include "stream-ssl.h"
 +#include "stream.h"
  #include "svec.h"
  #include "timeval.h"
  #include "unixctl.h"
  #include "util.h"
 -#include "vconn-ssl.h"
  #include "vconn.h"
 +#include "vswitchd/vswitch-idl.h"
  
  #include "vlog.h"
  #define THIS_MODULE VLM_vswitchd
  
 -static void parse_options(int argc, char *argv[]);
 +static const char *parse_options(int argc, char *argv[]);
  static void usage(void) NO_RETURN;
 -static void reload(struct unixctl_conn *, const char *args);
 -
 -static bool need_reconfigure;
 -static struct unixctl_conn **conns;
 -static size_t n_conns;
  
  int
  main(int argc, char *argv[])
  {
      struct unixctl_server *unixctl;
      struct signal *sighup;
 +    struct ovsdb_idl *idl;
 +    const char *remote;
 +    bool need_reconfigure;
 +    bool inited;
 +    unsigned int idl_seqno;
      int retval;
  
 +    proctitle_init(argc, argv);
      set_program_name(argv[0]);
 -    register_fault_handlers();
      time_init();
      vlog_init();
 -    parse_options(argc, argv);
 +    remote = parse_options(argc, argv);
      signal(SIGPIPE, SIG_IGN);
      sighup = signal_register(SIGHUP);
      process_init();
 +    ovsrec_init();
  
      die_if_already_running();
 -    daemonize();
 +    daemonize_start();
  
      retval = unixctl_server_create(NULL, &unixctl);
      if (retval) {
 -        ovs_fatal(retval, "could not listen for control connections");
 +        exit(EXIT_FAILURE);
      }
 -    unixctl_command_register("vswitchd/reload", reload);
  
 -    retval = cfg_read();
 -    if (retval) {
 -        ovs_fatal(retval, "could not read config file");
 -    }
 -    mgmt_init();
 -    bridge_init();
 -    port_init();
 -    mgmt_reconfigure();
 +    daemonize_complete();
 +
 +    idl = ovsdb_idl_create(remote, &ovsrec_idl_class);
 +    idl_seqno = ovsdb_idl_get_seqno(idl);
  
      need_reconfigure = false;
 +    inited = false;
      for (;;) {
 -        if (need_reconfigure || signal_poll(sighup)) {
 -            need_reconfigure = false;
 +        if (signal_poll(sighup)) {
              vlog_reopen_log_file();
 -            reconfigure();
          }
 -        if (mgmt_run()) {
 +        if (inited && bridge_run()) {
              need_reconfigure = true;
          }
 -        if (bridge_run()) {
 +        ovsdb_idl_run(idl);
 +        if (idl_seqno != ovsdb_idl_get_seqno(idl)) {
 +            idl_seqno = ovsdb_idl_get_seqno(idl);
              need_reconfigure = true;
          }
 -        unixctl_server_run(unixctl);
 -
          if (need_reconfigure) {
 -            poll_immediate_wake();
 +            const struct ovsrec_open_vswitch *cfg;
 +
 +            need_reconfigure = false;
 +            cfg = ovsrec_open_vswitch_first(idl);
 +            if (cfg) {
 +                if (inited) {
 +                    bridge_reconfigure(cfg);
 +                } else {
 +                    bridge_init(cfg);
 +                    inited = true;
 +                }
 +            }
          }
 +        unixctl_server_run(unixctl);
 +        dp_run();
 +        netdev_run();
 +
          signal_wait(sighup);
 -        mgmt_wait();
 -        bridge_wait();
 +        if (inited) {
 +            bridge_wait();
 +        }
 +        ovsdb_idl_wait(idl);
          unixctl_server_wait(unixctl);
 +        dp_wait();
 +        netdev_wait();
          poll_block();
      }
  
      return 0;
  }
  
 -static void
 -reload(struct unixctl_conn *conn, const char *args UNUSED)
 -{
 -    need_reconfigure = true;
 -    conns = xrealloc(conns, sizeof *conns * (n_conns + 1));
 -    conns[n_conns++] = conn;
 -}
 -
 -void
 -reconfigure(void)
 -{
 -    size_t i;
 -
 -    cfg_read();
 -    bridge_reconfigure();
 -    mgmt_reconfigure();
 -    port_reconfigure();
 -
 -    for (i = 0; i < n_conns; i++) {
 -        unixctl_command_reply(conns[i], 202, NULL);
 -    }
 -    free(conns);
 -    conns = NULL;
 -    n_conns = 0;
 -}
 -
 -static void
 +static const char *
  parse_options(int argc, char *argv[])
  {
      enum {
          OPT_PEER_CA_CERT = UCHAR_MAX + 1,
+         OPT_MLOCKALL,
          OPT_FAKE_PROC_NET,
          VLOG_OPTION_ENUMS,
 -        LEAK_CHECKER_OPTION_ENUMS
 +        LEAK_CHECKER_OPTION_ENUMS,
 +        OPT_BOOTSTRAP_CA_CERT
      };
      static struct option long_options[] = {
          {"help",        no_argument, 0, 'h'},
          {"version",     no_argument, 0, 'V'},
+         {"mlockall",    no_argument, 0, OPT_MLOCKALL},
          {"fake-proc-net", no_argument, 0, OPT_FAKE_PROC_NET},
          DAEMON_LONG_OPTIONS,
          VLOG_LONG_OPTIONS,
          LEAK_CHECKER_LONG_OPTIONS,
  #ifdef HAVE_OPENSSL
 -        VCONN_SSL_LONG_OPTIONS
 +        STREAM_SSL_LONG_OPTIONS
          {"peer-ca-cert", required_argument, 0, OPT_PEER_CA_CERT},
 +        {"bootstrap-ca-cert", required_argument, 0, OPT_BOOTSTRAP_CA_CERT},
  #endif
          {0, 0, 0, 0},
      };
      char *short_options = long_options_to_short_options(long_options);
 -    const char *config_file;
      int error;
  
      for (;;) {
              OVS_PRINT_VERSION(OFP_VERSION, OFP_VERSION);
              exit(EXIT_SUCCESS);
  
+         case OPT_MLOCKALL:
+ #ifdef HAVE_MLOCKALL
+             if (mlockall(MCL_CURRENT | MCL_FUTURE)) {
+                 VLOG_ERR("mlockall failed: %s", strerror(errno));
+             }
+ #else
+             VLOG_ERR("mlockall not supported on this system");
+ #endif
+             break;
          case OPT_FAKE_PROC_NET:
              error = proc_net_compat_init();
              if (error) {
  
          VLOG_OPTION_HANDLERS
          DAEMON_OPTION_HANDLERS
 -        VCONN_SSL_OPTION_HANDLERS
          LEAK_CHECKER_OPTION_HANDLERS
  
  #ifdef HAVE_OPENSSL
 +        STREAM_SSL_OPTION_HANDLERS
 +
          case OPT_PEER_CA_CERT:
 -            vconn_ssl_set_peer_ca_cert_file(optarg);
 +            stream_ssl_set_peer_ca_cert_file(optarg);
 +            break;
 +
 +        case OPT_BOOTSTRAP_CA_CERT:
 +            stream_ssl_set_ca_cert_file(optarg, true);
              break;
  #endif
  
      argv += optind;
  
      if (argc != 1) {
 -        ovs_fatal(0, "config file is only non-option argument; "
 +        ovs_fatal(0, "database socket is only non-option argument; "
                  "use --help for usage");
      }
  
 -    cfg_init();
 -    config_file = argv[0];
 -    error = cfg_set_file(config_file);
 -    if (error) {
 -       ovs_fatal(error, "failed to add configuration file \"%s\"", 
 -                config_file);
 -    }
 +    return argv[0];
  }
  
  static void
  usage(void)
  {
 -    printf("%s: virtual switch daemon\n"
 -           "usage: %s [OPTIONS] CONFIG\n"
 -           "CONFIG is a configuration file in ovs-vswitchd.conf(5) format.\n",
 +    printf("%s: Open vSwitch daemon\n"
 +           "usage: %s [OPTIONS] DATABASE\n"
 +           "where DATABASE is a socket on which ovsdb-server is listening.\n",
             program_name, program_name);
 +    stream_usage("DATABASE", true, false, true);
      daemon_usage();
      vlog_usage();
      printf("\nLegacy compatibility options:\n"
@@@ -5,7 -5,7 +5,7 @@@
  # chkconfig: 2345 09 91
  # description: Manage vswitch kernel modules and user-space daemon
  
 -# Copyright (C) 2009 Nicira Networks, Inc.
 +# Copyright (C) 2009, 2010 Nicira Networks, Inc.
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  test -e /etc/sysconfig/vswitch && . /etc/sysconfig/vswitch
  
  # General config variables in /etc/sysconfig/vswitch
 -VSWITCH_BASE="${VSWITCH_BASE:-/root/vswitch}"
 -ENABLE_BRCOMPAT="${ENABLE_BRCOMPAT:-y}"
 -ENABLE_FAKE_PROC_NET="${ENABLE_FAKE_PROC_NET:-y}"
 -FORCE_COREFILES="${FORCE_COREFILES:-y}"
 +: ${ENABLE_BRCOMPAT:=y}
 +: ${ENABLE_FAKE_PROC_NET:=y}
 +: ${ENABLE_MONITOR:=y}
 +: ${FORCE_COREFILES:=y}
 +
 +# Config variables specific to ovsdb-server
 +: ${OVSDB_SERVER_REMOTES:=punix:/var/run/ovsdb-server db:Open_vSwitch,managers}
 +: ${OVSDB_SERVER_DB:=/etc/ovs-vswitchd.conf.db}
 +: ${OVSDB_SERVER_PIDFILE:=/var/run/ovsdb-server.pid}
 +: ${OVSDB_SERVER_RUN_DIR:=/var/xen/vswitch}
 +: ${OVSDB_SERVER_PRIORITY:=-10}
 +: ${OVSDB_SERVER_LOGFILE:=/var/log/ovsdb-server.log}
 +: ${OVSDB_SERVER_FILE_LOGLEVEL:=INFO}
 +: ${OVSDB_SERVER_SYSLOG_LOGLEVEL:=ERR}
 +: ${OVSDB_SERVER_MEMLEAK_LOGFILE:=}
 +: ${OVSDB_SERVER_STRACE_LOG:=}
 +: ${OVSDB_SERVER_STRACE_OPT:=}
 +: ${OVSDB_SERVER_VALGRIND_LOG:=}
 +: ${OVSDB_SERVER_VALGRIND_OPT:=}
  
  # Config variables specific to ovs-vswitchd
 -VSWITCHD_CONF="${VSWITCHD_CONF:-/etc/ovs-vswitchd.conf}"
 -VSWITCHD_PIDFILE="${VSWITCHD_PIDFILE:-/var/run/ovs-vswitchd.pid}"
 -VSWITCHD_RUN_DIR="${VSWITCHD_RUN_DIR:-/var/xen/vswitch}"
 -VSWITCHD_PRIORITY="${VSWITCHD_PRIORITY:--10}"
 -VSWITCHD_MLOCKALL="${VSWITCHD_MLOCKALL:-yes}"
 -VSWITCHD_LOGFILE="${VSWITCHD_LOGFILE:-/var/log/ovs-vswitchd.log}"
 -VSWITCHD_FILE_LOGLEVEL="${VSWITCHD_FILE_LOGLEVEL:-INFO}"
 -VSWITCHD_SYSLOG_LOGLEVEL="${VSWITCHD_SYSLOG_LOGLEVEL:-ERR}"
 -VSWITCHD_MEMLEAK_LOGFILE="${VSWITCHD_MEMLEAK_LOGFILE:-}"
 -VSWITCHD_STRACE_LOG="${VSWITCHD_STRACE_LOG:-}"
 -VSWITCHD_STRACE_OPT="${VSWITCHD_STRACE_OPT:-}"
 -VSWITCHD_VALGRIND_LOG="${VSWITCHD_VALGRIND_LOG:-}"
 -VSWITCHD_VALGRIND_OPT="${VSWITCHD_VALGRIND_OPT:-}"
 +: ${VSWITCHD_OVSDB_SERVER:=unix:/var/run/ovsdb-server}
 +: ${VSWITCHD_OVSDB_SCHEMA:=/usr/share/vswitch/vswitch.ovsschema}
 +: ${VSWITCHD_PIDFILE:=/var/run/ovs-vswitchd.pid}
 +: ${VSWITCHD_RUN_DIR:=/var/xen/vswitch}
 +: ${VSWITCHD_PRIORITY:=-10}
++: ${VSWITCHD_MLOCKALL:=yes}
 +: ${VSWITCHD_LOGFILE:=/var/log/ovs-vswitchd.log}
 +: ${VSWITCHD_FILE_LOGLEVEL:=INFO}
 +: ${VSWITCHD_SYSLOG_LOGLEVEL:=ERR}
 +: ${VSWITCHD_MEMLEAK_LOGFILE:=}
 +: ${VSWITCHD_STRACE_LOG:=}
 +: ${VSWITCHD_STRACE_OPT:=}
 +: ${VSWITCHD_VALGRIND_LOG:=}
 +: ${VSWITCHD_VALGRIND_OPT:=}
  
  # Config variables specific to ovs-brcompatd
 -BRCOMPATD_PIDFILE="${BRCOMPATD_PIDFILE:-/var/run/ovs-brcompatd.pid}"
 -BRCOMPATD_RUN_DIR="${BRCOMPATD_RUN_DIR:-/var/xen/vswitch}"
 -BRCOMPATD_PRIORITY="${BRCOMPATD_PRIORITY:--10}"
 -BRCOMPATD_LOGFILE="${BRCOMPATD_LOGFILE:-/var/log/ovs-brcompatd.log}"
 -BRCOMPATD_FILE_LOGLEVEL="${BRCOMPATD_FILE_LOGLEVEL:-INFO}"
 -BRCOMPATD_SYSLOG_LOGLEVEL="${BRCOMPATD_SYSLOG_LOGLEVEL:-ERR}"
 -BRCOMPATD_MEMLEAK_LOGFILE="${BRCOMPATD_MEMLEAK_LOGFILE:-}"
 -BRCOMPATD_STRACE_LOG="${BRCOMPATD_STRACE_LOG:-}"
 -BRCOMPATD_STRACE_OPT="${BRCOMPATD_STRACE_OPT:-}"
 -BRCOMPATD_VALGRIND_LOG="${BRCOMPATD_VALGRIND_LOG:-}"
 -BRCOMPATD_VALGRIND_OPT="${BRCOMPATD_VALGRIND_OPT:-}"
 -
 -
 -
 +: ${BRCOMPATD_PIDFILE:=/var/run/ovs-brcompatd.pid}
 +: ${BRCOMPATD_RUN_DIR:=/var/xen/vswitch}
 +: ${BRCOMPATD_PRIORITY:=-10}
 +: ${BRCOMPATD_LOGFILE:=/var/log/ovs-brcompatd.log}
 +: ${BRCOMPATD_FILE_LOGLEVEL:=INFO}
 +: ${BRCOMPATD_SYSLOG_LOGLEVEL:=ERR}
 +: ${BRCOMPATD_MEMLEAK_LOGFILE:=}
 +: ${BRCOMPATD_STRACE_LOG:=}
 +: ${BRCOMPATD_STRACE_OPT:=}
 +: ${BRCOMPATD_VALGRIND_LOG:=}
 +: ${BRCOMPATD_VALGRIND_OPT:=}
  
  # Full paths to executables & modules
 -vswitchd="$VSWITCH_BASE/sbin/ovs-vswitchd"
 -brcompatd="$VSWITCH_BASE/sbin/ovs-brcompatd"
 -dpctl="$VSWITCH_BASE/bin/ovs-dpctl"
 -appctl="$VSWITCH_BASE/bin/ovs-appctl"
 -ofctl="$VSWITCH_BASE/bin/ovs-ofctl"
 -
 +ovsdb_server="/usr/sbin/ovsdb-server"
 +ovsdb_tool="/usr/bin/ovsdb-tool"
 +vswitchd="/usr/sbin/ovs-vswitchd"
 +brcompatd="/usr/sbin/ovs-brcompatd"
 +dpctl="/usr/bin/ovs-dpctl"
 +appctl="/usr/bin/ovs-appctl"
 +ofctl="/usr/bin/ovs-ofctl"
 +vsctl="/usr/bin/ovs-vsctl"
  
  if [ "$ENABLE_FAKE_PROC_NET" = "y" ]; then
      if [ "$ENABLE_BRCOMPAT" != "y" ]; then
      fi
  fi
  
 +if test "$ENABLE_MONITOR" = "y"; then
 +    monitor_opt="--monitor"
 +else
 +    monitor_opt=
 +fi
 +
  function dp_list {
      "$dpctl" show | grep '^dp[0-9]\+:' | cut -d':' -f 1
  }
@@@ -112,13 -92,10 +113,13 @@@ function remove_all_dp 
  function insert_modules_if_required {
      if ! lsmod | grep -q "openvswitch_mod"; then
          action "Inserting llc module" modprobe llc
 -        action "Inserting openvswitch module" insmod $VSWITCH_BASE/kernel_modules/openvswitch_mod.ko
 +        action "Inserting openvswitch module" modprobe openvswitch_mod
      fi
      if [ -n "$BRCOMPATD_PIDFILE" ] && ! lsmod | grep -q "brcompat_mod"; then
 -        action "Inserting brcompat module" insmod $VSWITCH_BASE/kernel_modules/brcompat_mod.ko
 +        action "Inserting brcompat module" modprobe brcompat_mod
 +    fi
 +    if [ -f "/lib/modules/`uname -r`/kernel/net/vswitch/ip_gre_mod.ko" ] && ! lsmod | grep -q "ip_gre_mod"; then
 +        action "Inserting ip_gre module" modprobe ip_gre_mod
      fi
  }
  
@@@ -129,55 -106,20 +130,55 @@@ function remove_modules 
      if lsmod | grep -q "openvswitch_mod"; then
          action "Removing openvswitch module" rmmod openvswitch_mod.ko
      fi
 -}
 -
 -function reload_vswitchd {
 -    if [ -f "$VSWITCHD_PIDFILE" ]; then
 -        "$appctl" \
 -            --target=ovs-vswitchd.$(cat "$VSWITCHD_PIDFILE").ctl \
 -            --execute=vswitchd/reload
 +    if lsmod | grep -q "ip_gre_mod"; then
 +        action "Removing ip_gre module" rmmod ip_gre_mod.ko
      fi
  }
  
 -function reload_brcompatd {
 -    if [ -f "$BRCOMPATD_PIDFILE" ]; then
 -        "$appctl" \
 -            --target=ovs-brcompatd.$(cat "$BRCOMPATD_PIDFILE").ctl --reopen
 +function start_ovsdb_server {
 +    local syslog_opt="-vANY:SYSLOG:${OVSDB_SERVER_SYSLOG_LOGLEVEL}"
 +    local logfile_file_opt=""
 +    local logfile_level_opt=""
 +    if [ ! -d "$OVSDB_SERVER_RUN_DIR" ]; then
 +        mkdir -p "$OVSDB_SERVER_RUN_DIR"
 +    fi
 +    cd "$OVSDB_SERVER_RUN_DIR"
 +    local remotes=
 +    for remote in $OVSDB_SERVER_REMOTES; do
 +        remotes="$remotes --remote=$remote"
 +    done
 +    if [ -n "$OVSDB_SERVER_FILE_LOGLEVEL" ]; then
 +        logfile_level_opt="-vANY:FILE:${OVSDB_SERVER_FILE_LOGLEVEL}"
 +        logfile_file_opt="--log-file=$OVSDB_SERVER_LOGFILE"
 +    fi
 +    local leak_opt=""
 +    if [ -n "$OVSDB_SERVER_MEMLEAK_LOGFILE" ]; then
 +        leak_opt="--check-leaks=$OVSDB_SERVER_MEMLEAK_LOGFILE"
 +        if [ -e "$OVSDB_SERVER_MEMLEAK_LOGFILE" ]; then
 +            mv "$OVSDB_SERVER_MEMLEAK_LOGFILE" "$OVSDB_SERVER_MEMLEAK_LOGFILE.prev"
 +        fi
 +    fi
 +    local strace_opt=""
 +    local daemonize="y"
 +    if [ -n "$OVSDB_SERVER_STRACE_LOG" ] && [ -n "$OVSDB_SERVER_VALGRIND_LOG" ]; then
 +        printf "Can not start with both VALGRIND and STRACE\n"
 +        exit 1
 +    fi
 +    if [ -n "$OVSDB_SERVER_STRACE_LOG" ]; then
 +        strace_opt="strace -o $OVSDB_SERVER_STRACE_LOG $OVSDB_SERVER_STRACE_OPT"
 +        daemonize="n"
 +    fi
 +    if [ -n "$OVSDB_SERVER_VALGRIND_LOG" ]; then
 +        valgrind_opt="valgrind --log-file=$OVSDB_SERVER_VALGRIND_LOG $OVSDB_SERVER_VALGRIND_OPT"
 +        daemonize="n"
 +    fi
 +    ssl_opts="--private-key=db:SSL,private_key --certificate=db:SSL,certificate --bootstrap-ca-cert=db:SSL,ca_cert"
 +    if [ "$daemonize" != "y" ]; then
 +        # Start in background and force a "success" message
 +        action "Starting ovsdb_server ($strace_opt$valgrind_opt)" true
 +        (nice -n "$OVSDB_SERVER_PRIORITY" $strace_opt $valgrind_opt "$ovsdb_server" "$OVSDB_SERVER_DB" --pidfile="$OVSDB_SERVER_PIDFILE" --detach $monitor_opt --no-chdir -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt $remotes $ssl_opts) &
 +    else
 +        action "Starting ovsdb-server" nice -n "$OVSDB_SERVER_PRIORITY" "$ovsdb_server" "$OVSDB_SERVER_DB" --pidfile="$OVSDB_SERVER_PIDFILE" --detach $monitor_opt --no-chdir -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt $remotes $ssl_opts
      fi
  }
  
@@@ -218,12 -160,15 +219,15 @@@ function start_vswitchd 
      if [ "$ENABLE_FAKE_PROC_NET" = "y" ]; then
          fake_proc_net_opt="--fake-proc-net"
      fi
+     if [ "$VSWITCHD_MLOCKALL" != "no" ]; then
+         mlockall_opt="--mlockall"
+     fi
      if [ "$daemonize" != "y" ]; then
          # Start in background and force a "success" message
          action "Starting ovs-vswitchd ($strace_opt$valgrind_opt)" true
-         (nice -n "$VSWITCHD_PRIORITY" $strace_opt $valgrind_opt "$vswitchd" --pidfile="$VSWITCHD_PIDFILE" --detach $monitor_opt --no-chdir $fake_proc_net_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_OVSDB_SERVER") &
 -        (nice -n "$VSWITCHD_PRIORITY" $strace_opt $valgrind_opt "$vswitchd" --pidfile="$VSWITCHD_PIDFILE" --detach --no-chdir $fake_proc_net_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt $mlockall_opt "$VSWITCHD_CONF") &
++        (nice -n "$VSWITCHD_PRIORITY" $strace_opt $valgrind_opt "$vswitchd" --pidfile="$VSWITCHD_PIDFILE" --detach $monitor_opt --no-chdir $fake_proc_net_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt $mlockall_opt "$VSWITCHD_OVSDB_SERVER") &
      else
-         action "Starting ovs-vswitchd" nice -n "$VSWITCHD_PRIORITY" "$vswitchd" --pidfile="$VSWITCHD_PIDFILE" --detach $monitor_opt --no-chdir $fake_proc_net_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_OVSDB_SERVER"
 -        action "Starting ovs-vswitchd" nice -n "$VSWITCHD_PRIORITY" "$vswitchd" --pidfile="$VSWITCHD_PIDFILE" --detach --no-chdir $fake_proc_net_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt $mlockall_opt "$VSWITCHD_CONF"
++        action "Starting ovs-vswitchd" nice -n "$VSWITCHD_PRIORITY" "$vswitchd" --pidfile="$VSWITCHD_PIDFILE" --detach $monitor_opt --no-chdir $fake_proc_net_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt $mlockall_opt "$VSWITCHD_OVSDB_SERVER"
      fi
  }
  
@@@ -240,7 -185,7 +244,7 @@@ function start_brcompatd 
          logfile_file_opt="--log-file=$BRCOMPATD_LOGFILE"
      fi
      local leak_opt=""
 -    if [ -n "$BRCOMPATD_MEMLEAK_LOG" ]; then
 +    if [ -n "$BRCOMPATD_MEMLEAK_LOGFILE" ]; then
          leak_opt="--check-leaks=$BRCOMPATD_MEMLEAK_LOGFILE"
          if [ -e "$BRCOMPATD_MEMLEAK_LOGFILE" ]; then
              mv "$BRCOMPATD_MEMLEAK_LOGFILE" "$BRCOMPATD_MEMLEAK_LOGFILE.prev"
          valgrind_opt="valgrind --log-file=$BRCOMPATD_VALGRIND_LOG $BRCOMPATD_VALGRIND_OPT"
          daemonize="n"
      fi
 -    appctl_cmd="$appctl -t /var/run/ovs-vswitchd.\`cat $VSWITCHD_PIDFILE\`.ctl -e '%s'"
 +    appctl_cmd="$appctl --target=/var/run/ovs-vswitchd.\`cat $VSWITCHD_PIDFILE\`.ctl %s"
      if [ "$daemonize" != "y" ]; then
          # Start in background and force a "success" message
          action "Starting ovs-brcompatd ($strace_opt$valgrind_opt)" true
 -        (nice -n "$VSWITCHD_PRIORITY" $strace_opt $valgrind_opt "$brcompatd"--no-chdir --appctl-command="$appctl_cmd" --pidfile=$BRCOMPATD_PIDFILE -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF") &
 +        (nice -n "$VSWITCHD_PRIORITY" $strace_opt $valgrind_opt "$brcompatd"--no-chdir --appctl-command="$appctl_cmd" --pidfile=$BRCOMPATD_PIDFILE -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_OVSDB_SERVER") &
      else
 -        action "Starting ovs-brcompatd" nice -n "$BRCOMPATD_PRIORITY" $strace_opt $valgrind_opt "$brcompatd" --no-chdir --appctl-command="$appctl_cmd" --pidfile=$BRCOMPATD_PIDFILE --detach -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_CONF"
 +        action "Starting ovs-brcompatd" nice -n "$BRCOMPATD_PRIORITY" $strace_opt $valgrind_opt "$brcompatd" --no-chdir --appctl-command="$appctl_cmd" --pidfile=$BRCOMPATD_PIDFILE --detach $monitor_opt -vANY:CONSOLE:EMER $syslog_opt $logfile_level_opt $logfile_file_opt $leak_opt "$VSWITCHD_OVSDB_SERVER"
 +    fi
 +}
 +
 +function stop_ovsdb_server {
 +    if [ -f "$OVSDB_SERVER_PIDFILE" ]; then
 +        local pid=$(cat "$OVSDB_SERVER_PIDFILE")
 +        action "Killing ovsdb-server ($pid)" kill -TERM $pid
 +        rm -f "$OVSDB_SERVER_PIDFILE"
      fi
  }
  
@@@ -305,6 -242,8 +309,6 @@@ WARNING!!
  
  Restarting vswitch on a live server is not guaranteed to work.  It is
  provided as a convenience for those situations in which it does work.
 -If you just want to reload the configuration file, use "reload"
 -instead of restart.
  
  EOF
      read -s -r -n 1 -p "Countinue with restart (y/N): " response
      esac
  }
  
 +function set_system_uuid {
 +    system_uuid=$(. /etc/xensource-inventory && echo $INSTALLATION_UUID)
 +    if test -n "$system_uuid"; then
 +        action "Configuring Open vSwitch system UUID" true
 +        $vsctl --no-wait set Open_vSwitch . external-ids:system-uuid="$system_uuid"
 +    else
 +        action "Configuring Open vSwitch system UUID" false
 +    fi
 +}
 +
  function start {
      if [ "$FORCE_COREFILES" = "y" ]; then
          turn_on_corefiles
      # ovs-vswitchd needs a few per bridge
      ulimit -n 4096
  
 -    if [ ! -e "$VSWITCHD_CONF" ]; then
 -        warning "$VSWITCHD_CONF does not exist"
 -        action "Creating empty $VSWITCHD_CONF" touch "$VSWITCHD_CONF"
 -    elif [ ! -e /var/run/vswitch.booted ]; then
 +    # Allow GRE traffic.
 +    iptables -I INPUT -p gre -j ACCEPT
 +
 +    if [ ! -e "$OVSDB_SERVER_DB" ]; then
 +        warning "$OVSDB_SERVER_DB does not exist"
 +
 +        action "Creating empty database $OVSDB_SERVER_DB" true
 +        $ovsdb_tool -vANY:console:emer create "$OVSDB_SERVER_DB" "$VSWITCHD_OVSDB_SCHEMA"
 +    else
 +        # Upgrade or downgrade schema and compact database.
 +        $ovsdb_tool -vANY:console:emer convert "$OVSDB_SERVER_DB" "$VSWITCHD_OVSDB_SCHEMA"
 +    fi
 +
 +    start_ovsdb_server
 +    $vsctl --no-wait init
 +    if [ ! -e /var/run/vswitch.booted ]; then
          touch /var/run/vswitch.booted
 -        /usr/bin/ovs-cfg-mod '-vANY:console:emer' -F "$VSWITCHD_CONF" \
 -            '--del-match=bridge.*' \
 -            '--del-match=port.*' \
 -            '--del-match=bonding.*' \
 -            '--del-match=iface.*' \
 -            '--del-match=vlan.*.trunks=*' \
 -            '--del-match=vlan.*.tag=*'
 +        for bridge in $($vsctl list-br); do
 +            $vsctl --no-wait del-br $bridge
 +        done
      fi
  
 +    set_system_uuid
 +
      start_vswitchd
      start_brcompatd
 -    reload_vswitchd  # ensures ovs-vswitchd has fully read config file.
 +    touch /var/lock/subsys/vswitch
  }
  
  function stop {
      stop_brcompatd
      stop_vswitchd
 +    stop_ovsdb_server
 +    rm -f /var/lock/subsys/vswitch
  }
  
  function restart {
@@@ -393,6 -310,10 +397,6 @@@ case "$1" i
      restart)
          restart
          ;;
 -    reload)
 -        reload_vswitchd
 -        reload_brcompatd
 -        ;;
      strace-vswitchd)
          shift
          strace -p $(cat "$VSWITCHD_PIDFILE") "$@"
          strace -p $(cat "$BRCOMPATD_PIDFILE") "$@"
          ;;
      status)
 -        status -p ovs-vswitchd.pid ovs-vswitchd
 -        status -p ovs-brcompatd.pid ovs-brcompatd
 +        status -p "$OVSDB_SERVER_PIDFILE" ovsdb-server
 +        status -p "$VSWITCHD_PIDFILE" ovs-vswitchd
 +        status -p "$BRCOMPATD_PIDFILE" ovs-brcompatd
          ;;
      version)
 -        "$VSWITCH_BASE"/sbin/ovs-vswitchd -V
 -        "$VSWITCH_BASE"/sbin/ovs-brcompatd -V
 +        /usr/sbin/ovsdb-server -V
 +        /usr/sbin/ovs-vswitchd -V
 +        /usr/sbin/ovs-brcompatd -V
          ;;
      help)
 -        printf "vswitch [start|stop|restart|reload|unload|status|version]\n"
 +        printf "vswitch [start|stop|restart|unload|status|version]\n"
          ;;
      *)
          printf "Unknown command: $1\n"
@@@ -1,12 -1,15 +1,12 @@@
  ### Configuration options for vswitch
  
 -# Copyright (C) 2009 Nicira Networks, Inc.
 +# Copyright (C) 2009, 2010 Nicira Networks, Inc.
  #
  # Copying and distribution of this file, with or without modification,
  # are permitted in any medium without royalty provided the copyright
  # notice and this notice are preserved.  This file is offered as-is,
  # without warranty of any kind.
  
 -# VSWITCH_BASE: Root directory where vswitch binaries are installed
 -# VSWITCH_BASE=/root/vswitch/openvswitch/build
 -
  # ENABLE_BRCOMPAT: If 'y' than emulate linux bridging interfaces
  #    using the brcompat kernel module and ovs-brcompatd daemon
  # ENABLE_BRCOMPAT=y
  #    This is useful in some cases when replacing existing solutions.
  # ENABLE_FAKE_PROC_NET=y
  
 +# ENABLE_MONITOR: If 'y' then monitor daemon processes and restart them
 +#    if they die due to an error signal.
 +# ENABLE_MONITOR=y
 +
  # FORCE_COREFILES: If 'y' then core files will be enabled.
  # FORCE_COREFILES=y
  
  #     See the manpage for "core".
  # COREFILE_PATTERN="/var/log/%e-%t"
  
 -# VSWITCHD_CONF: File in which ovs-vswitchd stores its configuration.
 -# VSWITCHD_CONF=/etc/ovs-vswitchd.conf
 +# OVSDB_SERVER_REMOTES: Space-separated list of methods on which to have
 +#     ovsdb-server listen or connect for a JSON-RPC connection.
 +# OVSDB_SERVER_REMOTES="punix:/var/run/ovsdb-server db:Open_vSwitch,managers"
 +
 +# OVSDB_SERVER_DB: File for which ovsdb-server uses for storage.
 +# OVSDB_SERVER_DB=/etc/ovs-vswitchd.conf.db
 +
 +# OVSDB_SERVER_PIDFILE: File in which to store the pid of the running
 +#     ovsdb-server.
 +# OVSDB_SERVER_PIDFILE=/var/run/ovsdb-server.pid
 +
 +# OVSDB_SERVER_RUN_DIR: Set the directory in which ovsdb-server should be
 +#     run.  This mainly affects where core files will be placed.
 +# OVSDB_SERVER_RUN_DIR=/var/xen/vswitch
 +
 +# OVSDB_SERVER_PRIORITY: "nice" priority at which to run ovsdb-server and 
 +#     related processes.
 +# OVSDB_SERVER_PRIORITY=-10
 +
 +# OVSDB_SERVER_LOGFILE: File to send the FILE_LOGLEVEL log messages to.
 +# OVSDB_SERVER_LOGFILE=/var/log/ovsdb-server.log
 +
 +# OVSDB_SERVER_FILE_LOGLEVEL: Log level at which to log into the
 +#     OVSDB_SERVER_LOG file.  If this is null or not set the logfile will
 +#     not be created and nothing will be sent to it.  This is the
 +#     default.  The available options are: EMER, WARN, INFO and DBG.
 +# OVSDB_SERVER_FILE_LOGLEVEL=""
 +
 +# OVSDB_SERVER_SYSLOG_LOGLEVEL: Log level at which to log into syslog.  If
 +#     this is null or not set the default is to log to syslog
 +#     emergency and warning level messages only.
 +# OVSDB_SERVER_SYSLOG_LOGLEVEL="WARN"
 +
 +# OVSDB_SERVER_MEMLEAK_LOGFILE: File for logging memory leak data.
 +#     Enabling this option will slow ovsdb-server significantly.  Do not
 +#     enable it except to debug a suspected memory leak.  Use the
 +#     ovs-parse-leaks utility included with Open vSwitch to parse the
 +#     log file.  For best results, you also need debug symbols.
 +# OVSDB_SERVER_MEMLEAK_LOGFILE=""
 +
 +# OVSDB_SERVER_STRACE_LOG: File for logging strace output.
 +#     If this is set to a nonempty string, then ovsdb-server will run
 +#     under strace, whose output will be logged to the specified file.
 +#     Enabling this option will slow ovsdb-server significantly.
 +#     OVSDB_SERVER_STRACE_LOG and OVSDB_SERVER_VALGRIND_LOG are mutually 
 +#     exclusive.
 +# OVSDB_SERVER_STRACE_LOG=""
 +
 +# OVSDB_SERVER_STRACE_OPT: Options to pass to strace.
 +#     This option's value is honored only when OVSDB_SERVER_STRACE_LOG is
 +#     set to a nonempty string.
 +# OVSDB_SERVER_STRACE_OPT=""
 +
 +# OVSDB_SERVER_VALGRIND_LOG: File for logging valgrind output.
 +#     If this is set to a nonempty string, then ovsdb-server will run
 +#     under valgrind, whose output will be logged to the specified file.
 +#     Enabling this option will slow ovsdb-server by 100X or more.
 +#     valgrind is not installed by default on XenServer systems; you must
 +#     install it by hand to usefully enable this option.
 +#     OVSDB_SERVER_STRACE_LOG and OVSDB_SERVER_VALGRIND_LOG are mutually 
 +#     exclusive.
 +# OVSDB_SERVER_VALGRIND_LOG=""
 +
 +# OVSDB_SERVER_VALGRIND_OPT: Options to pass to valgrind.
 +#     This option's value is honored only when OVSDB_SERVER_VALGRIND_LOG is
 +#     set to a nonempty string.
 +# OVSDB_SERVER_VALGRIND_OPT=""
 +
 +# VSWITCHD_OVSDB_SERVER: Method to have ovs-vswitchd initiate a JSON-RPC
 +#     connection to an ovsdb-server instance.
 +# VSWITCHD_OVSDB_SERVER=unix:/var/run/ovsdb-server
 +
 +# VSWITCHD_OVSDB_SCHEMA: Schema file to use for generating a new OVSDB
 +#     ovs-vswitchd database.
 +# VSWITCHD_OVSDB_SCHEMA=/usr/share/vswitch/vswitch.ovsschema
  
  # VSWITCHD_PIDFILE: File in which to store the pid of the running
  #     ovs-vswitchd.
  #     processes.
  # VSWITCHD_PRIORITY=-10
  
+ # VSWITCHD_MLOCKALL: Whether to pass ovs-vswitchd the --mlockall option.
+ #     This option should be set to "yes" or "no".  The default is "yes".
+ #     Enabling this option can avoid networking interruptions due to
+ #     system memory pressure in extraordinary situations, such as multiple
+ #     concurrent VM import operations.
+ # VSWITCHD_MLOCKALL=yes
  # VSWITCHD_LOGFILE: File to send the FILE_LOGLEVEL log messages to.
  # VSWITCHD_LOGFILE=/var/log/ovs-vswitchd.log
  
 -# VSWITCHD_MEMLEAK_LOGFILE: File for logging memory leak data.
 -#     Enabling this option will slow ovs-vswitchd significantly.  Do not
 -#     enable it except to debug a suspected memory leak.  Use the
 -#     ovs-parse-leaks utility included with Open vSwitch to parse the
 -#     log file.  For best results, you also need debug symbols.
 -# VSWITCHD_MEMLEAK_LOGFILE=""
 -
  # VSWITCHD_FILE_LOGLEVEL: Log level at which to log into the
  #     VSWITCHD_LOG file.  If this is null or not set the logfile will
  #     not be created and nothing will be sent to it.  This is the
  #     emergency and warning level messages only.
  # VSWITCHD_SYSLOG_LOGLEVEL="WARN"
  
 +# VSWITCHD_MEMLEAK_LOGFILE: File for logging memory leak data.
 +#     Enabling this option will slow ovs-vswitchd significantly.  Do not
 +#     enable it except to debug a suspected memory leak.  Use the
 +#     ovs-parse-leaks utility included with Open vSwitch to parse the
 +#     log file.  For best results, you also need debug symbols.
 +# VSWITCHD_MEMLEAK_LOGFILE=""
 +
  # VSWITCHD_STRACE_LOG: File for logging strace output.
  #     If this is set to a nonempty string, then ovs-vswitchd will run
  #     under strace, whose output will be logged to the specified file.