git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/pcap-file: add 'ovs_' prefix to pcap functions
[sliver-openvswitch.git]
/
utilities
/
ovs-vsctl.c
diff --git
a/utilities/ovs-vsctl.c
b/utilities/ovs-vsctl.c
index
2d8c7c7
..
528b40c
100644
(file)
--- a/
utilities/ovs-vsctl.c
+++ b/
utilities/ovs-vsctl.c
@@
-128,7
+128,7
@@
static bool retry;
static struct table_style table_style = TABLE_STYLE_DEFAULT;
/* All supported commands. */
static struct table_style table_style = TABLE_STYLE_DEFAULT;
/* All supported commands. */
-static const struct vsctl_command_syntax
all_commands[]
;
+static const struct vsctl_command_syntax
*get_all_commands(void)
;
/* The IDL we're using and the current transaction, if any.
* This is for use by vsctl_exit() only, to allow it to clean up.
/* The IDL we're using and the current transaction, if any.
* This is for use by vsctl_exit() only, to allow it to clean up.
@@
-302,7
+302,7
@@
parse_options(int argc, char *argv[], struct shash *local_options)
options = xmemdup(global_long_options, sizeof global_long_options);
allocated_options = ARRAY_SIZE(global_long_options);
n_options = n_global_long_options;
options = xmemdup(global_long_options, sizeof global_long_options);
allocated_options = ARRAY_SIZE(global_long_options);
n_options = n_global_long_options;
- for (p =
all_commands
; p->name; p++) {
+ for (p =
get_all_commands()
; p->name; p++) {
if (p->options[0]) {
char *save_ptr = NULL;
char *name;
if (p->options[0]) {
char *save_ptr = NULL;
char *name;
@@
-568,7
+568,7
@@
find_command(const char *name)
if (shash_is_empty(&commands)) {
const struct vsctl_command_syntax *p;
if (shash_is_empty(&commands)) {
const struct vsctl_command_syntax *p;
- for (p =
all_commands
; p->name; p++) {
+ for (p =
get_all_commands()
; p->name; p++) {
shash_add_assert(&commands, p->name, p);
}
}
shash_add_assert(&commands, p->name, p);
}
}
@@
-2021,9
+2021,12
@@
cmd_del_port(struct vsctl_context *ctx)
vsctl_context_populate_cache(ctx);
if (find_bridge(ctx, target, false)) {
vsctl_context_populate_cache(ctx);
if (find_bridge(ctx, target, false)) {
- vsctl_fatal("cannot delete port %s because it is the local port "
- "for bridge %s (deleting this port requires deleting "
- "the entire bridge)", target, target);
+ if (must_exist) {
+ vsctl_fatal("cannot delete port %s because it is the local port "
+ "for bridge %s (deleting this port requires deleting "
+ "the entire bridge)", target, target);
+ }
+ port = NULL;
} else if (!with_iface) {
port = find_port(ctx, target, must_exist);
} else {
} else if (!with_iface) {
port = find_port(ctx, target, must_exist);
} else {
@@
-3627,7
+3630,7
@@
post_create(struct vsctl_context *ctx)
struct uuid dummy;
if (!uuid_from_string(&dummy, ds_cstr(&ctx->output))) {
struct uuid dummy;
if (!uuid_from_string(&dummy, ds_cstr(&ctx->output))) {
- NOT_REACHED();
+
OVS_
NOT_REACHED();
}
real = ovsdb_idl_txn_get_insert_uuid(ctx->txn, &dummy);
if (real) {
}
real = ovsdb_idl_txn_get_insert_uuid(ctx->txn, &dummy);
if (real) {
@@
-3745,7
+3748,7
@@
evaluate_relop(const struct ovsdb_datum *a, const struct ovsdb_datum *b,
return ovsdb_datum_includes_all(b, a, type);
default:
return ovsdb_datum_includes_all(b, a, type);
default:
- NOT_REACHED();
+
OVS_
NOT_REACHED();
}
}
}
}
@@
-4055,7
+4058,7
@@
do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands,
switch (status) {
case TXN_UNCOMMITTED:
case TXN_INCOMPLETE:
switch (status) {
case TXN_UNCOMMITTED:
case TXN_INCOMPLETE:
- NOT_REACHED();
+
OVS_
NOT_REACHED();
case TXN_ABORTED:
/* Should not happen--we never call ovsdb_idl_txn_abort(). */
case TXN_ABORTED:
/* Should not happen--we never call ovsdb_idl_txn_abort(). */
@@
-4076,7
+4079,7
@@
do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands,
vsctl_fatal("database not locked");
default:
vsctl_fatal("database not locked");
default:
- NOT_REACHED();
+
OVS_
NOT_REACHED();
}
free(error);
}
free(error);
@@
-4225,3
+4228,7
@@
static const struct vsctl_command_syntax all_commands[] = {
{NULL, 0, 0, NULL, NULL, NULL, NULL, RO},
};
{NULL, 0, 0, NULL, NULL, NULL, NULL, RO},
};
+static const struct vsctl_command_syntax *get_all_commands(void)
+{
+ return all_commands;
+}