From: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
A new network type was added to distinguish between the
Macvtap forward modes 'bridge' and 'passthrough'.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.network.js | 1 +
ui/js/src/kimchi.network_add_main.js | 11 +++++++++--
ui/pages/network-add.html.tmpl | 3 ++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index d362010..3e8ed33 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -17,6 +17,7 @@
*/
kimchi.NETWORK_TYPE_MACVTAP = "macvtap";
+kimchi.NETWORK_TYPE_MACVTAP_PASSTHROUGH = "passthrough";
kimchi.NETWORK_TYPE_BRIDGED = "bridge";
kimchi.NETWORK_TYPE_VEPA = "vepa";
diff --git a/ui/js/src/kimchi.network_add_main.js b/ui/js/src/kimchi.network_add_main.js
index 4eb5c5b..f5fe6d4 100644
--- a/ui/js/src/kimchi.network_add_main.js
+++ b/ui/js/src/kimchi.network_add_main.js
@@ -38,6 +38,9 @@ kimchi.startNetworkCreation = function() {
// in VEPA connection case, network.interface is already an array
if (data.connection === kimchi.NETWORK_TYPE_VEPA) {
data.interfaces = network.interface;
+ } else if (data.connection === kimchi.NETWORK_TYPE_MACVTAP_PASSTHROUGH) {
+ data.connection = 'macvtap';
+ data.forward_mode = 'passthrough';
}
kimchi.createNetwork(data, function(result) {
@@ -86,7 +89,9 @@ kimchi.getNetworkDialogValues = function() {
name : $("#networkName").val(),
type : $("#networkType").val()
};
- if (network.type === kimchi.NETWORK_TYPE_MACVTAP || network.type ===
kimchi.NETWORK_TYPE_VEPA) {
+ if (network.type === kimchi.NETWORK_TYPE_MACVTAP ||
+ network.type === kimchi.NETWORK_TYPE_MACVTAP_PASSTHROUGH ||
+ network.type === kimchi.NETWORK_TYPE_VEPA) {
network.interface = $("#networkDestinationID").val();
}
if (network.type === kimchi.NETWORK_TYPE_BRIDGED) {
@@ -110,7 +115,9 @@ kimchi.setupNetworkFormEvent = function() {
$('#networkType').on('change', function() {
var selectedType = $("#networkType").val();
- if(selectedType === kimchi.NETWORK_TYPE_MACVTAP || selectedType ===
kimchi.NETWORK_TYPE_VEPA) {
+ if(selectedType === kimchi.NETWORK_TYPE_MACVTAP ||
+ selectedType === kimchi.NETWORK_TYPE_MACVTAP_PASSTHROUGH ||
+ selectedType === kimchi.NETWORK_TYPE_VEPA) {
if (selectedType === kimchi.NETWORK_TYPE_VEPA){
$('#networkDestinationID').attr('multiple', true);
if($('#networkDestinationID option').length > 10 ) {
diff --git a/ui/pages/network-add.html.tmpl b/ui/pages/network-add.html.tmpl
index 7a2fadb..4192c79 100644
--- a/ui/pages/network-add.html.tmpl
+++ b/ui/pages/network-add.html.tmpl
@@ -40,7 +40,8 @@
<select id="networkType" class="selectpicker col-md-12
col-lg-12">
<option value="isolated">$_("Isolated: no external
network connection")</option>
<option value="nat">$_("NAT: outbound physical
network connection only")</option>
- <option value="macvtap">$_("Macvtap: Virtual
machines are connected to physical network directly")</option>
+ <option value="macvtap">$_("Macvtap (bridged mode):
Virtual machines are connected to physical network directly")</option>
+ <option value="passthrough">$_("Macvtap (passthrough
mode): Network device will be passthrough to the virtual machines.")</option>
<option value="vepa">$_("VEPA: special mode where
virtual machines are connected to a VEPA-enabled switch")</option>
<option value="bridge">$_("Bridged: Virtual machines
are connected through a network bridge")</option>
</select>
--
2.5.5