libvirtd: add openvitch timeout value

Provide the ability to specify a default timeout value for
successful completion of openvswitch calls in the libvirtd
configuration file.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Boris Fiuczynski 2017-02-07 16:16:42 +01:00 committed by Michal Privoznik
parent 0857a3bf5c
commit 66583c0cf7
6 changed files with 20 additions and 0 deletions

View File

@ -32,6 +32,7 @@
#include "configmake.h"
#include "remote/remote_protocol.h"
#include "remote/remote_driver.h"
#include "util/virnetdevopenvswitch.h"
#include "virstring.h"
#include "virutil.h"
@ -170,6 +171,8 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
data->admin_keepalive_interval = 5;
data->admin_keepalive_count = 5;
data->ovs_timeout = VIR_NETDEV_OVS_DEFAULT_TIMEOUT;
localhost = virGetHostname();
if (localhost == NULL) {
/* we couldn't resolve the hostname; assume that we are
@ -388,6 +391,9 @@ daemonConfigLoadOptions(struct daemonConfig *data,
if (virConfGetValueUInt(conf, "admin_keepalive_count", &data->admin_keepalive_count) < 0)
goto error;
if (virConfGetValueUInt(conf, "ovs_timeout", &data->ovs_timeout) < 0)
goto error;
return 0;
error:

View File

@ -92,6 +92,8 @@ struct daemonConfig {
int admin_keepalive_interval;
unsigned int admin_keepalive_count;
unsigned int ovs_timeout;
};

View File

@ -88,6 +88,7 @@ module Libvirtd =
let misc_entry = str_entry "host_uuid"
| str_entry "host_uuid_source"
| int_entry "ovs_timeout"
(* Each enty in the config is one of the following three ... *)
let entry = network_entry

View File

@ -467,3 +467,12 @@
# Keepalive settings for the admin interface
#admin_keepalive_interval = 5
#admin_keepalive_count = 5
###################################################################
# Open vSwitch:
# This allows to specify a timeout for openvswitch calls made by
# libvirt. The ovs-vsctl utility is used for the configuration and
# its timeout option is set by default to 5 seconds to avoid
# potential infinite waits blocking libvirt.
#
#ovs_timeout = 5

View File

@ -63,3 +63,4 @@ module Test_libvirtd =
{ "admin_keepalive_required" = "1" }
{ "admin_keepalive_interval" = "5" }
{ "admin_keepalive_count" = "5" }
{ "ovs_timeout" = "5" }

View File

@ -29,6 +29,7 @@
# include "virnetdevvportprofile.h"
# include "virnetdevvlan.h"
# define VIR_NETDEV_OVS_DEFAULT_TIMEOUT 5
int virNetDevOpenvswitchAddPort(const char *brname,
const char *ifname,