OSDN Git Service

util: Add iova_tree_alloc_map
authorEugenio Pérez <eperezma@redhat.com>
Mon, 14 Mar 2022 17:34:48 +0000 (18:34 +0100)
committerJason Wang <jasowang@redhat.com>
Tue, 15 Mar 2022 05:57:44 +0000 (13:57 +0800)
commit9376bde894e444ebe2d2ec236569b6e55faa4765
tree7614e324760bf584f6f72fac5381cf7c260123d1
parent100890f7cad502b6fa49465ffff287ba79fcf94b
util: Add iova_tree_alloc_map

This iova tree function allows it to look for a hole in allocated
regions and return a totally new translation for a given translated
address.

It's usage is mainly to allow devices to access qemu address space,
remapping guest's one into a new iova space where qemu can add chunks of
addresses.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
include/qemu/iova-tree.h
util/iova-tree.c