xen: add a global indicator for grant copy being available
commitb5e397a79ec874d9739e096f5e27a912d857a0ec
authorJuergen Gross <jgross@suse.com>
Fri, 22 Sep 2017 12:07:24 +0000 (22 14:07 +0200)
committerStefano Stabellini <sstabellini@kernel.org>
Thu, 26 Oct 2017 21:23:06 +0000 (26 14:23 -0700)
tree21ccdd964b623fecce512bf29fa613a46f2b687f
parent325a084c1ebccb265a3c8f1dd092ffbbfb448a00
xen: add a global indicator for grant copy being available

The Xen qdisk backend needs to test whether grant copy operations is
available in the kernel. Unfortunately this collides with using
xengnttab_set_max_grants() on some kernels as this operation has to
be the first one after opening the gnttab device.

In order to solve this problem test for the availability of grant copy
in xen_be_init() opening the gnttab device just for that purpose and
closing it again afterwards. Advertise the availability via a global
flag and use that flag in the qdisk backend.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
hw/block/xen_disk.c
hw/xen/xen_backend.c
include/hw/xen/xen_backend.h