diff --git a/block/block-backend.c b/block/block-backend.c index 7a7f6906122d1d2dd96bf2f448955382294f0295..ef16d7356a87fb433390d2e9f539ebda637782a4 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -642,6 +642,11 @@ void blk_remove_aio_context_notifier(BlockBackend *blk, detach_aio_context, opaque); } +void blk_add_close_notifier(BlockBackend *blk, Notifier *notify) +{ + bdrv_add_close_notifier(blk->bs, notify); +} + void blk_io_plug(BlockBackend *blk) { bdrv_io_plug(blk->bs); diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index d9c1337e3f76195371c2047a497de7a2df35896b..8871a021d0bdf1ce37ec06eb8f76969d25e6328d 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -143,6 +143,7 @@ void blk_remove_aio_context_notifier(BlockBackend *blk, void *), void (*detach_aio_context)(void *), void *opaque); +void blk_add_close_notifier(BlockBackend *blk, Notifier *notify); void blk_io_plug(BlockBackend *blk); void blk_io_unplug(BlockBackend *blk); BlockAcctStats *blk_get_stats(BlockBackend *blk);