From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Eric Blake <eblake@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PULL for-2.9 2/3] block: Simplify BDRV_BLOCK_RAW recursion
Date: Fri, 12 May 2017 10:37:16 -0400 [thread overview]
Message-ID: <20170512143717.30391-3-stefanha@redhat.com> (raw)
In-Reply-To: <20170512143717.30391-1-stefanha@redhat.com>
From: Eric Blake <eblake@redhat.com>
Since we are already in coroutine context during the body of
bdrv_co_get_block_status(), we can shave off a few layers of
wrappers when recursing to query the protocol when a format driver
returned BDRV_BLOCK_RAW.
Note that we are already using the correct recursion later on in
the same function, when probing whether the protocol layer is sparse
in order to find out if we can add BDRV_BLOCK_ZERO to an existing
BDRV_BLOCK_DATA|BDRV_BLOCK_OFFSET_VALID.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 20170504173745.27414-1-eblake@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/io.c b/block/io.c
index 40bd94f..fdd7485 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1784,8 +1784,8 @@ static int64_t coroutine_fn bdrv_co_get_block_status(BlockDriverState *bs,
if (ret & BDRV_BLOCK_RAW) {
assert(ret & BDRV_BLOCK_OFFSET_VALID);
- ret = bdrv_get_block_status(*file, ret >> BDRV_SECTOR_BITS,
- *pnum, pnum, file);
+ ret = bdrv_co_get_block_status(*file, ret >> BDRV_SECTOR_BITS,
+ *pnum, pnum, file);
goto out;
}
--
2.9.3
next prev parent reply other threads:[~2017-05-12 14:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-12 14:37 [Qemu-devel] [PULL for-2.9 0/3] Block patches Stefan Hajnoczi
2017-05-12 14:37 ` [Qemu-devel] [PULL for-2.9 1/3] coroutine: remove GThread implementation Stefan Hajnoczi
2017-05-12 20:19 ` Eric Blake
2017-05-15 13:38 ` Stefan Hajnoczi
2017-05-12 14:37 ` Stefan Hajnoczi [this message]
2017-05-12 14:37 ` [Qemu-devel] [PULL for-2.9 3/3] aio: add missing aio_notify() to aio_enable_external() Stefan Hajnoczi
2017-05-15 13:38 ` [Qemu-devel] [PULL for-2.9 0/3] Block patches 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=20170512143717.30391-3-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=eblake@redhat.com \
--cc=peter.maydell@linaro.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).