Necessary for bdrv_drain to run properly. Signed-off-by: Denis V. Lunev <d...@openvz.org> CC: Stefan Hajnoczi <stefa...@redhat.com> CC: Juan Quintela <quint...@redhat.com> CC: Amit Shah <amit.s...@redhat.com> --- 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':" -- 2.5.0