Skip to contentSkip to conversation

ide: fix halted IO segfault at reset

PATCH New John Snow 1 participant 2 messages Jul 27, 2016

lore
Share & tools
lore

John Snow

author
#0 lore raw

v2 cover ide: fix halted IO segfault at reset

One last time, with feeling:
Added Laszlo's R-B and properly re-affixed my S-O-B.

________________________________________________________________________________

For convenience, this branch is available at:
https://github.com/jnsnow/qemu.git branch ide-reset-segfault
https://github.com/jnsnow/qemu/tree/ide-reset-segfault

This version is tagged ide-reset-segfault-v2:
https://github.com/jnsnow/qemu/releases/tag/ide-reset-segfault-v2

John Snow (1):
ide: fix halted IO segfault at reset

 hw/ide/core.c | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 1/1 ide: fix halted IO segfault at reset

If one attempts to perform a system_reset after a failed IO request that causes the VM to enter a paused state, QEMU will segfault trying to free up the pending IO requests.

These requests have already been completed and freed, though, so all we need to do is NULL them before we enter the paused state.

Existing AHCI tests verify that halted requests are still resumed successfully after a STOP event.

---
 hw/ide/core.c | 1 +
 1 file changed, 1 insertion(+)
hw/ide/core.c +1 -0
index 081c9eb..d117b7c 100644
@@ -823,6 +823,7 @@ static void ide_dma_cb(void *opaque, int ret)
     }
     if (ret < 0) {
         if (ide_handle_rw_error(s, -ret, ide_dma_cmd_to_retry(s->dma_cmd))) {
+            s->bus->dma->aiocb = NULL;
             return;
         }
     }
Signature · 1 line
2.7.4