[Kimchi-devel] [PATCH v2] [Kimchi 3/3] Adding 'passthrough' forward mode to Macvtap: UI changes

dhbarboza82 at gmail.com dhbarboza82 at gmail.com
Wed May 18 19:32:43 UTC 2016


From: Daniel Henrique Barboza <danielhb at 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 at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.network.js          |  1 +
 ui/js/src/kimchi.network_add_main.js | 12 ++++++++++--
 ui/pages/network-add.html.tmpl       |  3 ++-
 3 files changed, 13 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 e12f1df..722acfc 100644
--- a/ui/js/src/kimchi.network_add_main.js
+++ b/ui/js/src/kimchi.network_add_main.js
@@ -38,6 +38,10 @@ 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) {
+        network.type = 'macvtap';
+        data.connection = 'macvtap';
+        data.forward_mode = 'passthrough';
     }
 
     kimchi.createNetwork(data, function(result) {
@@ -86,7 +90,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 +116,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




More information about the Kimchi-devel mailing list