From patchwork Mon Feb 22 21:02:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joao Martins X-Patchwork-Id: 8383301 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0424BC0553 for ; Mon, 22 Feb 2016 21:05:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C78F205CA for ; Mon, 22 Feb 2016 21:05:34 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D8E7205B5 for ; Mon, 22 Feb 2016 21:05:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aXxdL-0001By-GG; Mon, 22 Feb 2016 21:03:07 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aXxdJ-00019R-LE for xen-devel@lists.xen.org; Mon, 22 Feb 2016 21:03:05 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id 10/7A-03294-8877BC65; Mon, 22 Feb 2016 21:03:04 +0000 X-Env-Sender: joao.m.martins@oracle.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1456174982!24246194!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 43580 invoked from network); 22 Feb 2016 21:03:03 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-5.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 22 Feb 2016 21:03:03 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u1ML2wd5004613 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 22 Feb 2016 21:02:59 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u1ML2wsb015912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 22 Feb 2016 21:02:58 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1ML2vvp008289; Mon, 22 Feb 2016 21:02:57 GMT Received: from localhost.localdomain (/89.181.88.39) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 22 Feb 2016 13:02:57 -0800 From: Joao Martins To: xen-devel@lists.xen.org Date: Mon, 22 Feb 2016 21:02:14 +0000 Message-Id: <1456174934-22973-9-git-send-email-joao.m.martins@oracle.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456174934-22973-1-git-send-email-joao.m.martins@oracle.com> References: <1456174934-22973-1-git-send-email-joao.m.martins@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: Wei Liu , Joao Martins , Ian Jackson , Ian Campbell , Stefano Stabellini Subject: [Xen-devel] [PATCH RFC 8/8] xl: introduce topology options X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Namely sockets, cores and threads to describe the topology as seen by the guest. This as an alternative to the SMT option that is also proposed. Signed-off-by: Joao Martins --- CC: Ian Jackson CC: Stefano Stabellini CC: Ian Campbell CC: Wei Liu --- docs/man/xl.cfg.pod.5 | 18 ++++++++++++++++++ tools/libxl/xl_cmdimpl.c | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 index 5e614f7..cb7ebc2 100644 --- a/docs/man/xl.cfg.pod.5 +++ b/docs/man/xl.cfg.pod.5 @@ -110,6 +110,24 @@ Configures if guests should see SMT topology instead of normal flat topology. Default is C<0> +=item B + +Configures number of sockets as seen by the guest. + +Default is C<0> + +=item B + +Configures number of physical cores per package as seen by the guest. + +Default is C<0> + +=item B + +Configures number of SMT threads per core as seen by the guest. + +Default is C<0> + =item B Allow the guest to bring up a maximum of M vcpus. At start of day if diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index c09f628..965d60b 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1367,6 +1367,13 @@ static void parse_config_data(const char *config_source, xlu_cfg_get_defbool(config, "smt", &b_info->smt, 0); + if (!xlu_cfg_get_long(config, "sockets", &l, 0)) + b_info->topology.sockets = l; + if (!xlu_cfg_get_long(config, "cores", &l, 0)) + b_info->topology.cores = l; + if (!xlu_cfg_get_long(config, "threads", &l, 0)) + b_info->topology.threads = l; + if (!xlu_cfg_get_long (config, "maxvcpus", &l, 0)) b_info->max_vcpus = l;