[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 23/50] block: Use blk_remove_bs() in blk_delete()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PULL v2 23/50] block: Use blk_remove_bs() in blk_delete() |
Date: |
Tue, 2 Feb 2016 18:35:16 +0100 |
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/block-backend.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/block/block-backend.c b/block/block-backend.c
index 621787c..7f5ad59 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -166,10 +166,7 @@ static void blk_delete(BlockBackend *blk)
assert(!blk->refcnt);
assert(!blk->dev);
if (blk->bs) {
- assert(blk->bs->blk == blk);
- blk->bs->blk = NULL;
- bdrv_unref(blk->bs);
- blk->bs = NULL;
+ blk_remove_bs(blk);
}
assert(QLIST_EMPTY(&blk->remove_bs_notifiers.notifiers));
assert(QLIST_EMPTY(&blk->insert_bs_notifiers.notifiers));
@@ -351,6 +348,8 @@ void blk_hide_on_behalf_of_hmp_drive_del(BlockBackend *blk)
*/
void blk_remove_bs(BlockBackend *blk)
{
+ assert(blk->bs->blk == blk);
+
notifier_list_notify(&blk->remove_bs_notifiers, blk);
blk_update_root_state(blk);
--
2.7.0
- [Qemu-devel] [PULL v2 14/50] iotests: Add test for a nonexistent NBD export, (continued)
- [Qemu-devel] [PULL v2 14/50] iotests: Add test for a nonexistent NBD export, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 16/50] block: Release named dirty bitmaps in bdrv_close(), Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 15/50] block: Remove unused struct definition BlockFinishData, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 18/50] block: Add BB-BDS remove/insert notifiers, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 17/50] iotests: Add test for eject under NBD server, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 21/50] nbd: Switch from close to eject notifier, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 19/50] virtio-blk: Functions for op blocker management, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 20/50] virtio-scsi: Catch BDS-BB removal/insertion, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 24/50] blockdev: Use blk_remove_bs() in do_drive_del(), Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 22/50] block: Remove BDS close notifier, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 23/50] block: Use blk_remove_bs() in blk_delete(),
Max Reitz <=
- [Qemu-devel] [PULL v2 26/50] block: Add list of all BlockDriverStates, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 25/50] block: Make bdrv_close() static, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 29/50] block: Rewrite bdrv_close_all(), Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 28/50] block: Add blk_remove_all_bs(), Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 27/50] blockdev: Keep track of monitor-owned BDS, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 30/50] iotests: Add test for multiple BB on BDS tree, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 32/50] block: acquire in bdrv_query_image_info, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 31/50] iotests: Add test for block jobs and BDS ejection, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 34/50] qcow: Assign bs->file->bs to file in qcow_co_get_block_status, Max Reitz, 2016/02/02
- [Qemu-devel] [PULL v2 35/50] qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status, Max Reitz, 2016/02/02