block: acquire in bdrv_query_image_info
PATCH 1/1 block: acquire in bdrv_query_image_info
NFS calls aio_poll inside bdrv_get_allocated_size. This requires acquiring the AioContext.
Signed-off-by Paolo Bonzini <[email protected]>
--- block/qapi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
block/qapi.c +7 -2
@@ -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. */
Signature · 1 line
2.5.0
Quoted 46 lines · Paolo Bonzini
NFS calls
aio_pollinsidebdrv_get_allocated_size. This requires acquiring the AioContext.Signed-off-by Paolo Bonzini <[email protected]>--- block/qapi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)block/qapi.c +7
-2@@ -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. */ Signature · 1 line
2.5.0
Reviewed-by Fam Zheng <[email protected]>
Quoted 42 lines · Fam Zheng
Quoted 41 lines · Paolo Bonzini
NFS calls
aio_pollinsidebdrv_get_allocated_size. This requires acquiring the AioContext.Signed-off-by Paolo Bonzini <[email protected]>--- block/qapi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)block/qapi.c +7
-2@@ -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)); }
Quoted 9 lines
Quoted 5 lines
block/qapi.c +0
-0/* @p_info will be set only on success. */ Signature · 1 line
2.5.0Reviewed-by Fam Zheng <[email protected]>
Ping?
Paolo
Max Reitz
AppliedQuoted 7 lines · Paolo Bonzini
NFS calls
aio_pollinsidebdrv_get_allocated_size. This requires acquiring the AioContext.Signed-off-by Paolo Bonzini <[email protected]>--- 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