From: Boris Fiuczynski Date: Tue, 7 Feb 2017 15:16:44 +0000 (+0100) Subject: libvirtd: set openvswitch timeout value based on config data X-Git-Tag: CVE-2017-2635~145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e036ab0c223439e375f4799e46a846b37d02cdf;p=thirdparty%2Flibvirt.git libvirtd: set openvswitch timeout value based on config data Since a successful completion of the calls to openvswitch is expected a longer timeout should be able to be chosen to account for loaded systems. Therefore this patch provides the ability to specify the timeout value for openvswitch calls in the libvirtd configuration file. Signed-off-by: Boris Fiuczynski Reviewed-by: Bjoern Walk --- diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index b6d76ed84b..5c30c9e746 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -58,6 +58,7 @@ #include "viraccessmanager.h" #include "virutil.h" #include "virgettext.h" +#include "util/virnetdevopenvswitch.h" #ifdef WITH_DRIVER_MODULES # include "driver.h" @@ -657,6 +658,16 @@ daemonSetupNetworking(virNetServerPtr srv, } +/* + * Set up the openvswitch timeout + */ +static void +daemonSetupNetDevOpenvswitch(struct daemonConfig *config) +{ + virNetDevOpenvswitchSetTimeout(config->ovs_timeout); +} + + /* * Set up the logging environment * By default if daemonized all errors go to the logfile libvirtd.log, @@ -1267,6 +1278,8 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } + daemonSetupNetDevOpenvswitch(config); + if (daemonSetupAccessManager(config) < 0) { VIR_ERROR(_("Can't initialize access manager")); exit(EXIT_FAILURE);