The grant copy operation was added to libxengnttab in Xen 4.8.0 (released nearly 18 months ago) but the xen_disk PV backend QEMU is still carrying a significant amount of code purely to remain compatible with older versions of Xen.
As can be inferred from the diff stats below, removing this support for older versions of Xen from QEMU reduces the size of the xen_disk source by more than 350 lines (~25%). The majority of this is done in patches #1 and #2. Further simplifications are made in patch #3 and then some cosmetic work is done in patch #4. Paul Durrant (4): block/xen_disk: remove persistent grant code block/xen_disk: remove use of grant map/unmap block/xen_disk: use a single entry iovec block/xen_disk: be consistent with use of xendev and blkdev->xendev hw/block/xen_disk.c | 590 ++++++++++------------------------------------------ 1 file changed, 109 insertions(+), 481 deletions(-) --- Cc: Stefano Stabellini <sstabell...@kernel.org> Cc: Anthony Perard <anthony.per...@citrix.com> Cc: Kevin Wolf <kw...@redhat.com> Cc: Max Reitz <mre...@redhat.com> -- 2.1.4