@@ -1042,6 +1042,8 @@ static void coroutine_fn bdrv_rw_co_entry(void *opaque)
{
RwCo *rwco = opaque;
+ printf("bdrv_rw_co_entry is_write %d sector_num %" PRId64 " nb_sectors %d =",
+ rwco->is_write, rwco->sector_num, rwco->nb_sectors);
if (!rwco->is_write) {
rwco->ret = bdrv_co_do_readv(rwco->bs, rwco->sector_num,
rwco->nb_sectors, rwco->qiov);
@@ -1049,6 +1051,8 @@ static void coroutine_fn bdrv_rw_co_entry(void *opaque)
rwco->ret = bdrv_co_do_writev(rwco->bs, rwco->sector_num,
rwco->nb_sectors, rwco->qiov);
}
+ assert(rwco->ret != NOT_DONE);
+ printf("%d\n", rwco->ret);
}
/*
@@ -1081,6 +1085,7 @@ static int bdrv_rw_co(BlockDriverState *bs, int64_t sector_num, uint8_t *
co = qemu_coroutine_create(bdrv_rw_co_entry);
qemu_coroutine_enter(co, &rwco);
while (rwco.ret == NOT_DONE) {
+ printf("waiting for rwco.ret != NOT_DONE\n");
qemu_aio_wait();
}
}