projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ovsdb-idl: Fix atomicity of writes that don't change a column's value.
[openvswitch]
/
utilities
/
ovs-vsctl.c
diff --git
a/utilities/ovs-vsctl.c
b/utilities/ovs-vsctl.c
index e6715c9c35ec08cd00840b360ebe1dc568225f7c..2c1ba6df229bfa76cc04fb2609ca8c88be2d8885 100644
(file)
--- a/
utilities/ovs-vsctl.c
+++ b/
utilities/ovs-vsctl.c
@@
-38,6
+38,7
@@
#include "process.h"
#include "stream.h"
#include "stream-ssl.h"
#include "process.h"
#include "stream.h"
#include "stream-ssl.h"
+#include "sset.h"
#include "svec.h"
#include "vswitchd/vswitch-idl.h"
#include "table.h"
#include "svec.h"
#include "vswitchd/vswitch-idl.h"
#include "table.h"
@@
-757,7
+758,7
@@
static void
get_info(struct vsctl_context *ctx, struct vsctl_info *info)
{
const struct ovsrec_open_vswitch *ovs = ctx->ovs;
get_info(struct vsctl_context *ctx, struct vsctl_info *info)
{
const struct ovsrec_open_vswitch *ovs = ctx->ovs;
- struct s
hash
bridges, ports;
+ struct s
set
bridges, ports;
size_t i;
info->ctx = ctx;
size_t i;
info->ctx = ctx;
@@
-765,14
+766,14
@@
get_info(struct vsctl_context *ctx, struct vsctl_info *info)
shash_init(&info->ports);
shash_init(&info->ifaces);
shash_init(&info->ports);
shash_init(&info->ifaces);
- s
hash
_init(&bridges);
- s
hash
_init(&ports);
+ s
set
_init(&bridges);
+ s
set
_init(&ports);
for (i = 0; i < ovs->n_bridges; i++) {
struct ovsrec_bridge *br_cfg = ovs->bridges[i];
struct vsctl_bridge *br;
size_t j;
for (i = 0; i < ovs->n_bridges; i++) {
struct ovsrec_bridge *br_cfg = ovs->bridges[i];
struct vsctl_bridge *br;
size_t j;
- if (!s
hash_add_once(&bridges, br_cfg->name, NULL
)) {
+ if (!s
set_add(&bridges, br_cfg->name
)) {
VLOG_WARN("%s: database contains duplicate bridge name",
br_cfg->name);
continue;
VLOG_WARN("%s: database contains duplicate bridge name",
br_cfg->name);
continue;
@@
-785,29
+786,29
@@
get_info(struct vsctl_context *ctx, struct vsctl_info *info)
for (j = 0; j < br_cfg->n_ports; j++) {
struct ovsrec_port *port_cfg = br_cfg->ports[j];
for (j = 0; j < br_cfg->n_ports; j++) {
struct ovsrec_port *port_cfg = br_cfg->ports[j];
- if (!s
hash_add_once(&ports, port_cfg->name, NULL
)) {
+ if (!s
set_add(&ports, port_cfg->name
)) {
VLOG_WARN("%s: database contains duplicate port name",
port_cfg->name);
continue;
}
if (port_is_fake_bridge(port_cfg)
VLOG_WARN("%s: database contains duplicate port name",
port_cfg->name);
continue;
}
if (port_is_fake_bridge(port_cfg)
- && s
hash_add_once(&bridges, port_cfg->name, NULL
)) {
+ && s
set_add(&bridges, port_cfg->name
)) {
add_bridge(info, NULL, port_cfg->name, br, *port_cfg->tag);
}
}
}
add_bridge(info, NULL, port_cfg->name, br, *port_cfg->tag);
}
}
}
- s
hash
_destroy(&bridges);
- s
hash
_destroy(&ports);
+ s
set
_destroy(&bridges);
+ s
set
_destroy(&ports);
- s
hash
_init(&bridges);
- s
hash
_init(&ports);
+ s
set
_init(&bridges);
+ s
set
_init(&ports);
for (i = 0; i < ovs->n_bridges; i++) {
struct ovsrec_bridge *br_cfg = ovs->bridges[i];
struct vsctl_bridge *br;
size_t j;
for (i = 0; i < ovs->n_bridges; i++) {
struct ovsrec_bridge *br_cfg = ovs->bridges[i];
struct vsctl_bridge *br;
size_t j;
- if (!s
hash_add_once(&bridges, br_cfg->name, NULL
)) {
+ if (!s
set_add(&bridges, br_cfg->name
)) {
continue;
}
br = shash_find_data(&info->bridges, br_cfg->name);
continue;
}
br = shash_find_data(&info->bridges, br_cfg->name);
@@
-816,12
+817,12
@@
get_info(struct vsctl_context *ctx, struct vsctl_info *info)
struct vsctl_port *port;
size_t k;
struct vsctl_port *port;
size_t k;
- if (!s
hash_add_once(&ports, port_cfg->name, NULL
)) {
+ if (!s
set_add(&ports, port_cfg->name
)) {
continue;
}
if (port_is_fake_bridge(port_cfg)
continue;
}
if (port_is_fake_bridge(port_cfg)
- && !s
hash_add_once(&bridges, port_cfg->name, NULL
)) {
+ && !s
set_add(&bridges, port_cfg->name
)) {
continue;
}
continue;
}
@@
-855,8
+856,8
@@
get_info(struct vsctl_context *ctx, struct vsctl_info *info)
}
}
}
}
}
}
- s
hash
_destroy(&bridges);
- s
hash
_destroy(&ports);
+ s
set
_destroy(&bridges);
+ s
set
_destroy(&ports);
}
static void
}
static void