xref: /openbmc/qemu/hw/virtio/vhost-iova-tree.h (revision 69292a8e)
1 /*
2  * vhost software live migration iova tree
3  *
4  * SPDX-FileCopyrightText: Red Hat, Inc. 2021
5  * SPDX-FileContributor: Author: Eugenio Pérez <eperezma@redhat.com>
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef HW_VIRTIO_VHOST_IOVA_TREE_H
11 #define HW_VIRTIO_VHOST_IOVA_TREE_H
12 
13 #include "qemu/iova-tree.h"
14 #include "exec/memory.h"
15 
16 typedef struct VhostIOVATree VhostIOVATree;
17 
18 VhostIOVATree *vhost_iova_tree_new(uint64_t iova_first, uint64_t iova_last);
19 void vhost_iova_tree_delete(VhostIOVATree *iova_tree);
20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(VhostIOVATree, vhost_iova_tree_delete);
21 
22 const DMAMap *vhost_iova_tree_find_iova(const VhostIOVATree *iova_tree,
23                                         const DMAMap *map);
24 int vhost_iova_tree_map_alloc(VhostIOVATree *iova_tree, DMAMap *map);
25 void vhost_iova_tree_remove(VhostIOVATree *iova_tree, DMAMap map);
26 
27 #endif
28