static void bdrv_qed_detach_aio_context(BlockDriverState *bs) { BDRVQEDState *s = bs->opaque; qed_cancel_need_check_timer(s); timer_free(s->need_check_timer); }
static void bdrv_qed_close(BlockDriverState *bs) { BDRVQEDState *s = bs->opaque; qed_cancel_need_check_timer(s); timer_free(s->need_check_timer); /* Ensure writes reach stable storage */ bdrv_flush(bs->file); /* Clean shutdown, no check required on next open */ if (s->header.features & QED_F_NEED_CHECK) { s->header.features &= ~QED_F_NEED_CHECK; qed_write_header_sync(s); } qed_free_l2_cache(&s->l2_cache); qemu_vfree(s->l1_table); }