projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto: Fix segfault sending packet_ins on transient connections.
[openvswitch]
/
xenserver
/
ovs-xenserverd.c
diff --git
a/xenserver/ovs-xenserverd.c
b/xenserver/ovs-xenserverd.c
index 72617ae1e21564bd39dde25cdad04a18fe659f48..a69ca8adb6d3d45b5fbe16c5c3ed40f2c025f8e7 100644
(file)
--- a/
xenserver/ovs-xenserverd.c
+++ b/
xenserver/ovs-xenserverd.c
@@
-162,6
+162,9
@@
static struct timespec pool_conf_mtime;
/* The executing instance of refresh-network-uuids, or NULL if none. */
static struct process *refresh_script;
/* The executing instance of refresh-network-uuids, or NULL if none. */
static struct process *refresh_script;
+/* Time at which to start the refresh script. */
+static long long int next_refresh = LLONG_MAX;
+
static void
network_uuid_refresh_run(void)
{
static void
network_uuid_refresh_run(void)
{
@@
-183,7
+186,9
@@
network_uuid_refresh_run(void)
refresh_script = NULL;
}
refresh_script = NULL;
}
- /* Otherwise, check for a change in timestamp.
+ /* Otherwise, schedule a refresh in a few seconds if the timestamp has
+ * changed. Refreshing immediately doesn't work because XAPI takes a while
+ * to switch over to new UUIDs.
*
* (We will always detect a change in timestamp when we start up. That's
* good, since it means that the refresh-network-uuids script gets
*
* (We will always detect a change in timestamp when we start up. That's
* good, since it means that the refresh-network-uuids script gets
@@
-192,9
+197,17
@@
network_uuid_refresh_run(void)
get_mtime("/etc/xensource/pool.conf", &new_mtime);
if (new_mtime.tv_sec != pool_conf_mtime.tv_sec
|| new_mtime.tv_nsec != pool_conf_mtime.tv_nsec) {
get_mtime("/etc/xensource/pool.conf", &new_mtime);
if (new_mtime.tv_sec != pool_conf_mtime.tv_sec
|| new_mtime.tv_nsec != pool_conf_mtime.tv_nsec) {
+ next_refresh = time_msec() + 10 * 1000;
+ return;
+ }
+
+ /* Otherwise, if our timer expired then start the refresh. */
+ if (time_msec() >= next_refresh) {
struct stat s;
char *argv[2];
struct stat s;
char *argv[2];
+ next_refresh = LLONG_MAX;
+
argv[0] = xasprintf("%s/scripts/refresh-network-uuids",
ovs_pkgdatadir);
argv[1] = NULL;
argv[0] = xasprintf("%s/scripts/refresh-network-uuids",
ovs_pkgdatadir);
argv[1] = NULL;
@@
-222,7
+235,12
@@
network_uuid_refresh_wait(void)
{
if (refresh_script) {
process_wait(refresh_script);
{
if (refresh_script) {
process_wait(refresh_script);
- } else if (pool_conf_mtime.tv_sec) {
- poll_timer_wait(1000);
+ } else {
+ if (pool_conf_mtime.tv_sec) {
+ poll_timer_wait(1000);
+ }
+ if (next_refresh != LLONG_MAX) {
+ poll_timer_wait(next_refresh - time_msec());
+ }
}
}
}
}