qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

block: use drained section in bdrv_close

bdrv_close is used when ejecting a medium. Use a drained section to ensure
that all I/O goes to either the old medium or the bitbucket.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1450867706-19860-2-git-send-email-pbonzini@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>

authored by

Paolo Bonzini and committed by
Max Reitz
fc27291d 7467d94c

+3 -1
+3 -1
block.c
··· 2154 2154 bdrv_io_limits_disable(bs); 2155 2155 } 2156 2156 2157 - bdrv_drain(bs); /* complete I/O */ 2157 + bdrv_drained_begin(bs); /* complete I/O */ 2158 2158 bdrv_flush(bs); 2159 2159 bdrv_drain(bs); /* in case flush left pending I/O */ 2160 + 2160 2161 notifier_list_notify(&bs->close_notifiers, bs); 2161 2162 2162 2163 if (bs->blk) { ··· 2206 2207 g_free(ban); 2207 2208 } 2208 2209 QLIST_INIT(&bs->aio_notifiers); 2210 + bdrv_drained_end(bs); 2209 2211 } 2210 2212 2211 2213 void bdrv_close_all(void)