Skip to content

Commit

Permalink
rhel: Add Patch Port support to initscripts
Browse files Browse the repository at this point in the history
Allows setting up type=patch ports through sysconfig ifcfg-* files.

Signed-off-by: Jason Kölker <[email protected]>
Signed-off-by: Gurucharan Shetty <[email protected]>
Acked-by: Flavio Leitner <[email protected]>
  • Loading branch information
jkoelker authored and shettyg committed Apr 1, 2014
1 parent a8513c7 commit d7aab66
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Isaku Yamahata [email protected]
James P. [email protected]
James Page [email protected]
Jarno Rajahalme [email protected]
Jason Kölker [email protected]
Jean Tourrilhes [email protected]
Jeremy Stribling [email protected]
Jesse Gross [email protected]
Expand Down
25 changes: 25 additions & 0 deletions rhel/README.RHEL
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ assignments. The following OVS-specific variable names are supported:

* "OVSTunnel", if <name> is an OVS tunnel.

* "OVSPatchPort", if <name> is a patch port

- OVS_BRIDGE: If TYPE is anything other than "OVSBridge", set to
the name of the OVS bridge to which the port should be attached.

Expand All @@ -47,6 +49,9 @@ assignments. The following OVS-specific variable names are supported:
- OVS_TUNNEL_OPTIONS: For "OVSTunnel" interfaces, this field should be
used to specify the tunnel options like remote_ip, key, etc.

- OVS_PATCH_PEER: For "OVSPatchPort" devices, this field specifies
the patch's peer on the other bridge.

Note
----

Expand Down Expand Up @@ -182,6 +187,26 @@ OVS_BRIDGE=ovsbridge0
OVS_TUNNEL_TYPE=gre
OVS_TUNNEL_OPTIONS="options:remote_ip=A.B.C.D"


Patch Ports:

==> ifcfg-patch-ovs-0 <==
DEVICE=patch-ovs-0
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSPatchPort
OVS_BRIDGE=ovsbridge0
OVS_PATCH_PEER=patch-ovs-1

==> ifcfg-patch-ovs-1 <==
DEVICE=patch-ovs-1
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSPatchPort
OVS_BRIDGE=ovsbridge1
OVS_PATCH_PEER=patch-ovs-0


Reporting Bugs
--------------

Expand Down
3 changes: 3 additions & 0 deletions rhel/etc_sysconfig_network-scripts_ifdown-ovs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ case "$TYPE" in
retval=$?
ovs-vsctl -t ${TIMEOUT} -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE"
;;
OVSPatchPort)
ovs-vsctl -t ${TIMEOUT} -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE"
;;
*)
echo $"Invalid OVS interface type $TYPE"
exit 1
Expand Down
4 changes: 4 additions & 0 deletions rhel/etc_sysconfig_network-scripts_ifup-ovs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ case "$TYPE" in
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=$OVS_TUNNEL_TYPE $OVS_TUNNEL_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
${OTHERSCRIPT} ${CONFIG} ${2}
;;
OVSPatchPort)
ifup_ovs_bridge
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=patch options:peer="${OVS_PATCH_PEER}" ${OVS_EXTRA+-- $OVS_EXTRA}
;;
*)
echo $"Invalid OVS interface type $TYPE"
exit 1
Expand Down

0 comments on commit d7aab66

Please sign in to comment.