]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libvirtd: add openvitch timeout value
authorBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Tue, 7 Feb 2017 15:16:42 +0000 (16:16 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 9 Feb 2017 13:34:08 +0000 (14:34 +0100)
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>
daemon/libvirtd-config.c
daemon/libvirtd-config.h
daemon/libvirtd.aug
daemon/libvirtd.conf
daemon/test_libvirtd.aug.in
src/util/virnetdevopenvswitch.h

index b4691898b94648158384ce7049cf62bd47fcfb14..6c0f00ed8eea4771bc32adc5a9b6fdb27f9a2863 100644 (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:
index ad3e80a51f74a680a535ff41e22eb49719129b74..1edf5fadb8cc5cc426c8525c4e550a8b0f2718a4 100644 (file)
@@ -92,6 +92,8 @@ struct daemonConfig {
 
     int admin_keepalive_interval;
     unsigned int admin_keepalive_count;
+
+    unsigned int ovs_timeout;
 };
 
 
index 2b8df663565407f5c55a1de9e9b0e17bf134e5a4..24fdf445ca94fd5180ad820f7a923a1e66578c0b 100644 (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
index 846661612079fb499d27b58bd2d9a5eee2b976e9..e83e9a1c10c25d98c92af5a5bbb442360734bc42 100644 (file)
 # 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
index 1fb182c6828223d4f19a872a4828e34927a5e7d0..12009528f664563f0c776e5f59f2fbbe2ef0bfa7 100644 (file)
@@ -63,3 +63,4 @@ module Test_libvirtd =
         { "admin_keepalive_required" = "1" }
         { "admin_keepalive_interval" = "5" }
         { "admin_keepalive_count" = "5" }
+        { "ovs_timeout" = "5" }
index 8f5faf14ed2137a1c671ffd3ae19115a342febc2..01f6233c516e76cbc01b4f639b98fadb5713409b 100644 (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,