On 7/15/2025 5:02 PM, Alex Bennée wrote:
Xiaoyao Li <xiaoyao...@intel.com> writes:

On 7/4/2025 1:32 AM, Philippe Mathieu-Daudé wrote:
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
Reviewed-by: Alex Bennée <alex.ben...@linaro.org>
---
   include/system/runstate.h | 10 ++++++++++
   1 file changed, 10 insertions(+)
diff --git a/include/system/runstate.h b/include/system/runstate.h
index fdd5c4a5172..b6e8d6beab7 100644
--- a/include/system/runstate.h
+++ b/include/system/runstate.h
@@ -14,6 +14,16 @@ void runstate_replay_enable(void);
   typedef void VMChangeStateHandler(void *opaque, bool running, RunState 
state);
   typedef int VMChangeStateHandlerWithRet(void *opaque, bool running, RunState 
state);
   +/**
+ * qemu_add_vm_change_state_handler:
+ * @cb: the callback to invoke
+ * @opaque: user data passed to the callback
+ *
+ * Register a callback function that is invoked when the vm starts or stops
+ * running.
+ *
+ * Returns: an entry to be freed using qemu_del_vm_change_state_handler()
+ */

qemu_add_vm_change_state_handler_prio() and
qemu_add_vm_change_state_handler_prio_full() put the document in the
implementation in system/runstate.c.

Generally APIs to the rest of QEMU should be documented in the headers.
Comments on individual functions or internal details are fine to live in
the C files.

I totally understand it.

I was not asking to put the document into C files, but to ...


Please make them consistent.

... make them consistent. IOW, I would expect an additional patch to move the document of qemu_add_vm_change_state_handler_prio() and qemu_add_vm_change_state_handler_prio_full() from C files to this header file.

   VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler 
*cb,
                                                        void *opaque);
   VMChangeStateEntry *qemu_add_vm_change_state_handler_prio(



Reply via email to