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.

>
> Please make them consistent.
>
>>   VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler 
>> *cb,
>>                                                        void *opaque);
>>   VMChangeStateEntry *qemu_add_vm_change_state_handler_prio(

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro

Reply via email to