summaryrefslogtreecommitdiff
path: root/utilities/ovs-appctl.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: Use environment variable for default timeout.Ilya Maximets2018-08-151-3/+3
| | | | | | | | | | | Introduce new 'OVS_CTL_TIMEOUT' environment variable that, if set, will be used as a default timeout for OVS control utilities. Setting it in 'atlocal.in' will cover all the hangs inside the testsuite, even when utils called in a subshell. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* utilities: Fix and unify parsing of timeout option.Ilya Maximets2018-08-151-1/+6
| | | | | | | | | | | | | | Parsing of the '--timeout' option implemented differently for every single control utility and, which is more important, highly inaccurate. In most cases unsigned result of 'strtoul' stored in signed variable. Parsing failures are not tracked. 'ovs-appctl' even uses just 'atoi' without any checking of the argument or result. This patch unifies the parsing by using 'str_to_uint'. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Move lib/dynamic-string.h to include/openvswitch directoryBen Warren2016-03-191-1/+1
| | | | | Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* vlog: add "vlog/list-pattern" commandAnsis Atteka2015-06-271-0/+1
| | | | | | | | This patch allows to query logging format at the runtime for each destination with "vlog/list-pattern" command. Signed-off-by: Ansis Atteka <aatteka@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* command-line: add ovs_cmdl_ prefixRussell Bryant2015-03-161-2/+2
| | | | | | | | | | | | | | | | | The coding style guidelines include the following: - Pick a unique name prefix (ending with an underscore) for each module, and apply that prefix to all of that module's externally visible names. Names of macro parameters, struct and union members, and parameters in function prototypes are not considered externally visible for this purpose. This patch adds the new prefix to the externally visible names. This makes it a bit more obvious what code is coming from common command line handling code. Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* vlog: Rename the currently used term 'facility' as 'destination'.Gurucharan Shetty2015-01-081-1/+1
| | | | | | | | | | | | In OVS, we currently use the term 'facility' to mean the place where we log (syslog, console or file). In Linux's syslog() and rfc5424, the term 'facility' is used to specify what type of program is logging the message (e.g: LOG_DAEMON). This causes confusion while reading vlog's code. This commit changes the term 'facility' to 'destination'. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lib: Move vlog.h to <openvswitch/vlog.h>Thomas Graf2014-12-151-1/+1
| | | | | | | | A new function vlog_insert_module() is introduced to avoid using list_insert() from the vlog.h header. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-appctl: Rename 'help' to 'list-commands'.Alex Wang2014-10-281-1/+1
| | | | | | | | | | | Having 'ovs-appctl help' and 'ovs-appctl --help' print different output is confusing. This commit renames the 'help' to 'list-commands'. Also, future patches will add the 'list-commands' to other ovs-* commands, and the output will be used by bash command-line completion script. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* command-line: Add function to print all options.Alex Wang2014-10-281-0/+6
| | | | | | | | | | | This commit adds a function that prints (both long and short) options of a ovs-* command. To use this function, option '--option' is added to ovs-appctl/dpctl/ofctl and ovsdb-tool commands. A future patch will use the option output to conduct bash command-line completion. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-appctl: Add logging options.Ben Pfaff2014-08-041-2/+13
| | | | | | | | | | | | | Normally I would also add documentation for the logging options to the ovs-appctl manpage, but I am concerned that in this case it would actually make the manpage confusing, because one of the main purposes of ovs-appctl is to modify the log levels of *other* programs, and these options only modify the log level of ovs-appctl itself, which is rarely useful. The following commit will start using these logging options in a test. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ansis Atteka <aatteka@nicira.com>
* ovs-appctl: A port for Windows.Gurucharan Shetty2014-03-281-0/+7
| | | | | Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-appctl: Close the connection during error.Gurucharan Shetty2014-03-281-0/+1
| | | | | | | | When we send a wrong command to a Open vSwitch daemon, it returns an error. In that case, close the connection to the daemon. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Rename NOT_REACHED to OVS_NOT_REACHEDHarold Lim2013-12-171-2/+2
| | | | | | | | This allows other libraries to use util.h that has already defined NOT_REACHED. Signed-off-by: Harold Lim <haroldl@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Global replace of Nicira Networks.Raju Subramanian2012-05-021-1/+1
| | | | | | | | Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* unixctl: Timeout unit tests instead of hanging.Ethan Jackson2012-03-071-0/+6
| | | | | | | | We've seen some unixctl tests hang indefinitely which makes them difficult to debug. ovs-appctl and appctl.py calls to timeout instead. Signed-off-by: Ethan Jackson <ethan@nicira.com>
* unixctl: New JSON RPC back-end.Ethan Jackson2012-02-211-17/+25
| | | | | | | | | | | | | The unixctl library had used the vde2 management protocol since the early days of Open vSwitch. As Open vSwitch has matured, several Python daemons have been added to the code base which would benefit from a unixctl implementations. Instead of implementing the old unixctl protocol in Python, this patch changes unixctl to use JSON RPC for which we already have an implementation in both Python and C. Future patches will need to implement a unixctl library in Python on top of JSON RPC. Signed-off-by: Ethan Jackson <ethan@nicira.com>
* vlog: Be more liberal in syntax for -v and vlog/set.Ben Pfaff2012-02-271-6/+6
| | | | | | | | Until now, the argument to -v and vlog/set has had to take the form "module:facility:level". I can never remember the required order, so this commit switches to allowing any order. Signed-off-by: Ben Pfaff <blp@nicira.com>
* unixctl: Implement quoting.Ben Pfaff2011-12-191-13/+5
| | | | | | | | | | | | | | | | | | | The protocol used by ovs-appctl has a long-standing bug that there is no way to distinguish "ovs-appctl a b c" from "ovs-appctl 'a b c'". This isn't a big deal because none of the current commands really want to accept arguments that include spaces, but it's kind of a silly limitation. At the same time, the internal API is awkward because every user is stuck doing its own argument parsing, which is no fun. This commit fixes both problems, by adding shell-like quoting to the protocol and modifying the internal API from one that passes a string to one that passes in an array of pre-parsed strings. Command implementations may now specify how many arguments they expect. This simplifies some command implementations significantly. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovs-appctl: Add "version" command to print version of running daemons.Justin Pettit2011-08-041-1/+2
| | | | | | | When debugging a running system, we occasionally see a mismatch of different versions because someone forgets to restart one or more daemons. Often times, it would be useful to know what's running as opposed to what's on the current runpath.
* util: Introduce get_program_version function.Justin Pettit2011-08-041-1/+1
| | | | Useful in an upcoming commit.
* vlog: Add a new log level "off".Ben Pfaff2011-08-011-16/+17
| | | | | | | Until now, "emer" has effectively been "off" because no messages were ever logged at "emer" level. Justin points out that it is useful to use "emer" for messages that indicate a fatal error. This commit makes that change and adds a new "off" level to really turn off all logging to a facility.
* ovs-appctl: Fix typo in usage message.Ben Pfaff2011-06-161-1/+1
| | | | | Reported-by: Reid Price <reid@nicira.com> Bug #5978.
* Consistently write null pointer constants as NULL instead of 0.Ben Pfaff2011-05-161-2/+2
| | | | Found with sparse.
* ovs-appctl: On failure, print the error message output by the server.Ben Pfaff2010-12-081-0/+1
| | | | Otherwise failures are much more mysterious.
* Make installation directories overridable at runtime.Ben Pfaff2010-11-291-2/+2
| | | | | | | | | This makes it possible to run tests that need access to installation directories, such as the rundir, without having access to the actual installation directories (/var/run is generally not world-writable), by setting environment variables. This is not a good way to do things in general--usually it would be better to choose the correct directories at configure time--so for now this is undocumented.
* timeval: Make time_init() static and remove calls to it.Ben Pfaff2010-07-211-1/+0
| | | | | | Since the timeval module now initializes itself on-demand, there is no longer any need to initialize it explicitly, or to provide an interface to do so.
* ovs-appctl: Free memory on exit.Ben Pfaff2010-02-021-1/+5
| | | | | | This makes it easier to see real memory leaks. Found via valgrind.
* ovs-appctl: Fix shadow variable that could cause segfaultJustin Pettit2009-11-161-1/+0
| | | | | | | | | The variable "socket_name" contains the name of the unix domain socket to be used for communicating with the OVS process. If the target does not begin with a "/", the socket name is determined based on a pidfile. A shadow copy of "socket_name" was kept in the block that looks at the pidfile, which would cause the function-level one to not be set. This removes that shadow copy.
* Make ovs-appctl easier to use and synchronize its interface with ovs-vsctl.Ben Pfaff2009-11-091-140/+115
| | | | | | | | | | | | | | | | | | | | It is inconvenient to type the whole path to the Unix daemon socket when using ovs-appctl. Allow the name of the daemon to be used instead when a pidfile exists in the default location, and contact ovs-vswitchd by default. Also, the various options for manipulating vlog were invented before the general-purpose command mechanism existed. Get rid of all of the action options in favor of just specifying the command to be executed as non-option arguments. Finally, there simply wasn't much value in allowing multiple targets or options to be specified; these variations were never used in practice. So simplify the interface by making it one target, one action per invocation. Also, make ovs-vsctl use the same syntax for its --target option. Based on work by Justin Pettit.
* Update primary code license to Apache 2.0.Ben Pfaff2009-06-151-10/+10
|
* Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.v0.90.0Ben Pfaff2009-07-081-0/+221