]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
network: fix virtual network bridge delay setting
authorLaine Stump <laine@laine.org>
Thu, 23 Aug 2012 15:21:47 +0000 (11:21 -0400)
committerLaine Stump <laine@laine.org>
Thu, 23 Aug 2012 18:27:53 +0000 (14:27 -0400)
libvirt's network config documents that a bridge's STP "forward delay"
(called "delay" in the XML) should be specified in seconds, but
virNetDevBridgeSetSTPDelay() assumes that it is given a delay in
milliseconds (although the comment at the top of the function
incorrectly says "seconds".

This fixes the comment, and converts the delay to milliseconds before
calling virNetDevBridgeSetSTPDelay().

src/network/bridge_driver.c
src/util/virnetdevbridge.c

index 59b2c10784e02178e460e8915920209f7c473314..53eebed2e821359494763f6ce50969abf74600e8 100644 (file)
@@ -1826,8 +1826,12 @@ networkStartNetworkVirtual(struct network_driver *driver,
     }
 
     /* Set bridge options */
+
+    /* delay is configured in seconds, but virNetDevBridgeSetSTPDelay
+     * expects milliseconds
+     */
     if (virNetDevBridgeSetSTPDelay(network->def->bridge,
-                          network->def->delay) < 0)
+                                   network->def->delay * 1000) < 0)
         goto err1;
 
     if (virNetDevBridgeSetSTP(network->def->bridge,
index a616d8e3b2c64668ff42d569c0bcbdb2b646a7ea..7b11beecf314598d2626e0498bb62353cdf84920 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Red Hat, Inc.
+ * Copyright (C) 2007-2012 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -378,7 +378,7 @@ int virNetDevBridgeRemovePort(const char *brname,
 /**
  * virNetDevBridgeSetSTPDelay:
  * @brname: the bridge name
- * @delay: delay in seconds
+ * @delay: delay in milliseconds
  *
  * Set the bridge forward delay
  *