qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] block: Cleanup BMDS in bdrv_close_all


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH] block: Cleanup BMDS in bdrv_close_all
Date: Tue, 5 Sep 2017 10:44:31 +0200
User-agent: Mutt/1.8.3 (2017-05-23)

Am 30.08.2017 um 12:06 hat Fam Zheng geschrieben:
> This fixes the assertion due to op blockers added by BMDS:
> 
> block.c:3248: bdrv_delete: Assertion `bdrv_op_blocker_is_empty(bs)' failed.
> 
> Reproducer: simply start block migration and quit QEMU before it ends.
> 
> Cc: address@hidden
> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  block.c                 | 2 ++
>  migration/block.c       | 2 +-
>  migration/block.h       | 1 +
>  stubs/Makefile.objs     | 1 +
>  stubs/block-migration.c | 6 ++++++
>  5 files changed, 11 insertions(+), 1 deletion(-)
>  create mode 100644 stubs/block-migration.c
> 
> diff --git a/block.c b/block.c
> index 3308814bba..508a57274d 100644
> --- a/block.c
> +++ b/block.c
> @@ -43,6 +43,7 @@
>  #include "qemu/cutils.h"
>  #include "qemu/id.h"
>  #include "qapi/util.h"
> +#include "migration/block.h"
>  
>  #ifdef CONFIG_BSD
>  #include <sys/ioctl.h>
> @@ -3111,6 +3112,7 @@ static void bdrv_close(BlockDriverState *bs)
>  
>  void bdrv_close_all(void)
>  {
> +    block_migration_cleanup_bmds();
>      block_job_cancel_sync_all();
>      nbd_export_close_all();

This is before bdrv_drain_all(). Can't we still have a block migration
request in flight, whose callback will then dereference a stale pointer?

Kevin



reply via email to

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