Re: [PATCH RFC 06/15] util/iova-tree: g_tree_foreach wrapper
Connor Kite <[email protected]> Mon, 3 Aug 2026 14:13:24 -0700
| Newsgroups | org.nongnu.qemu-devel,dev.linux.lists.virtio-fs |
|---|---|
| Message-ID | <CA+spn3rjAu5EcWBwG4NJmwqobdggJmZYVPrvn5Yq58Zyf0NEDA@mail.gmail.com> |
On Mon, Aug 3, 2026 at 5:36=E2=80=AFAM Hanna Czenczek <[email protected]> w= rote: > > > Can you document roughly what the function looks like? Because the type > (`GTraverseFunc`) is not defined in qemu. I know it has a boolean as a > return type, and that one argument of it is going to be `gpointer data`, > but surely it will also take a tree element. > > Hanna I have updated the comment to describe the usage of GTraverseFunc as below: /** * iova_tree_foreach: * * @tree: the iova tree to traverse * @func: the function called at every node. A true return value ends traver= sal. * Arguments: * gpointer key: key of current node * gpointer value: value of current node * gpointer data: data passed in at g_tree_foreach call * Return: gboolean * @data: an argument passed to func * * Wrapper to call g_tree_foreach on the underlying g_tree. g_tree_foreach w= ill * traverse through every node of the tree, barring an early return. At each * node, g_tree_foreach calls func with pointers to the node key, node value= , * and a pointer to data passed in by the caller. * * Return: None */