From: Paolo Bonzini <pbonzini@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 for-2.11] block: Make bdrv_next() keep strong references
Date: Sat, 11 Nov 2017 01:08:51 +0100 [thread overview]
Message-ID: <e4501a6c-3643-d0cb-4b6f-a6569646edad@redhat.com> (raw)
In-Reply-To: <20171110172545.32609-1-mreitz@redhat.com>
On 10/11/2017 18:25, Max Reitz wrote:
> if (bs) {
> + bdrv_ref(bs);
> + bdrv_unref(old_bs);
> return bs;
> }
Maybe instead goto...
> it->phase = BDRV_NEXT_MONITOR_OWNED;
> + } else {
> + old_bs = it->bs;
> }
>
> /* Then return the monitor-owned BDSes without a BB attached. Ignore all
> @@ -467,18 +483,46 @@ BlockDriverState *bdrv_next(BdrvNextIterator *it)
> bs = it->bs;
> } while (bs && bdrv_has_blk(bs));
... here?
Paolo
> + if (bs) {
> + bdrv_ref(bs);
> + }
> + bdrv_unref(old_bs);
> +
> return bs;
next prev parent reply other threads:[~2017-11-11 0:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-10 17:25 [Qemu-devel] [PATCH v2 for-2.11] block: Make bdrv_next() keep strong references Max Reitz
2017-11-11 0:08 ` Paolo Bonzini [this message]
2017-11-13 16:18 ` Max Reitz
2017-11-13 14:30 ` Stefan Hajnoczi
2017-11-17 16:08 ` Max Reitz
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=e4501a6c-3643-d0cb-4b6f-a6569646edad@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@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).