From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/1] block-backend: simplify blk_get_aio_context
Date: Wed, 4 Apr 2018 16:54:02 -0300 [thread overview]
Message-ID: <6d87d12c-eeb5-8931-a5c6-1dd239e07e3a@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180327130846.21902-1-danielhb@linux.vnet.ibm.com>
Ping
On 03/27/2018 10:08 AM, Daniel Henrique Barboza wrote:
> blk_get_aio_context verifies if BlockDriverState bs is not NULL,
> return bdrv_get_aio_context(bs) if true or qemu_get_aio_context()
> otherwise. However, bdrv_get_aio_context from block.c already does
> this verification itself, also returning qemu_get_aio_context()
> if bs is NULL:
>
> AioContext *bdrv_get_aio_context(BlockDriverState *bs)
> {
> return bs ? bs->aio_context : qemu_get_aio_context();
> }
>
> This patch simplifies blk_get_aio_context to simply call
> bdrv_get_aio_context instead of replicating the same logic.
>
> Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
> ---
> block/block-backend.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/block/block-backend.c b/block/block-backend.c
> index 681b240b12..89f47b00ea 100644
> --- a/block/block-backend.c
> +++ b/block/block-backend.c
> @@ -1865,13 +1865,7 @@ void blk_op_unblock_all(BlockBackend *blk, Error *reason)
>
> AioContext *blk_get_aio_context(BlockBackend *blk)
> {
> - BlockDriverState *bs = blk_bs(blk);
> -
> - if (bs) {
> - return bdrv_get_aio_context(bs);
> - } else {
> - return qemu_get_aio_context();
> - }
> + return bdrv_get_aio_context(blk_bs(blk));
> }
>
> static AioContext *blk_aiocb_get_aio_context(BlockAIOCB *acb)
next prev parent reply other threads:[~2018-04-04 19:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-27 13:08 [Qemu-devel] [PATCH 1/1] block-backend: simplify blk_get_aio_context Daniel Henrique Barboza
2018-03-27 13:24 ` Darren Kenny
2018-04-04 19:54 ` Daniel Henrique Barboza [this message]
2018-04-09 10:27 ` Kevin Wolf
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=6d87d12c-eeb5-8931-a5c6-1dd239e07e3a@linux.vnet.ibm.com \
--to=danielhb@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--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).