qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v5 14/26] monitor: introduce monitor_qmp_respond()


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC v5 14/26] monitor: introduce monitor_qmp_respond()
Date: Wed, 13 Dec 2017 17:35:33 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Tue, Dec 05, 2017 at 01:51:48PM +0800, Peter Xu wrote:
> A tiny refactoring, preparing to split the QMP dispatcher away.
> 
> Reviewed-by: Fam Zheng <address@hidden>
> Signed-off-by: Peter Xu <address@hidden>
> ---
>  monitor.c | 48 +++++++++++++++++++++++++++++++-----------------
>  1 file changed, 31 insertions(+), 17 deletions(-)
> 
> diff --git a/monitor.c b/monitor.c
> index 9666115259..35d8925636 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -3877,6 +3877,36 @@ static int monitor_can_read(void *opaque)
>      return (mon->suspend_cnt == 0) ? 1 : 0;
>  }
>  
> +/*
> + * When rsp/err/id is passed in, the function will be responsible for
> + * the cleanup.
> + */

Please document this function fully.  I had to look at the
implementation to learn how the arguments work:

1. This function takes ownership of rsp, err, and id.  (Please use this
exact wording because the function does not perform the "cleanup" when
refcount > 1.)
2. rsp, err, and id may be NULL.
3. If err != NULL then rsp must be NULL.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]