Skip to content

Commit

Permalink
FIX: Add ability to change net_ifaces when ndm set to system.
Browse files Browse the repository at this point in the history
Added ability to change net_ifaces when network design mode is set to
‘system’.
  • Loading branch information
EpiJunkie committed Sep 4, 2016
1 parent db6a6ba commit 8c709e4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
14 changes: 13 additions & 1 deletion lib/chyves-properties
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,19 @@ __verify_user_input_for_properties() {

# net_ifaces
elif [ "$_property" = "net_ifaces" ]; then
__fault_detected_warning_break 1 "Not user settable."
if [ "$_NETWORK_DESIGN_MODE" = "auto" ]; then
__fault_detected_warning_break 1 "Not user settable while network design mode is set to auto."
elif [ "$_NETWORK_DESIGN_MODE" = "system" ]; then

# This verifies the correct interface format.
__log 1 "Checking valid values for 'net_ifaces' due to network design mode set as system."
for _iface in `echo $_value | tr ',' ' '`
do
if [ -z "$( echo "$_iface" | grep -E '^tap[0-9]{1,5}$|^vale[0-9a-zA-Z]{1,9}(:[a-zA-Z]{1}|:[0-9]{1,4}){0,1}$' )" ]; then
__fault_detected_exit "Incorrect interface format: $_iface"
fi
done
fi

# os
elif [ "$_property" = "os" ]; then
Expand Down
5 changes: 4 additions & 1 deletion man/chyves.8
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,10 @@ When setting a guest to use the \fBuefi\fR loader, some \fBuefi_*\fR properties
\fBnet_ifaces\fR=tap{n}|vale{n}[:{p}]
.
.IP
\fBManaged through \'chyves network\' commands\.\fR
\fBManaged through \'chyves network\' commands when \'network_design_mode\' is set to \'auto\'\.\fR
.
.IP
\fBUser settable when \'network_design_mode\' is set to \'system\'\.\fR
.
.IP
Stores which tap and VALE interfaces are assigned to a guest\. Where {n} is a unique interface number\. Taps are process locked and can not be shared simultaneously by multiple guests\. Multiple devices are stored using commas as delimiters\.
Expand Down
4 changes: 3 additions & 1 deletion man/chyves.8.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/chyves.8.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,9 @@ Usage:

* `net_ifaces`=tap{n}|vale{n}[:{p}]

**Managed through 'chyves network' commands.**
**Managed through 'chyves network' commands when 'network_design_mode' is set to 'auto'.**

**User settable when 'network_design_mode' is set to 'system'.**

Stores which tap and VALE interfaces are assigned to a guest. Where {n} is a unique interface number. Taps are process locked and can not be shared simultaneously by multiple guests. Multiple devices are stored using commas as delimiters.

Expand Down

0 comments on commit 8c709e4

Please sign in to comment.