[libvirt] PATCH: Fix setting of bridge forward-delay

The libvirt virtual networking allows setting of the forward-delay parameter. This is the delay the kernel inserts before it starts forwarding traffic when a guest VIF is added to a bridge. The default network config sets this to zero, and previously we had a bug where we accidentally called brSetForwardDelay() based on the STP parameter which was zero, so we did in fact have a forward delay of 0 as desired. Rich then fixed this bug, and thus we no longer accidentally call the brSetForardDelay() method. Unfortuntely the place where we *do* delibrately call it is conditionalized on if (network->def->delay So if you set a forward delay of zero, we never explicitly set this on the bridge. Thus the kernel's default setting applies which is 15 seconds. The fix is trivial - just remove the conditional. So previously you could see traffic forwaarding delayed by the kernel for 30 seconds Aug 1 11:34:16 t60wlan kernel: device vnet0 entered promiscuous mode Aug 1 11:34:16 t60wlan kernel: virbr0: port 1(vnet0) entering listening state Aug 1 11:34:31 t60wlan kernel: virbr0: port 1(vnet0) entering learning state Aug 1 11:34:46 t60wlan kernel: virbr0: topology change detected, propagating Aug 1 11:34:46 t60wlan kernel: virbr0: port 1(vnet0) entering forwarding state Now it applies immediately Aug 1 11:40:07 t60wlan kernel: device vnet0 entered promiscuous mode Aug 1 11:40:07 t60wlan kernel: virbr0: port 1(vnet0) entering listening state Aug 1 11:40:07 t60wlan kernel: virbr0: port 1(vnet0) entering learning state Aug 1 11:40:07 t60wlan kernel: virbr0: topology change detected, propagating Aug 1 11:40:07 t60wlan kernel: virbr0: port 1(vnet0) entering forwarding state Daniel Index: src/qemu_driver.c =================================================================== RCS file: /data/cvs/libvirt/src/qemu_driver.c,v retrieving revision 1.98 diff -u -r1.98 qemu_driver.c --- src/qemu_driver.c 30 Jul 2008 09:20:19 -0000 1.98 +++ src/qemu_driver.c 1 Aug 2008 10:46:36 -0000 @@ -1480,8 +1480,7 @@ } - if (network->def->delay && - (err = brSetForwardDelay(driver->brctl, network->def->bridge, network->def->delay))) { + if ((err = brSetForwardDelay(driver->brctl, network->def->bridge, network->def->delay))) { qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, _("failed to set bridge forward delay to %ld"), network->def->delay); -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, Aug 01, 2008 at 11:46:59AM +0100, Daniel P. Berrange wrote:
The fix is trivial - just remove the conditional.
ACK that one. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my OCaml programming blog: http://camltastic.blogspot.com/ Fedora now supports 59 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora

On Fri, Aug 01, 2008 at 11:46:59AM +0100, Daniel P. Berrange wrote:
The libvirt virtual networking allows setting of the forward-delay parameter. This is the delay the kernel inserts before it starts forwarding traffic when a guest VIF is added to a bridge. The default network config sets this to zero, and previously we had a bug where we accidentally called brSetForwardDelay() based on the STP parameter which was zero, so we did in fact have a forward delay of 0 as desired. [...] - if (network->def->delay && - (err = brSetForwardDelay(driver->brctl, network->def->bridge, network->def->delay))) { + if ((err = brSetForwardDelay(driver->brctl, network->def->bridge, network->def->delay))) { qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, _("failed to set bridge forward delay to %ld"), network->def->delay);
Oh ! Sure +1 ! BTW you're hinting at a new release and I agree, the last push was June 25 it was a good release but it sounds like time to make a new push. Should we wait for the LXC refactoring ? Anything else waiting ? Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Aug 01, 2008 at 06:55:32AM -0400, Daniel Veillard wrote:
BTW you're hinting at a new release and I agree, the last push was June 25 it was a good release but it sounds like time to make a new push. Should we wait for the LXC refactoring ? Anything else waiting ?
I would like to get 'virsh edit' in. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my OCaml programming blog: http://camltastic.blogspot.com/ Fedora now supports 59 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora

On Fri, Aug 01, 2008 at 12:22:35PM +0100, Richard W.M. Jones wrote:
On Fri, Aug 01, 2008 at 06:55:32AM -0400, Daniel Veillard wrote:
BTW you're hinting at a new release and I agree, the last push was June 25 it was a good release but it sounds like time to make a new push. Should we wait for the LXC refactoring ? Anything else waiting ?
I would like to get 'virsh edit' in.
Well, push it :-) ! I expect to still be busy with libxml2 for the end of the week and maybe a bit more next week, so you have a couple of days at least ... Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Fri, Aug 01, 2008 at 07:30:31AM -0400, Daniel Veillard wrote:
On Fri, Aug 01, 2008 at 12:22:35PM +0100, Richard W.M. Jones wrote:
On Fri, Aug 01, 2008 at 06:55:32AM -0400, Daniel Veillard wrote:
BTW you're hinting at a new release and I agree, the last push was June 25 it was a good release but it sounds like time to make a new push. Should we wait for the LXC refactoring ? Anything else waiting ?
I would like to get 'virsh edit' in.
Well, push it :-) !
Well, there's a new version I posted this morning. May need some checking: https://www.redhat.com/archives/libvir-list/2008-August/msg00018.html Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

On Fri, Aug 01, 2008 at 06:55:32AM -0400, Daniel Veillard wrote:
On Fri, Aug 01, 2008 at 11:46:59AM +0100, Daniel P. Berrange wrote:
The libvirt virtual networking allows setting of the forward-delay parameter. This is the delay the kernel inserts before it starts forwarding traffic when a guest VIF is added to a bridge. The default network config sets this to zero, and previously we had a bug where we accidentally called brSetForwardDelay() based on the STP parameter which was zero, so we did in fact have a forward delay of 0 as desired. [...] - if (network->def->delay && - (err = brSetForwardDelay(driver->brctl, network->def->bridge, network->def->delay))) { + if ((err = brSetForwardDelay(driver->brctl, network->def->bridge, network->def->delay))) { qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, _("failed to set bridge forward delay to %ld"), network->def->delay);
Oh ! Sure +1 ! BTW you're hinting at a new release and I agree, the last push was June 25 it was a good release but it sounds like time to make a new push. Should we wait for the LXC refactoring ? Anything else waiting ?
The Xen & QEMU refactoring needs more testing - we've had a good few bug reports about it this week, and I'm sure there's more pending. Also, since the LXC and OpenVZ drivers are now on by default we need to finish porting them to the new XML routines so they are compliant with the official XML schema. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, Aug 01, 2008 at 12:25:03PM +0100, Daniel P. Berrange wrote:
On Fri, Aug 01, 2008 at 06:55:32AM -0400, Daniel Veillard wrote:
BTW you're hinting at a new release and I agree, the last push was June 25 it was a good release but it sounds like time to make a new push. Should we wait for the LXC refactoring ? Anything else waiting ?
The Xen & QEMU refactoring needs more testing - we've had a good few bug reports about it this week, and I'm sure there's more pending.
Also, since the LXC and OpenVZ drivers are now on by default we need to finish porting them to the new XML routines so they are compliant with the official XML schema.
Okay let's give it another week or so, but we should not wait too long. Evgeniy you think you should be able to make an update patch switching to the new parser infrastructure next week ? Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Richard W.M. Jones