We call bdrv_attach_dev when initializing whether or not bs is created
locally, so call bdrv_detach_dev and let the refcnt handle the
lifecycle.
Signed-off-by: Fam Zheng
---
hw/block/xen_disk.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/hw/block/xen_disk.c b/
Better to split it into two patches:
1 bugfix: always call bdrv_detach_dev().
2 use refcnt to manage lifecycle.
> We call bdrv_attach_dev when initializing whether or not bs is created
> locally, so call bdrv_detach_dev and let the refcnt handle the
> lifecycle.
>
> Signed-off-by: Fam Zheng
> --