qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-stable] [PATCH 03/10] migration: added missed aio_context_acqu


From: Juan Quintela
Subject: Re: [Qemu-stable] [PATCH 03/10] migration: added missed aio_context_acquire around bdrv_snapshot_delete
Date: Tue, 03 Nov 2015 15:51:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

"Denis V. Lunev" <address@hidden> wrote:
> Necessary for bdrv_drain to run properly.
>
> Signed-off-by: Denis V. Lunev <address@hidden>
> CC: Stefan Hajnoczi <address@hidden>
> CC: Juan Quintela <address@hidden>
> CC: Amit Shah <address@hidden>
> ---

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':"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]