#include "ovsdb-idl.h"
#include "poll-loop.h"
#include "process.h"
+#include "stream.h"
#include "stream-ssl.h"
#include "svec.h"
#include "vswitchd/vswitch-idl.h"
%s: ovs-vswitchd management utility\n\
usage: %s [OPTIONS] COMMAND [ARG...]\n\
\n\
+Open vSwitch commands:\n\
+ init initialize database, if not yet initialized\n\
+ emer-reset reset configuration to clean state\n\
+\n\
Bridge commands:\n\
add-br BRIDGE create a new bridge named BRIDGE\n\
add-br BRIDGE PARENT VLAN create new fake BRIDGE in PARENT on VLAN\n\
br-get-external-id BRIDGE KEY print value of KEY on BRIDGE\n\
br-get-external-id BRIDGE list key-value pairs on BRIDGE\n\
\n\
-Port commands:\n\
+Port commands (a bond is considered to be a single port):\n\
list-ports BRIDGE print the names of all the ports on BRIDGE\n\
add-port BRIDGE PORT add network device PORT to BRIDGE\n\
add-bond BRIDGE PORT IFACE... add bonded port PORT in BRIDGE from IFACES\n\
del-port [BRIDGE] PORT delete PORT (which may be bonded) from BRIDGE\n\
port-to-br PORT print name of bridge that contains PORT\n\
-A bond is considered to be a single port.\n\
\n\
Interface commands (a bond consists of multiple interfaces):\n\
list-ifaces BRIDGE print the names of all interfaces on BRIDGE\n\
Options:\n\
--db=DATABASE connect to DATABASE\n\
(default: %s)\n\
+ --no-wait do not wait for ovs-vswitchd to reconfigure\n\
+ -t, --timeout=SECS wait at most SECS seconds for ovs-vswitchd\n\
+ --dry-run do not commit changes to database\n\
--oneline print exactly one line of output per command\n",
program_name, program_name, default_db());
vlog_usage();
+ printf("\
+ --no-syslog equivalent to --verbose=vsctl:syslog:warn\n");
+ stream_usage("database", true, true, false);
printf("\n\
Other options:\n\
-h, --help display this help message\n\
static void
pre_cmd_emer_reset(struct vsctl_context *ctx)
{
- ovsdb_idl_add_column(ctx->idl, &ovsrec_open_vswitch_col_managers);
ovsdb_idl_add_column(ctx->idl, &ovsrec_open_vswitch_col_manager_options);
ovsdb_idl_add_column(ctx->idl, &ovsrec_open_vswitch_col_ssl);
const struct ovsrec_sflow *sflow, *next_sflow;
/* Reset the Open_vSwitch table. */
- ovsrec_open_vswitch_set_managers(ctx->ovs, NULL, 0);
ovsrec_open_vswitch_set_manager_options(ctx->ovs, NULL, 0);
ovsrec_open_vswitch_set_ssl(ctx->ovs, NULL);
{
size_t i;
- ovsrec_open_vswitch_verify_managers(ovs);
ovsrec_open_vswitch_verify_manager_options(ovs);
for (i = 0; i < ovs->n_manager_options; ++i) {
static void
pre_manager(struct vsctl_context *ctx)
{
- ovsdb_idl_add_column(ctx->idl, &ovsrec_open_vswitch_col_managers);
ovsdb_idl_add_column(ctx->idl, &ovsrec_open_vswitch_col_manager_options);
ovsdb_idl_add_column(ctx->idl, &ovsrec_manager_col_target);
}
/* Print the targets in sorted order for reproducibility. */
svec_init(&targets);
- /* First, add all targets found in deprecated 'managers' column. */
- for (i = 0; i < ovs->n_managers; i++) {
- svec_add(&targets, ovs->managers[i]);
- }
-
- /* Second, add all targets pointed to by 'manager_options' column. */
for (i = 0; i < ovs->n_manager_options; i++) {
svec_add(&targets, ovs->manager_options[i]->target);
}
const struct ovsrec_open_vswitch *ovs = ctx->ovs;
size_t i;
- /* Delete manager targets in deprecated 'managers' column. */
- ovsrec_open_vswitch_set_managers(ovs, NULL, 0);
-
/* Delete Manager rows pointed to by 'manager_options' column. */
for (i = 0; i < ovs->n_manager_options; i++) {
ovsrec_manager_delete(ovs->manager_options[i]);
struct ovsrec_manager **managers;
size_t i;
- /* Store in deprecated 'manager' column. */
- ovsrec_open_vswitch_set_managers(ctx->ovs, targets, n);
-
/* Insert each manager in a new row in Manager table. */
managers = xmalloc(n * sizeof *managers);
for (i = 0; i < n; i++) {