[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/20] util: Add iova_tree_nnodes()
From: |
Avihai Horon |
Subject: |
[PATCH v2 08/20] util: Add iova_tree_nnodes() |
Date: |
Wed, 22 Feb 2023 19:49:03 +0200 |
From: Joao Martins <joao.m.martins@oracle.com>
Add iova_tree_nnodes() which returns the number of nodes in the IOVA
tree.
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Acked-by: Peter Xu <peterx@redhat.com>
---
include/qemu/iova-tree.h | 11 +++++++++++
util/iova-tree.c | 5 +++++
2 files changed, 16 insertions(+)
diff --git a/include/qemu/iova-tree.h b/include/qemu/iova-tree.h
index 8528e5c98f..7bb80783ce 100644
--- a/include/qemu/iova-tree.h
+++ b/include/qemu/iova-tree.h
@@ -164,4 +164,15 @@ int iova_tree_alloc_map(IOVATree *tree, DMAMap *map,
hwaddr iova_begin,
*/
void iova_tree_destroy(IOVATree *tree);
+/**
+ * iova_tree_nnodes:
+ *
+ * @tree: the iova tree to consult
+ *
+ * Returns the number of nodes in the iova tree
+ *
+ * Return: >=0 for the number of nodes.
+ */
+gint iova_tree_nnodes(IOVATree *tree);
+
#endif
diff --git a/util/iova-tree.c b/util/iova-tree.c
index 536789797e..6141a6229b 100644
--- a/util/iova-tree.c
+++ b/util/iova-tree.c
@@ -280,3 +280,8 @@ void iova_tree_destroy(IOVATree *tree)
g_tree_destroy(tree->tree);
g_free(tree);
}
+
+gint iova_tree_nnodes(IOVATree *tree)
+{
+ return g_tree_nnodes(tree->tree);
+}
--
2.26.3
- [PATCH v2 05/20] vfio/common: Fix wrong %m usages, (continued)
- [PATCH v2 05/20] vfio/common: Fix wrong %m usages, Avihai Horon, 2023/02/22
- [PATCH v2 06/20] vfio/common: Abort migration if dirty log start/stop/sync fails, Avihai Horon, 2023/02/22
- [PATCH v2 03/20] vfio/migration: Add VFIO migration pre-copy support, Avihai Horon, 2023/02/22
- Re: [PATCH v2 03/20] vfio/migration: Add VFIO migration pre-copy support, Alex Williamson, 2023/02/22
- Re: [PATCH v2 03/20] vfio/migration: Add VFIO migration pre-copy support, Avihai Horon, 2023/02/23
- Re: [PATCH v2 03/20] vfio/migration: Add VFIO migration pre-copy support, Alex Williamson, 2023/02/23
- Re: [PATCH v2 03/20] vfio/migration: Add VFIO migration pre-copy support, Avihai Horon, 2023/02/26
- Re: [PATCH v2 03/20] vfio/migration: Add VFIO migration pre-copy support, Alex Williamson, 2023/02/27
- Re: [PATCH v2 03/20] vfio/migration: Add VFIO migration pre-copy support, Jason Gunthorpe, 2023/02/27
- Re: [PATCH v2 03/20] vfio/migration: Add VFIO migration pre-copy support, Alex Williamson, 2023/02/27
[PATCH v2 08/20] util: Add iova_tree_nnodes(),
Avihai Horon <=
[PATCH v2 11/20] vfio/common: Add device dirty page tracking start/stop, Avihai Horon, 2023/02/22
- Re: [PATCH v2 11/20] vfio/common: Add device dirty page tracking start/stop, Alex Williamson, 2023/02/22
- Re: [PATCH v2 11/20] vfio/common: Add device dirty page tracking start/stop, Jason Gunthorpe, 2023/02/22
- Re: [PATCH v2 11/20] vfio/common: Add device dirty page tracking start/stop, Alex Williamson, 2023/02/23
- Re: [PATCH v2 11/20] vfio/common: Add device dirty page tracking start/stop, Jason Gunthorpe, 2023/02/23
- Re: [PATCH v2 11/20] vfio/common: Add device dirty page tracking start/stop, Alex Williamson, 2023/02/23
- Re: [PATCH v2 11/20] vfio/common: Add device dirty page tracking start/stop, Jason Gunthorpe, 2023/02/23
- Re: [PATCH v2 11/20] vfio/common: Add device dirty page tracking start/stop, Avihai Horon, 2023/02/26
Re: [PATCH v2 11/20] vfio/common: Add device dirty page tracking start/stop, Avihai Horon, 2023/02/23
[PATCH v2 10/20] vfio/common: Record DMA mapped IOVA ranges, Avihai Horon, 2023/02/22