From: Denis V. Lunev Date: Wed, 20 Jan 2016 07:12:20 +0000 (+0300) Subject: nbd: add missed aio_context_acquire in nbd_export_new X-Git-Tag: v2.6.0-rc0~202^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5f3e12e8489f5325800c6a86fe5f476adfcbdae;p=thirdparty%2Fqemu.git 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 CC: Kevin Wolf CC: Paolo Bonzini Message-Id: <1453273940-15382-3-git-send-email-den@openvz.org> Signed-off-by: Paolo Bonzini --- diff --git a/nbd/server.c b/nbd/server.c index eead339a2cb..3596e68191a 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: