ovs-xenserverd: Fix time-delay logic.
authorBen Pfaff <blp@nicira.com>
Thu, 3 Jun 2010 18:41:43 +0000 (11:41 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 4 Jun 2010 17:10:03 +0000 (10:10 -0700)
network_uuid_refresh_run() needs to update pool_conf_mtime as soon as it
notices a change.  Otherwise it thinks that the mtime has changed every
time it is called and therefore never actually runs the refresh script.

Bug #2097.

xenserver/ovs-xenserverd.c

index 1598b01bfc4534fcee2847f2462c886a9239bc19..d2dab51b85adc3808d2aaab1fd06419620d67f83 100644 (file)
@@ -197,6 +197,7 @@ 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) {
+        pool_conf_mtime = new_mtime;
         next_refresh = time_msec() + 10 * 1000;
         return;
     }
@@ -225,7 +226,6 @@ network_uuid_refresh_run(void)
                      argv[0], strerror(errno));
         }
 
-        pool_conf_mtime = new_mtime;
         free(argv[0]);
     }
 }