[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 32/48] block: acquire in bdrv_query_image_info
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 32/48] block: acquire in bdrv_query_image_info |
Date: |
Fri, 29 Jan 2016 18:37:38 +0100 |
From: Paolo Bonzini <address@hidden>
NFS calls aio_poll inside bdrv_get_allocated_size. This requires
acquiring the AioContext.
Signed-off-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block/qapi.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/block/qapi.c b/block/qapi.c
index bbe0c9d..2e83105 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -211,11 +211,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);
@@ -283,10 +285,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. */
--
1.8.3.1
- [Qemu-block] [PULL 21/48] nbd: Switch from close to eject notifier, (continued)
- [Qemu-block] [PULL 21/48] nbd: Switch from close to eject notifier, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 23/48] block: Use blk_remove_bs() in blk_delete(), Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 24/48] blockdev: Use blk_remove_bs() in do_drive_del(), Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 25/48] block: Make bdrv_close() static, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 26/48] block: Add list of all BlockDriverStates, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 28/48] block: Add blk_remove_all_bs(), Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 22/48] block: Remove BDS close notifier, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 30/48] iotests: Add test for multiple BB on BDS tree, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 27/48] blockdev: Keep track of monitor-owned BDS, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 31/48] iotests: Add test for block jobs and BDS ejection, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 32/48] block: acquire in bdrv_query_image_info,
Kevin Wolf <=
- [Qemu-block] [PULL 29/48] block: Rewrite bdrv_close_all(), Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 33/48] block: Add "file" output parameter to block status query functions, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 35/48] qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 34/48] qcow: Assign bs->file->bs to file in qcow_co_get_block_status, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 38/48] parallels: Assign bs->file->bs to file in parallels_co_get_block_status, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 37/48] iscsi: Assign bs to file in iscsi_co_get_block_status, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 36/48] raw: Assign bs to file in raw_co_get_block_status, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 40/48] sheepdog: Assign bs to file in sd_co_get_block_status, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 39/48] qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status, Kevin Wolf, 2016/01/29
- [Qemu-block] [PULL 41/48] vdi: Assign bs->file->bs to file in vdi_co_get_block_status, Kevin Wolf, 2016/01/29