On Thu, Mar 09, 2017 at 01:59:51PM +0000, Robert Wojciechowicz wrote: > When using vhost-user client or server mode with openstack, > neutron needs to be able to construct the fully qualified socket path > and pass it to nova. > While the relative vhost-user socket directory is exposed via > the `Open_vSwitch` table (other_config:vhost-sock-dir), > the openvswith run directory is not. > As the full socket path is the combination of the openvswitch run > directory + relative vhost-user socket dir + interface name without > exposing the run directory the full path cannot be calculated. > Since `external_ids` column is meant for storing > key-value pairs for use by external frameworks that integrate > with Open vSwitch it is a perfect place for exposing OVS > run directory. > So this patch adds to the `Open_vSwitch` table `external_ids` column > this key: > 1. ovs-run-dir - OVS run directory > > Signed-off-by: Robert Wojciechowicz <[email protected]> > Acked-by: Sean K Mooney <[email protected]> > --- > v2: > - documenting external-ids:ovs-run-dir in vswitch.xml
Thanks! I applied this to master. I made some changes to the details for better consistency with naming elsewhere and added some details to the documentation. I'm appending the patch as I applied it. --8<--------------------------cut here-------------------------->8-- From: Robert Wojciechowicz <[email protected]> Date: Thu, 9 Mar 2017 13:59:51 +0000 Subject: [PATCH] ovs-ctl: Expose openvswitch run directory through ovsdb. When using vhost-user client or server mode with OpenStack, Neutron needs to be able to construct the fully qualified socket path and pass it to Nova. While the relative vhost-user socket directory is exposed via the Open_vSwitch table in other_config:vhost-sock-dir, the openvswitch run directory that it is relative to is not. This patch adds it to the Open_vSwitch table as external_ids:rundir. Signed-off-by: Robert Wojciechowicz <[email protected]> Acked-by: Sean K Mooney <[email protected]> Signed-off-by: Ben Pfaff <[email protected]> --- utilities/ovs-ctl.in | 4 +++- vswitchd/vswitch.xml | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index e234937b1125..575ffa0394a5 100755 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2016 Nicira, Inc. +# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2016, 2017 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -110,6 +110,8 @@ set_system_ids () { set "$@" external-ids:hostname="\"$(hostname -f)\"" + set "$@" external-ids:rundir="\"$rundir\"" + if test X"$SYSTEM_TYPE" != X; then set "$@" system-type="\"$SYSTEM_TYPE\"" else diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 14297bf9ad98..870c81318317 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -77,6 +77,14 @@ qualified domain name since version 2.6.2. </column> + <column name="external_ids" key="rundir"> + In Open vSwitch 2.8 and later, the run directory of the running Open + vSwitch daemon. This directory is used for runtime state such as + control and management sockets. The value of <ref + column="other_config" key="vhost-sock-dir"/> is relative to this + directory. + </column> + <column name="other_config" key="stats-update-interval" type='{"type": "integer", "minInteger": 5000}'> <p> @@ -288,13 +296,13 @@ <column name="other_config" key="vhost-sock-dir" type='{"type": "string"}'> <p> - Specifies the path to the vhost-user unix domain socket files. This - path must exist and be a subdirectory tree of the Open vSwitch - run directory. + Specifies a relative path from <ref column="external_ids" + key="rundir"/> to the vhost-user unix domain socket files. If this + value is unset, the sockets are put directly in <ref + column="external_ids" key="rundir"/>. </p> <p> - Defaults to the working directory of the application. Changing this - value requires restarting the daemon. + Changing this value requires restarting the daemon. </p> </column> -- 2.10.2 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
