[libvirt] [PATCH] Remove MAX_TAP_ID, take 3
Daniel Veillard
veillard at redhat.com
Thu Jul 30 07:18:02 UTC 2009
On Wed, Jul 29, 2009 at 10:56:48PM -0400, Aron Griffis wrote:
> Matthias Bolte wrote: [Wed Jul 29 2009, 08:58:18PM EDT]
> > 2009/7/29 Daniel Veillard <veillard at redhat.com>:
> > > On Wed, Jul 29, 2009 at 08:05:37PM +0200, Daniel Veillard wrote:
> > >> On Wed, Jul 29, 2009 at 12:52:30PM -0400, Aron Griffis wrote:
> > >> > This is a resend of take 2 to fix formatting problems in the
> > >> > patch. No other changes.
> > >> >
> > >> > As far as I can tell, there's no reason to format the device
> > >> > string in brAddTap(). Delegate the job to TUNSETIFF, thereby
> > >> > removing the loop and the MAX_TAP_ID artificial limit. This
> > >> > patch allows me to get 421 guests running before hitting other
> > >> > limits.
> > >>
> > >> haha ! that one worked :-)
> > >>
> > >> I will review and apply, thanks !
> > >
> > > Actually just looking at brAddTap() after patching makes it clear,
> > > and based on Mark and Dan feedback great !
> > > Applied and commited to git, thanks !
> > >
> > > Daniel
> >
> > This patch breaks -Werror, because GCC is unhappy with the initializer
> > for ifreq.
Sorry I should have caught that
> Maybe instead of the nested curlies, we should revert to memset
> as it was doing previously:
>
> diff --git a/src/bridge.c b/src/bridge.c
> index ec37192..58e480e 100644
> --- a/src/bridge.c
> +++ b/src/bridge.c
> @@ -465,7 +465,7 @@ brAddTap(brControl *ctl,
> int *tapfd)
> {
> int fd, len;
> - struct ifreq ifr = {0};
> + struct ifreq ifr;
>
> if (!ctl || !ctl->fd || !bridge || !ifname)
> return EINVAL;
> @@ -473,6 +473,8 @@ brAddTap(brControl *ctl,
> if ((fd = open("/dev/net/tun", O_RDWR)) < 0)
> return errno;
>
> + memset(&ifr, 0, sizeof(ifr));
> +
> ifr.ifr_flags = IFF_TAP|IFF_NO_PI;
yeah the memset was the status quo before, let's go back to using
this. Applied and commited, thanks !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel at veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
More information about the libvir-list
mailing list