aboutsummaryrefslogtreecommitdiff
path: root/nbd/server.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2016-01-20 10:12:20 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-01-26 15:58:14 +0100
commite5f3e12e8489f5325800c6a86fe5f476adfcbdae (patch)
tree10c2fbacc5005b719645f50cddb25de1c22eaa62 /nbd/server.c
parentfae947b096020e5004ec7ae106a95a69a5e4d929 (diff)
nbd: add missed aio_context_acquire in nbd_export_new
blk_invalidate_cache() can call qcow2_invalidate_cache which performs IO inside. Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Kevin Wolf <kwolf@redhat.com> CC: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1453273940-15382-3-git-send-email-den@openvz.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'nbd/server.c')
-rw-r--r--nbd/server.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/nbd/server.c b/nbd/server.c
index eead339a2c..3596e68191 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -671,7 +671,9 @@ NBDExport *nbd_export_new(BlockBackend *blk, off_t dev_offset, off_t size,
* that BDRV_O_INCOMING is cleared and the image is ready for write
* access since the export could be available before migration handover.
*/
+ aio_context_acquire(exp->ctx);
blk_invalidate_cache(blk, NULL);
+ aio_context_release(exp->ctx);
return exp;
fail: