netdev-dpdk: Print default vhost-sock-dir value & update documentation
authorCiara Loftus <ciara.loftus@intel.com>
Fri, 6 May 2016 10:20:34 +0000 (11:20 +0100)
committerBen Pfaff <blp@ovn.org>
Fri, 6 May 2016 22:37:50 +0000 (15:37 -0700)
When no vhost-sock-dir value is provided, print the default location.
Update the documentation to reflect the fact that vhost-sock-dir values
are now subdirectory loctions rather than full paths.

Fixes: d8a8f353c23e ("netdev-dpdk: Restrict vhost_sock_dir")
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
INSTALL.DPDK.md
lib/netdev-dpdk.c

index 38da3bc..93f92e4 100644 (file)
@@ -585,12 +585,12 @@ in the names.
      `/usr/local/var/run/openvswitch/vhost-user-1`, which you must provide
      to your VM on the QEMU command line. More instructions on this can be
      found in the next section "DPDK vhost-user VM configuration"
-  - If you wish for the vhost-user sockets to be created in a directory other
-    than `/usr/local/var/run/openvswitch`, you may specify another location
-    in the ovsdb like so:
+  - If you wish for the vhost-user sockets to be created in a sub-directory of
+    `/usr/local/var/run/openvswitch`, you may specify this directory in the
+    ovsdb like so:
 
       `./utilities/ovs-vsctl --no-wait \
-        set Open_vSwitch . other_config:vhost-sock-dir=path`
+        set Open_vSwitch . other_config:vhost-sock-dir=subdir`
 
 DPDK vhost-user VM configuration:
 ---------------------------------
index 8040866..af86d19 100644 (file)
@@ -3100,7 +3100,7 @@ dpdk_init__(const struct smap *ovs_other_config)
     if (process_vhost_flags("cuse-dev-name", xstrdup("vhost-net"),
                             PATH_MAX, ovs_other_config, &cuse_dev_name)) {
 #else
-    if (process_vhost_flags("vhost-sock-dir", xstrdup(""),
+    if (process_vhost_flags("vhost-sock-dir", xstrdup(ovs_rundir()),
                             NAME_MAX, ovs_other_config,
                             &sock_dir_subcomponent)) {
         struct stat s;
@@ -3121,8 +3121,7 @@ dpdk_init__(const struct smap *ovs_other_config)
         }
         free(sock_dir_subcomponent);
     } else {
-        vhost_sock_dir = xstrdup(ovs_rundir());
-        free(sock_dir_subcomponent);
+        vhost_sock_dir = sock_dir_subcomponent;
 #endif
     }