From patchwork Fri Jun 30 07:21:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongli Zhang X-Patchwork-Id: 9818583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4F7B603D7 for ; Fri, 30 Jun 2017 07:23:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B3E2285EB for ; Fri, 30 Jun 2017 07:23:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F2E5285F2; Fri, 30 Jun 2017 07:23:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A5B02285EB for ; Fri, 30 Jun 2017 07:23:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQqF6-0005CP-7O; Fri, 30 Jun 2017 07:21:28 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQqF5-0005CJ-Hf for xen-devel@lists.xen.org; Fri, 30 Jun 2017 07:21:27 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id 9B/AE-01996-6FBF5595; Fri, 30 Jun 2017 07:21:26 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrILMWRWlGSWpSXmKPExsXSO6nOVffb79B Ig61/RS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1owbE76yFhzgrbjWeZW5gXEbdxcjF4eQwGQm iSUtd5khnN+MEu93zWeCcDYwSpz9uAvK6WaUOHlrJmMXIycHm4COxLQDp1hAbBEBaYlrny+Dx ZkFjCRubWxgBrGFBdwlLqydwg5iswioSmxfBjKVk4NXwE1ixZ1WsBoJATmJm+c6oWxjifa3F9 kmMPIsYGRYxahRnFpUllqka2ygl1SUmZ5RkpuYmaNraGCql5taXJyYnpqTmFSsl5yfu4kR6P1 6BgbGHYwTVvkdYpTkYFIS5V15LTRSiC8pP6UyI7E4I76oNCe1+BCjDAeHkgRvwi+gnGBRanpq RVpmDjAMYdISHDxKIryPngKleYsLEnOLM9MhUqcYdTmOzfj5jUmIJS8/L1VKnNcXZIYASFFGa R7cCFhMXGKUlRLmZWRgYBDiKUgtys0sQZV/xSjOwagkzPv3J9AUnsy8ErhNr4COYAI6QnhGCM gRJYkIKakGxv2TA2X/575sndQ8p+qTu8raqZknOOLerrLRWVm74umNe01TYjVlT62e4SN0ie9 //YTA30Gz/BIXfzNZcGpPSt4nsxrJqriinZoPPJV5DTJL7u3aLiGQNE2HKTUt+fNGKZmPc/pe e+5e9uHS5F8inbHdz7Z2Voq2ZRzTv24SdXl9w8TbPvOvcSmxFGckGmoxFxUnAgDOuVruhAIAA A== X-Env-Sender: dongli.zhang@oracle.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1498807284!80973234!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 60723 invoked from network); 30 Jun 2017 07:21:25 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-11.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 30 Jun 2017 07:21:25 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v5U7LJxS009895 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jun 2017 07:21:20 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v5U7LJrP020409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jun 2017 07:21:19 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v5U7LIkb028332; Fri, 30 Jun 2017 07:21:18 GMT Received: from linux.cn.oracle.com (/10.182.70.224) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 30 Jun 2017 00:21:18 -0700 From: Dongli Zhang To: xen-devel@lists.xen.org Date: Fri, 30 Jun 2017 15:21:30 +0800 Message-Id: <1498807291-3356-1-git-send-email-dongli.zhang@oracle.com> X-Mailer: git-send-email 2.7.4 X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com Subject: [Xen-devel] [PATCH 1/2] tools/libxc: add interface for GNTTABOP_query_size X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch adds new interface for GNTTABOP_query_size in libxc to help query the current grant table frames and maximum grant table frames for a specific domain. Signed-off-by: Dongli Zhang Acked-by: Wei Liu --- tools/libxc/include/xenctrl.h | 1 + tools/libxc/xc_gnttab.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 1629f41..155c69e 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1597,6 +1597,7 @@ int xc_gnttab_op(xc_interface *xch, int cmd, void * op, int op_size, int count); /* Logs iff hypercall bounce fails, otherwise doesn't. */ +int xc_gnttab_query_size(xc_interface *xch, struct gnttab_query_size *query); int xc_gnttab_get_version(xc_interface *xch, int domid); /* Never logs */ grant_entry_v1_t *xc_gnttab_map_table_v1(xc_interface *xch, int domid, int *gnt_num); grant_entry_v2_t *xc_gnttab_map_table_v2(xc_interface *xch, int domid, int *gnt_num); diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c index af53fac..81a89fe 100644 --- a/tools/libxc/xc_gnttab.c +++ b/tools/libxc/xc_gnttab.c @@ -38,6 +38,18 @@ int xc_gnttab_op(xc_interface *xch, int cmd, void * op, int op_size, int count) return ret; } +int xc_gnttab_query_size(xc_interface *xch, struct gnttab_query_size *query) +{ + int rc; + + rc = xc_gnttab_op(xch, GNTTABOP_query_size, query, sizeof(*query), 1); + + if ( rc || (query->status != GNTST_okay) ) + ERROR("Could not query dom %d's grant size\n", query->dom); + + return rc; +} + int xc_gnttab_get_version(xc_interface *xch, int domid) { struct gnttab_get_version query;