From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
xen-devel@lists.xensource.com, Wei Liu <wei.liu2@citrix.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
hanyandong <hanyandong@iie.ac.cn>
Subject: Re: [PATCH for-4.5] libxl: do not load roms for any NICs except the first to avoid wasting memory
Date: Fri, 21 Nov 2014 14:07:57 -0500 [thread overview]
Message-ID: <20141121190757.GA16038@laptop.dumpdata.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1411211811010.2675@kaball.uk.xensource.com>
On Fri, Nov 21, 2014 at 06:48:53PM +0000, Stefano Stabellini wrote:
> On Fri, 21 Nov 2014, Konrad Rzeszutek Wilk wrote:
> > On Fri, Nov 21, 2014 at 05:11:09PM +0000, Stefano Stabellini wrote:
> > > The rom is used for pxebooting. We don't need to allow pxebooting from
> > > more than one network card. Loading a romfile for every NIC wastes
> >
> > Why not? Why can't we PXE boot from each network card?
>
> I take it back: you are right, at the moment it is actually possible to
> pxe boot from the fourth nic for example. Maybe we could just load the
> first four romfiles and skip the others (four is the limit before QEMU
> fails to allocate any more memory).
The limit is in the count of ROMs or the memory consumption? What if you
also do PCI passthrough? Does that figure in this calculation?
>
> TBH not all the emulated nics need a romfile but I wouldn't want to go
> down at that level of details beause they become QEMU implementation
> details. I wouldn't want to tie libxl to a certain version of QEMU in
> any way.
>
> A better way would be handling memory allocation errors in QEMU but QEMU
> doesn't do that at the moment and the change there would be certainly
> more invasive that a couple of lines in libxl.
>
>
> > > memory and as a matter of fact breaks configurations with more than 4
> > > NICs as QEMU fails to allocate memory on behalf of the guest.
> >
> > What if you have four different type of NICs? Say 1 rlt8193, 1 e1000, one eepro,
> > and ne2k ?
> >
> > Don't you want to load the ROM for each one?
>
> The rom cannot be reused in QEMU among multiple instances of the same
> nic, so having four different types of nics or just one type doesn't
> change anything.
>
>
> > > With this fix, it is possible to assign more than 4 rtl8139 NICs to the
> > > guest.
> > >
> > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > >
> > > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> > > index 3e191c3..f907ca9 100644
> > > --- a/tools/libxl/libxl_dm.c
> > > +++ b/tools/libxl/libxl_dm.c
> > > @@ -674,9 +674,10 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
> > > LIBXL_NIC_TYPE_VIF_IOEMU);
> > > flexarray_append(dm_args, "-device");
> > > flexarray_append(dm_args,
> > > - libxl__sprintf(gc, "%s,id=nic%d,netdev=net%d,mac=%s",
> > > + libxl__sprintf(gc, "%s,id=nic%d,netdev=net%d,mac=%s%s",
> > > nics[i].model, nics[i].devid,
> > > - nics[i].devid, smac));
> > > + nics[i].devid, smac,
> > > + i ? ",romfile=\"\"" : ""));
> > > flexarray_append(dm_args, "-netdev");
> > > flexarray_append(dm_args, GCSPRINTF(
> > > "type=tap,id=net%d,ifname=%s,"
> > >
> > > _______________________________________________
> > > Xen-devel mailing list
> > > Xen-devel@lists.xen.org
> > > http://lists.xen.org/xen-devel
> >
next prev parent reply other threads:[~2014-11-21 19:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1ac72b0.26f7c.149ae18f6bb.Coremail.hanyandong@iie.ac.cn>
[not found] ` <1415967767.7113.19.camel@citrix.com>
[not found] ` <a0cc29.27c3f.149b13c965c.Coremail.hanyandong@iie.ac.cn>
[not found] ` <1416217990.27385.10.camel@citrix.com>
[not found] ` <alpine.DEB.2.02.1411171237340.26318@kaball.uk.xensource.com>
2014-11-20 9:13 ` Number of NICs per VM with qemu-upstream (Was: Re: Re: [Xen-users] libvirt <emulator> /usr/local/lib/xen/bin/qemu-dm <emulator> did not work on xen-4.4) Ian Campbell
2014-11-20 11:39 ` Stefano Stabellini
2014-11-20 11:42 ` Ian Campbell
2014-11-20 14:46 ` Stefano Stabellini
2014-11-20 14:49 ` Ian Campbell
2014-11-20 16:14 ` Stefano Stabellini
2014-11-21 17:11 ` [PATCH for-4.5] libxl: do not load roms for any NICs except the first to avoid wasting memory Stefano Stabellini
2014-11-21 17:34 ` Konrad Rzeszutek Wilk
2014-11-21 18:48 ` Stefano Stabellini
2014-11-21 19:07 ` Konrad Rzeszutek Wilk [this message]
2014-11-24 12:17 ` Stefano Stabellini
2014-11-24 15:06 ` Konrad Rzeszutek Wilk
2014-11-24 15:26 ` Stefano Stabellini
2014-11-24 15:46 ` Konrad Rzeszutek Wilk
2014-11-24 16:09 ` Don Slutz
2014-11-24 17:07 ` Stefano Stabellini
2014-11-24 20:35 ` Don Slutz
2014-11-25 12:21 ` Stefano Stabellini
2014-11-20 14:52 ` Number of NICs per VM with qemu-upstream (Was: Re: Re: [Xen-users] libvirt <emulator> /usr/local/lib/xen/bin/qemu-dm <emulator> did not work on xen-4.4) Ian Campbell
2014-11-20 15:15 ` Processed: " xen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141121190757.GA16038@laptop.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=hanyandong@iie.ac.cn \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.