qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: acquire in bdrv_query_image_info
@ 2015-12-23 10:48 Paolo Bonzini
  2015-12-25  1:51 ` Fam Zheng
  2016-01-14 15:25 ` Max Reitz
  0 siblings, 2 replies; 4+ messages in thread
From: Paolo Bonzini @ 2015-12-23 10:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] block: acquire in bdrv_query_image_info
  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
  2016-01-14 15:25 ` Max Reitz
  1 sibling, 1 reply; 4+ messages in thread
From: Fam Zheng @ 2015-12-25  1:51 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-block

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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] block: acquire in bdrv_query_image_info
  2015-12-25  1:51 ` Fam Zheng
@ 2016-01-11  8:32   ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2016-01-11  8:32 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, qemu-block



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] block: acquire in bdrv_query_image_info
  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-14 15:25 ` Max Reitz
  1 sibling, 0 replies; 4+ messages in thread
From: Max Reitz @ 2016-01-14 15:25 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: qemu-block

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

On 23.12.2015 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(-)

Thanks, applied to my block tree:

https://github.com/XanClic/qemu/commits/block

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-14 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-01-14 15:25 ` Max Reitz

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).