Browse Source

use vhostuser client

Change-Id: I03da21aceeba7db97b28ce90aabed7eb6e06256c
Itsuro Oda 1 year ago
parent
commit
3a2a832909

+ 1
- 5
networking_lagopus/ml2/agent/lagopus_agent.py View File

@@ -11,7 +11,6 @@
11 11
 #    under the License.
12 12
 
13 13
 import eventlet
14
-import os
15 14
 import socket
16 15
 import sys
17 16
 
@@ -155,8 +154,6 @@ class LagopusManager(object):
155 154
             if interface.type == lg_lib.INTERFACE_TYPE_VHOST:
156 155
                 self.num_vhost += 1
157 156
                 if not interface.is_used:
158
-                    sock_path = self._sock_path(interface.id)
159
-                    os.system("sudo chmod 777 %s" % sock_path)
160 157
                     self.free_vhost_interfaces.append(interface)
161 158
             elif interface.type == lg_lib.INTERFACE_TYPE_PIPE:
162 159
                 # only interested in even number
@@ -288,11 +285,10 @@ class LagopusManager(object):
288 285
     def create_vhost_interface(self, vhost_id):
289 286
         i_name = self.interfaces.mk_name(lg_lib.INTERFACE_TYPE_VHOST, vhost_id)
290 287
         sock_path = self._sock_path(vhost_id)
291
-        device = "eth_vhost%d,iface=%s" % (vhost_id, sock_path)
288
+        device = "eth_vhost%d,iface=%s,client=1" % (vhost_id, sock_path)
292 289
         interface = self.interfaces.create(i_name, lg_lib.DEVICE_TYPE_PHYS,
293 290
                                            device)
294 291
         LOG.debug("vhost %d added.", vhost_id)
295
-        os.system("sudo chmod 777 %s" % sock_path)
296 292
         return interface
297 293
 
298 294
     def get_vhost_interface(self):

+ 1
- 1
networking_lagopus/ml2/mech_driver/mech_lagopus.py View File

@@ -52,7 +52,7 @@ class LagopusMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
52 52
                 # use vhostuser for VM
53 53
                 vif_type = portbindings.VIF_TYPE_VHOST_USER
54 54
                 vif_details[portbindings.VHOST_USER_MODE] = (
55
-                    portbindings.VHOST_USER_MODE_CLIENT)
55
+                    portbindings.VHOST_USER_MODE_SERVER)
56 56
 
57 57
                 sock_path = self.lagopus_api.plug_vhost(
58 58
                     self.context, context.current['id'],

Loading…
Cancel
Save