From: Sergio Lopez <slp@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-block@nongnu.org, qemu-devel@nongnu.org,
Max Reitz <mreitz@redhat.com>, Nir Soffer <nsoffer@redhat.com>
Subject: Re: [PATCH 1/2] block-backend: add drained_poll
Date: Tue, 1 Jun 2021 18:32:01 +0200 [thread overview]
Message-ID: <20210601163201.e7cvtapzakaatigs@mhamilton> (raw)
In-Reply-To: <YLZZTgcWUliRhtT2@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1500 bytes --]
On Tue, Jun 01, 2021 at 05:59:10PM +0200, Kevin Wolf wrote:
> Am 01.06.2021 um 07:57 hat Sergio Lopez geschrieben:
> > Allow block backends to poll their devices/users to check if they have
> > been quiesced when entering a drained section.
> >
> > This will be used in the next patch to wait for the NBD server to be
> > completely quiesced.
> >
> > Suggested-by: Kevin Wolf <kwolf@redhat.com>
> > Signed-off-by: Sergio Lopez <slp@redhat.com>
> > ---
> > block/block-backend.c | 7 ++++++-
> > include/sysemu/block-backend.h | 4 ++++
> > 2 files changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/block/block-backend.c b/block/block-backend.c
> > index de5496af66..163ca05b97 100644
> > --- a/block/block-backend.c
> > +++ b/block/block-backend.c
> > @@ -2393,8 +2393,13 @@ static void blk_root_drained_begin(BdrvChild *child)
> > static bool blk_root_drained_poll(BdrvChild *child)
> > {
> > BlockBackend *blk = child->opaque;
> > + int ret = 0;
>
> It's really a bool.
I'll fix this in v2.
Thanks,
Sergio.
> > assert(blk->quiesce_counter);
> > - return !!blk->in_flight;
> > +
> > + if (blk->dev_ops && blk->dev_ops->drained_poll) {
> > + ret = blk->dev_ops->drained_poll(blk->dev_opaque);
> > + }
> > + return ret || !!blk->in_flight;
> > }
>
> Doesn't make a difference for correctness, of course, so whether you
> change it or not:
>
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-06-01 16:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 5:57 [PATCH 0/2] nbd/server: Quiesce server on drained section Sergio Lopez
2021-06-01 5:57 ` [PATCH 1/2] block-backend: add drained_poll Sergio Lopez
2021-06-01 15:59 ` Kevin Wolf
2021-06-01 16:32 ` Sergio Lopez [this message]
2021-06-01 21:24 ` Eric Blake
2021-06-01 5:57 ` [PATCH 2/2] nbd/server: Use drained block ops to quiesce the server Sergio Lopez
2021-06-01 16:08 ` Kevin Wolf
2021-06-01 16:31 ` Sergio Lopez
2021-06-01 21:31 ` Eric Blake
2021-06-01 21:29 ` Eric Blake
2021-06-02 5:52 ` Sergio Lopez
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=20210601163201.e7cvtapzakaatigs@mhamilton \
--to=slp@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=nsoffer@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.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).