From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Laurent Vivier <lvivier@redhat.com>,
Thomas Huth <thuth@redhat.com>,
qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Coiby Xu <Coiby.Xu@gmail.com>, Max Reitz <mreitz@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v2 4/4] block/export: add iothread and fixed-iothread options
Date: Tue, 29 Sep 2020 08:07:38 -0500 [thread overview]
Message-ID: <7f99e542-c6a1-cec4-26f9-30ce4e271c65@redhat.com> (raw)
In-Reply-To: <20200929125516.186715-5-stefanha@redhat.com>
On 9/29/20 7:55 AM, Stefan Hajnoczi wrote:
> Make it possible to specify the iothread where the export will run. By
> default the block node can be moved to other AioContexts later and the
> export will follow. The fixed-iothread option forces strict behavior
> that prevents changing AioContext while the export is active. See the
> QAPI docs for details.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> Note the x-blockdev-set-iothread QMP command can be used to do the same,
> but not from the command-line. And it requires sending an additional
> command.
>
> In the long run vhost-user-blk will support per-virtqueue iothread
> mappings. But for now a single iothread makes sense and most other
> transports will just use one iothread anyway.
> ---
> qapi/block-export.json | 11 ++++++++++
> block/export/export.c | 31 +++++++++++++++++++++++++++-
> block/export/vhost-user-blk-server.c | 5 ++++-
> nbd/server.c | 2 --
> 4 files changed, 45 insertions(+), 4 deletions(-)
>
> diff --git a/qapi/block-export.json b/qapi/block-export.json
> index 87ac5117cd..e2cb21f5f1 100644
> --- a/qapi/block-export.json
> +++ b/qapi/block-export.json
> @@ -219,11 +219,22 @@
> # export before completion is signalled. (since: 5.2;
> # default: false)
> #
> +# @iothread: The name of the iothread object where the export will run. The
> +# default is to use the thread currently associated with the #
Stray #
> +# block node. (since: 5.2)
> +#
> +# @fixed-iothread: True prevents the block node from being moved to another
> +# thread while the export is active. If true and @iothread is
> +# given, export creation fails if the block node cannot be
> +# moved to the iothread. The default is false.
> +#
Missing a '(since 5.2)' tag. (Hmm, we're inconsistent on whether it is
'since 5.2' or 'since: 5.2' inside () parentheticals; Markus, is that
something we should be cleaning up as part of the conversion to rST?)
> @@ -63,10 +64,11 @@ static const BlockExportDriver *blk_exp_find_driver(BlockExportType type)
>
> BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp)
> {
> + bool fixed_iothread = export->has_fixed_iothread && export->fixed_iothread;
Technically, our QAPI code guarantees that export->fixed_iothread is
false if export->has_fixed_iothread is false. And someday I'd love to
let QAPI express default values for bools so that we don't need a
has_FOO field when a default has been expressed. But neither of those
points affect this patch; what you have is correct even if it is verbose.
Otherwise looks reasonable.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-09-29 13:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 12:55 [PATCH v2 0/4] block/export: add BlockExportOptions->iothread member Stefan Hajnoczi
2020-09-29 12:55 ` [PATCH v2 1/4] util/vhost-user-server: use static library in meson.build Stefan Hajnoczi
2020-09-29 12:55 ` [PATCH v2 2/4] qemu-storage-daemon: avoid compiling blockdev_ss twice Stefan Hajnoczi
2020-09-29 12:55 ` [PATCH v2 3/4] block: move block exports to libblockdev Stefan Hajnoczi
2020-09-29 13:02 ` Paolo Bonzini
2020-09-29 13:03 ` Eric Blake
2020-09-29 17:36 ` Eric Blake
2020-09-30 8:51 ` Stefan Hajnoczi
2020-09-29 12:55 ` [PATCH v2 4/4] block/export: add iothread and fixed-iothread options Stefan Hajnoczi
2020-09-29 13:07 ` Eric Blake [this message]
2020-09-29 15:44 ` Stefan Hajnoczi
2020-10-09 10:17 ` [PATCH v2 0/4] block/export: add BlockExportOptions->iothread member Stefan Hajnoczi
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=7f99e542-c6a1-cec4-26f9-30ce4e271c65@redhat.com \
--to=eblake@redhat.com \
--cc=Coiby.Xu@gmail.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=lvivier@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
/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).