Comments
Patch
@@ -694,7 +694,7 @@ void qmp_blockdev_snapshot_sync(const char *device, const char *snapshot_file,
return;
}
- bdrv_drain_all();
+ bdrv_drain(bs);
bdrv_flush(bs);
bdrv_close(bs);
@@ -1014,7 +1014,7 @@ int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data)
}
/* quiesce block driver; prevent further io */
- bdrv_drain_all();
+ bdrv_drain(bs);
bdrv_flush(bs);
bdrv_close(bs);
@@ -192,7 +192,7 @@ static void pmac_ide_flush(DBDMA_io *io)
MACIOIDEState *m = io->opaque;
if (m->aiocb) {
- bdrv_drain_all();
+ bdrv_drain(m->aiocb->bs);
}
}
@@ -27,6 +27,7 @@
#include <hw/pci.h>
#include <hw/isa.h>
#include "block.h"
+#include "block_int.h"
#include "dma.h"
#include <hw/ide/pci.h>
@@ -309,7 +310,7 @@ void bmdma_cmd_writeb(BMDMAState *bm, uint32_t val)
* aio operation with preadv/pwritev.
*/
if (bm->bus->dma->aiocb) {
- bdrv_drain_all();
+ bdrv_drain(bm->bus->dma->aiocb->bs);
assert(bm->bus->dma->aiocb == NULL);
assert((bm->status & BM_STATUS_DMAING) == 0);
}