From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk 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 12:34:37 -0500 Message-ID: <20141121173437.GA14331@laptop.dumpdata.com> References: <1415967767.7113.19.camel@citrix.com> <1416217990.27385.10.camel@citrix.com> <1416474814.29243.59.camel@citrix.com> <1416483731.14429.8.camel@citrix.com> <1416494946.14429.13.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Ian Jackson , xen-devel@lists.xensource.com, Wei Liu , Ian Campbell , hanyandong List-Id: xen-devel@lists.xenproject.org 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? > 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? > > With this fix, it is possible to assign more than 4 rtl8139 NICs to the > guest. > > Signed-off-by: Stefano Stabellini > > 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