aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/impl_eni.py
diff options
context:
space:
mode:
authorBrent Eagles <beagles@redhat.com>2016-11-07 17:57:02 -0330
committerBrent Eagles <beagles@redhat.com>2016-11-18 14:38:45 -0330
commit433a0f3cbe59fd5da183245bf7e6dcd4af4b8c88 (patch)
treea70bd0e53a3b73bb5c350982459b048d2dbc8c79 /os_net_config/impl_eni.py
parent9971eb3af988b1f7c003048af161489ab79b1b0c (diff)
Add support for enabling hotplug on interfaces
This patch adds support for enabling hotplugging on interfaces (disabled by default). This is useful for configuring SR-IOV root devices so that they "return" to the system when no longer used by a VM. Note: also updates an invalid value in the interface and ib_interface sample files. Partial-Bug: #1639901 Change-Id: Idfc17d6f20bb306271838895bc53f4b109dd664d
Diffstat (limited to 'os_net_config/impl_eni.py')
-rw-r--r--os_net_config/impl_eni.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/os_net_config/impl_eni.py b/os_net_config/impl_eni.py
index 5b91270..c6252ce 100644
--- a/os_net_config/impl_eni.py
+++ b/os_net_config/impl_eni.py
@@ -127,7 +127,10 @@ class ENINetConfig(os_net_config.NetConfig):
data += address_data
data += " vlan-raw-device %s\n" % interface.device
else:
- data += "auto %s\n" % interface.name
+ if isinstance(interface, objects.Interface) and interface.hotplug:
+ data += "allow-hotplug %s\n" % interface.name
+ else:
+ data += "auto %s\n" % interface.name
data += _iface
data += address_data
if interface.mtu: