Creates on \fIbridge\fR a new port named \fIport\fR from the network
device of the same name.
.
-.IP "\fBadd\-bond \fIbridge port iface\fR\&..."
+.IP "[\fB\-\-fake\-iface\fR] \fBadd\-bond \fIbridge port iface\fR\&..."
Creates on \fIbridge\fR a new port named \fIport\fR that bonds
together the network devices given as each \fIiface\fR. At least two
interfaces must be named.
+.IP
+With \fB\-\-fake\-iface\fR, a fake interface with the name \fIport\fR is
+created. This should only be used for compatibility with legacy
+software that requires it.
.
.IP "[\fB\-\-if\-exists\fR] \fBdel\-port \fR[\fIbridge\fR] \fIport\fR"
Deletes \fIport\fR. If \fIbridge\fR is omitted, \fIport\fR is removed
static void
add_port(const struct ovsrec_open_vswitch *ovs,
- const char *br_name, const char *port_name,
+ const char *br_name, const char *port_name, bool fake_iface,
char *iface_names[], int n_ifaces)
{
struct vsctl_info info;
port = ovsrec_port_insert(txn_from_openvswitch(ovs));
ovsrec_port_set_name(port, port_name);
ovsrec_port_set_interfaces(port, ifaces, n_ifaces);
+ ovsrec_port_set_bond_fake_iface(port, fake_iface);
free(ifaces);
if (bridge->vlan) {
static void
cmd_add_port(struct vsctl_context *ctx)
{
- add_port(ctx->ovs, ctx->argv[1], ctx->argv[2], &ctx->argv[2], 1);
+ add_port(ctx->ovs, ctx->argv[1], ctx->argv[2], false, &ctx->argv[2], 1);
}
static void
cmd_add_bond(struct vsctl_context *ctx)
{
- add_port(ctx->ovs, ctx->argv[1], ctx->argv[2], &ctx->argv[3], ctx->argc - 3);
+ bool fake_iface = shash_find(&ctx->options, "--fake-iface");
+
+ add_port(ctx->ovs, ctx->argv[1], ctx->argv[2], fake_iface,
+ &ctx->argv[3], ctx->argc - 3);
}
static void
/* Port commands. */
{"list-ports", 1, 1, cmd_list_ports, ""},
{"add-port", 2, 2, cmd_add_port, ""},
- {"add-bond", 4, INT_MAX, cmd_add_bond, ""},
+ {"add-bond", 4, INT_MAX, cmd_add_bond, "--fake-iface"},
{"del-port", 1, 2, cmd_del_port, "--if-exists"},
{"port-to-br", 1, 1, cmd_port_to_br, ""},
{"port-set-external-id", 2, 3, cmd_port_set_external_id, ""},