From patchwork Fri Nov 21 17:11:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 41335 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C810623C27 for ; Fri, 21 Nov 2014 17:29:14 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf2497593lbv.1 for ; Fri, 21 Nov 2014 09:29:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:in-reply-to:message-id :references:user-agent:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=N+gpw26excswkLgWrBuDzjZNisMXf1tfTs6V4og2LnY=; b=EJQiwsIWplFziyyoHbd4A8Y2WWDF8qRJbBO01lXz2zhaRHMfUzq9a6jJRIq0o53ekz V2R0PTxz49un3bdNisXdWtybQ7IH7/ff1D1CAgieQtL0aJGclN2HuvN9SG95R3HcTJ9x 5qg7GVuyTnKMJtNgGbYN7+xnoQ9doZYZSdvjUHvHIdDHSNv1PnddNBnUFfaeahjBkez2 Hj1yv68P1Vn0NovJYYFSGgCRqWSLIwJXMnDM0/89OhpA/ENoWEAZJTpBq+62DJN0ylZm CTZhiiFSu6cWvEiNKpK0IkHScBdybkgf0KzhmqhedU56FEWZvDbudtVTi2KEVgJ2Q5eF R9oQ== X-Gm-Message-State: ALoCoQl6FOsTpDbvE3yN0WSnt3t4PveGDmxnz8IwrKrB3n5IpP9gKjQuTfh+JbZ6ggyJvddZeXAC X-Received: by 10.180.106.67 with SMTP id gs3mr11670743wib.3.1416590949956; Fri, 21 Nov 2014 09:29:09 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.6.36 with SMTP id cr4ls228623lad.41.gmail; Fri, 21 Nov 2014 09:29:09 -0800 (PST) X-Received: by 10.112.219.3 with SMTP id pk3mr6608860lbc.18.1416590949484; Fri, 21 Nov 2014 09:29:09 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id ei6si6589117lad.62.2014.11.21.09.29.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 09:29:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id p9so3450923lbv.14 for ; Fri, 21 Nov 2014 09:29:05 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr6500154lbo.32.1416590945217; Fri, 21 Nov 2014 09:29:05 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp132028lbc; Fri, 21 Nov 2014 09:29:04 -0800 (PST) X-Received: by 10.52.234.230 with SMTP id uh6mr5103427vdc.10.1416590943933; Fri, 21 Nov 2014 09:29:03 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id et3si3229094vdb.21.2014.11.21.09.29.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Nov 2014 09:29:03 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XrrzT-0007Gl-F5; Fri, 21 Nov 2014 17:27:27 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XrrzS-0007Gc-E2 for xen-devel@lists.xensource.com; Fri, 21 Nov 2014 17:27:26 +0000 Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id A6/9E-15461-DF57F645; Fri, 21 Nov 2014 17:27:25 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-9.tower-21.messagelabs.com!1416590843!14512810!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.12.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28924 invoked from network); 21 Nov 2014 17:27:25 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 21 Nov 2014 17:27:25 -0000 X-IronPort-AV: E=Sophos;i="5.07,432,1413244800"; d="scan'208";a="195318485" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Fri, 21 Nov 2014 12:11:09 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Xrrjh-00071D-Jx; Fri, 21 Nov 2014 17:11:09 +0000 Date: Fri, 21 Nov 2014 17:11:09 +0000 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: In-Reply-To: <1416494946.14429.13.camel@citrix.com> Message-ID: References: <1ac72b0.26f7c.149ae18f6bb.Coremail.hanyandong@iie.ac.cn> <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> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-DLP: MIA1 Cc: Wei Liu , Ian Campbell , Ian Jackson , hanyandong , Stefano Stabellini Subject: [Xen-devel] [PATCH for-4.5] libxl: do not load roms for any NICs except the first to avoid wasting memory X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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 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. 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,"