From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: acquire in bdrv_query_image_info
Date: Mon, 11 Jan 2016 09:32:16 +0100 [thread overview]
Message-ID: <56936890.5080206@redhat.com> (raw)
In-Reply-To: <20151225015103.GA26066@ad.usersys.redhat.com>
On 25/12/2015 02:51, Fam Zheng wrote:
> On Wed, 12/23 11:48, Paolo Bonzini wrote:
>> NFS calls aio_poll inside bdrv_get_allocated_size. This requires
>> acquiring the AioContext.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> block/qapi.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/block/qapi.c b/block/qapi.c
>> index fecac25..ea400e0 100644
>> --- a/block/qapi.c
>> +++ b/block/qapi.c
>> @@ -210,11 +210,13 @@ void bdrv_query_image_info(BlockDriverState *bs,
>> Error *err = NULL;
>> ImageInfo *info;
>>
>> + aio_context_acquire(bdrv_get_aio_context(bs));
>> +
>> size = bdrv_getlength(bs);
>> if (size < 0) {
>> error_setg_errno(errp, -size, "Can't get size of device '%s'",
>> bdrv_get_device_name(bs));
>> - return;
>> + goto out;
>> }
>>
>> info = g_new0(ImageInfo, 1);
>> @@ -281,10 +283,13 @@ void bdrv_query_image_info(BlockDriverState *bs,
>> default:
>> error_propagate(errp, err);
>> qapi_free_ImageInfo(info);
>> - return;
>> + goto out;
>> }
>>
>> *p_info = info;
>> +
>> +out:
>> + aio_context_release(bdrv_get_aio_context(bs));
>> }
>>
>> /* @p_info will be set only on success. */
>> --
>> 2.5.0
>>
>>
>
> Reviewed-by: Fam Zheng <famz@redhat.com>
>
>
Ping?
Paolo
next prev parent reply other threads:[~2016-01-11 8:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 10:48 [Qemu-devel] [PATCH] block: acquire in bdrv_query_image_info Paolo Bonzini
2015-12-25 1:51 ` Fam Zheng
2016-01-11 8:32 ` Paolo Bonzini [this message]
2016-01-14 15:25 ` 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=56936890.5080206@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=qemu-block@nongnu.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).