Patchwork [08/14] ide: Fix ide_drive_pio_state_needed()

login
register
mail settings
Submitter Kevin Wolf
Date June 15, 2011, 2:03 p.m.
Message ID <1308146593-19842-9-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/100531/
State New
Headers show

Comments

Kevin Wolf - June 15, 2011, 2:03 p.m.
When a failed PIO request caused the VM to stop, we still need to transfer the
PIO state even though DRQ=0 at this point.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/ide/core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/ide/core.c b/hw/ide/core.c
index da250ac..e5def8b 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1837,7 +1837,8 @@  static bool ide_drive_pio_state_needed(void *opaque)
 {
     IDEState *s = opaque;
 
-    return (s->status & DRQ_STAT) != 0;
+    return ((s->status & DRQ_STAT) != 0)
+        || (s->bus->error_status & BM_STATUS_PIO_RETRY);
 }
 
 static bool ide_atapi_gesn_needed(void *opaque)