From: Dongli Zhang Date: Sun, 2 Jul 2017 23:34:12 +0000 (+0800) Subject: tools/libxc: add interface for GNTTABOP_query_size X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1841 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=04e0457e1e786a3a33d1854275fd6cd7ba6306f7;p=xen.git tools/libxc: add interface for GNTTABOP_query_size 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 --- diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 0ee6331c41..c51bb3b448 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1606,6 +1606,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 af53facd9a..9e6f1fbd09 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 %u's grant size\n", query->dom); + + return rc; +} + int xc_gnttab_get_version(xc_interface *xch, int domid) { struct gnttab_get_version query;