qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Claudio Fontana <cfontana@suse.de>
To: Fabiano Rosas <farosas@suse.de>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, "Kevin Wolf" <kwolf@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"João Silva" <jsilva@suse.de>, "Lin Ma" <lma@suse.com>,
	"Dario Faggioli" <dfaggioli@suse.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Dr. David Alan Gilbert" <dave@treblig.org>
Subject: Re: [RFC PATCH 3/6] Convert query-block/info_block to coroutine
Date: Wed, 24 May 2023 10:48:19 +0200	[thread overview]
Message-ID: <e79cbb4a-7e79-d5d8-1f95-cb458af94ddf@suse.de> (raw)
In-Reply-To: <20230523213903.18418-4-farosas@suse.de>

On 5/23/23 23:39, Fabiano Rosas wrote:
> From: Lin Ma <lma@suse.com>
> 
> Sometimes the query-block performs time-consuming I/O(say waiting for
> the fstat of NFS complete), So let's make this QMP handler runs in a
> coroutine.
> 
> The following patch moves the fstat() into a thread pool.


Hi, this message talks about QMP and query-block only and the subject talks about info_block as well.
We need to clarify this.

Also, lets make it clear that one is a QMP command, and the other is an HMP command.

In any case I would say:

"Convert QMP command query-block to use a coroutine", and in case we also need info_block, an additional patch could take care of the HMP command with a subject like:

"Convert HMP command info_block to use a coroutine".

Ciao,

Claudio


> 
> Signed-off-by: Lin Ma <lma@suse.com>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
>  block/monitor/block-hmp-cmds.c | 2 +-
>  block/qapi.c                   | 2 +-
>  hmp-commands-info.hx           | 1 +
>  include/block/block-hmp-cmds.h | 2 +-
>  qapi/block-core.json           | 2 +-
>  5 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c
> index ca2599de44..4b704010bc 100644
> --- a/block/monitor/block-hmp-cmds.c
> +++ b/block/monitor/block-hmp-cmds.c
> @@ -738,7 +738,7 @@ static void print_block_info(Monitor *mon, BlockInfo *info,
>      }
>  }
>  
> -void hmp_info_block(Monitor *mon, const QDict *qdict)
> +void coroutine_fn hmp_info_block(Monitor *mon, const QDict *qdict)
>  {
>      BlockInfoList *block_list, *info;
>      BlockDeviceInfoList *blockdev_list, *blockdev;
> diff --git a/block/qapi.c b/block/qapi.c
> index 79bf80c503..ae6cd1c2ff 100644
> --- a/block/qapi.c
> +++ b/block/qapi.c
> @@ -667,7 +667,7 @@ bdrv_query_bds_stats(BlockDriverState *bs, bool blk_level)
>      return s;
>  }
>  
> -BlockInfoList *qmp_query_block(Error **errp)
> +BlockInfoList *coroutine_fn qmp_query_block(Error **errp)
>  {
>      BlockInfoList *head = NULL, **p_next = &head;
>      BlockBackend *blk;
> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
> index 47d63d26db..996895f417 100644
> --- a/hmp-commands-info.hx
> +++ b/hmp-commands-info.hx
> @@ -65,6 +65,7 @@ ERST
>          .help       = "show info of one block device or all block devices "
>                        "(-n: show named nodes; -v: show details)",
>          .cmd        = hmp_info_block,
> +        .coroutine  = true,
>      },
>  
>  SRST
> diff --git a/include/block/block-hmp-cmds.h b/include/block/block-hmp-cmds.h
> index 71113cd7ef..6d9152318f 100644
> --- a/include/block/block-hmp-cmds.h
> +++ b/include/block/block-hmp-cmds.h
> @@ -48,7 +48,7 @@ void hmp_eject(Monitor *mon, const QDict *qdict);
>  
>  void hmp_qemu_io(Monitor *mon, const QDict *qdict);
>  
> -void hmp_info_block(Monitor *mon, const QDict *qdict);
> +void coroutine_fn hmp_info_block(Monitor *mon, const QDict *qdict);
>  void hmp_info_blockstats(Monitor *mon, const QDict *qdict);
>  void hmp_info_block_jobs(Monitor *mon, const QDict *qdict);
>  void hmp_info_snapshots(Monitor *mon, const QDict *qdict);
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 98d9116dae..da95fe456c 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -838,7 +838,7 @@
>  #    }
>  ##
>  { 'command': 'query-block', 'returns': ['BlockInfo'],
> -  'allow-preconfig': true }
> +  'allow-preconfig': true, 'coroutine': true }
>  
>  ##
>  # @BlockDeviceTimedStats:



  reply	other threads:[~2023-05-24  8:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 21:38 [RFC PATCH 0/6] block: Make raw_co_get_allocated_file_size asynchronous Fabiano Rosas
2023-05-23 21:38 ` [RFC PATCH 1/6] block: Remove bdrv_query_block_node_info Fabiano Rosas
2023-05-24  8:31   ` Claudio Fontana
2023-05-23 21:38 ` [RFC PATCH 2/6] block: Mark bdrv_co_get_allocated_file_size() as mixed Fabiano Rosas
2023-05-25 14:17   ` Eric Blake
2023-05-26  9:12   ` Kevin Wolf
2023-05-23 21:39 ` [RFC PATCH 3/6] Convert query-block/info_block to coroutine Fabiano Rosas
2023-05-24  8:48   ` Claudio Fontana [this message]
2023-05-25 14:26   ` Eric Blake
2023-05-26 14:05     ` Fabiano Rosas
2023-05-23 21:39 ` [RFC PATCH 4/6] " Fabiano Rosas
2023-05-24  4:23   ` Lin Ma
2023-05-24 12:30     ` Fabiano Rosas
2023-05-24  8:49   ` Claudio Fontana
2023-05-24  9:24     ` Lin Ma
2023-05-24 15:57       ` Claudio Fontana
2023-05-23 21:39 ` [RFC PATCH 5/6] block: Allow bdrv_get_allocated_file_size to run in bdrv context Fabiano Rosas
2023-05-26  9:28   ` Kevin Wolf
2023-05-29 17:47     ` Fabiano Rosas
2023-05-23 21:39 ` [RFC PATCH 6/6] block: Add a thread-pool version of fstat Fabiano Rosas
2023-05-24 15:56   ` Claudio Fontana
2023-05-25 15:45   ` Eric Blake
2023-05-26 14:20     ` Fabiano Rosas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e79cbb4a-7e79-d5d8-1f95-cb458af94ddf@suse.de \
    --to=cfontana@suse.de \
    --cc=armbru@redhat.com \
    --cc=dave@treblig.org \
    --cc=dfaggioli@suse.com \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=hreitz@redhat.com \
    --cc=jsilva@suse.de \
    --cc=kwolf@redhat.com \
    --cc=lma@suse.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).