Fix race where a bm can get kicked off twice, resulting in an ioemu crash because the bm is no longer valid. diff -r a2b4ffd594a8 tools/ioemu/hw/ide.c --- a/tools/ioemu/hw/ide.c Thu Jun 14 14:26:39 2007 +0100 +++ b/tools/ioemu/hw/ide.c Thu Jun 14 14:30:51 2007 +0100 @@ -427,7 +427,8 @@ static void *dma_thread_func(void* opaqu if (rv != 0) { if (read(file_pipes[0], &req, sizeof(req)) == 0) return NULL; - dma_thread_loop(req); + if (req->status & BM_STATUS_DMAING) + dma_thread_loop(req); } else { if (suspend_requested) { /* Need to tidy up the DMA thread so that we don't end up