From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtcvZ-00077f-Ks for qemu-devel@nongnu.org; Tue, 03 Nov 2015 09:51:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtcvV-0003j3-OP for qemu-devel@nongnu.org; Tue, 03 Nov 2015 09:51:13 -0500 From: Juan Quintela In-Reply-To: <1446559933-28965-4-git-send-email-den@openvz.org> (Denis V. Lunev's message of "Tue, 3 Nov 2015 17:12:06 +0300") References: <1446559933-28965-1-git-send-email-den@openvz.org> <1446559933-28965-4-git-send-email-den@openvz.org> Date: Tue, 03 Nov 2015 15:51:07 +0100 Message-ID: <87bnbbxhk4.fsf@emacs.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 03/10] migration: added missed aio_context_acquire around bdrv_snapshot_delete Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Amit Shah , qemu-devel@nongnu.org, Stefan Hajnoczi , qemu-stable@nongnu.org "Denis V. Lunev" wrote: > Necessary for bdrv_drain to run properly. > > Signed-off-by: Denis V. Lunev > CC: Stefan Hajnoczi > CC: Juan Quintela > CC: Amit Shah > --- See comments on previous thread just posted. Last Stefan suggestion was to move this code to snapshot.c, and then you don't need to convince migration folks of anything O:-) > migration/savevm.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/migration/savevm.c b/migration/savevm.c > index 1653f56..f45ff63 100644 > --- a/migration/savevm.c > +++ b/migration/savevm.c > @@ -1273,7 +1273,12 @@ static int del_existing_snapshots(Monitor *mon, const char *name) > while ((bs = bdrv_next(bs))) { > if (bdrv_can_snapshot(bs) && > bdrv_snapshot_find(bs, snapshot, name) >= 0) { > + AioContext *ctx = bdrv_get_aio_context(bs); > + > + aio_context_acquire(ctx); > bdrv_snapshot_delete_by_id_or_name(bs, name, &err); > + aio_context_release(ctx); > + > if (err) { > monitor_printf(mon, > "Error while deleting snapshot on device '%s':" > @@ -1518,8 +1523,13 @@ void hmp_delvm(Monitor *mon, const QDict *qdict) > bs = NULL; > while ((bs = bdrv_next(bs))) { > if (bdrv_can_snapshot(bs)) { > + AioContext *ctx = bdrv_get_aio_context(bs); > + > err = NULL; > + aio_context_acquire(ctx); > bdrv_snapshot_delete_by_id_or_name(bs, name, &err); > + aio_context_release(ctx); > + > if (err) { > monitor_printf(mon, > "Error while deleting snapshot on device '%s':"