Re: [PATCH trivial] plugins: add missing docstrings to qemu-plugin.h
Pierrick Bouvier <[email protected]>
| Newsgroups | org.nongnu.qemu-trivial,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
On 3/9/26 9:35 AM, Peter Maydell wrote: > On Mon, 9 Mar 2026 at 16:22, Florian Hofhammer > <[email protected]> wrote: >> >> This patch adds docstrings for typedefs and function declarations in >> include/plugins/qemu-plugin.h that were previously missing. This >> resolves inconsistencies in the docs, e.g., the description for >> qemu_plugin_read_register() referring to qemu_plugin_register_flush_cb() >> but code cache flush callbacks not being documented themselves. >> >> Signed-off-by: Florian Hofhammer <[email protected]> > > I don't know this API either, so a couple of questions below > for those who do: > >> +/** >> + * enum qemu_plugin_mem_rw - type of memory access >> + * >> + * @QEMU_PLUGIN_MEM_R: memory read access only >> + * @QEMU_PLUGIN_MEM_W: memory write access only >> + * @QEMU_PLUGIN_MEM_RW: memory read and write access >> + */ >> enum qemu_plugin_mem_rw { >> QEMU_PLUGIN_MEM_R = 1, >> QEMU_PLUGIN_MEM_W, >> QEMU_PLUGIN_MEM_RW, >> }; > > This define sets up the values such that you can use > the _R and _W values as bit checks (i.e. _RW == _R | _W). > Is that intentional and can code using the API rely on it, > or must it strictly check against _R and _RW separately? > It's intentional, but if people explicitely check both, there is nothing wrong with it.