diff mbox

[18/24] ide: pass IDEBus to the restart_cb

Message ID 1382978620-16641-19-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Oct. 28, 2013, 4:43 p.m. UTC
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/ide/core.c | 2 +-
 hw/ide/pci.c  | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Paolo Bonzini Oct. 30, 2013, 12:19 p.m. UTC | #1
Il 28/10/2013 17:43, Paolo Bonzini ha scritto:
> @@ -199,8 +199,8 @@ static void ide_restart_dma(IDEState *s, enum ide_dma_cmd dma_cmd)
>  /* TODO This should be common IDE code */
>  static void bmdma_restart_bh(void *opaque)
>  {
> -    BMDMAState *bm = opaque;
> -    IDEBus *bus = bm->bus;
> +    IDEBus *bus = opaque;
> +    BMDMAState *bm = DO_UPCAST(BMDMAState, dma, bus->dma);
>      IDEState *s;
>      bool is_read;
>      int error_status;

The corresponding change in qemu_bh_new is mistakenly in patch 19,
rather than in this one.

Paolo
diff mbox

Patch

diff --git a/hw/ide/core.c b/hw/ide/core.c
index 93cfd46..5820fad 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2195,7 +2195,7 @@  static const IDEDMAOps ide_dma_nop_ops = {
 
 void ide_register_restart_cb(IDEBus *bus)
 {
-    qemu_add_vm_change_state_handler(bus->dma->ops->restart_cb, bus->dma);
+    qemu_add_vm_change_state_handler(bus->dma->ops->restart_cb, bus);
 }
 
 static IDEDMA ide_dma_nop = {
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 4df50dc..9d26a26 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -199,8 +199,8 @@  static void ide_restart_dma(IDEState *s, enum ide_dma_cmd dma_cmd)
 /* TODO This should be common IDE code */
 static void bmdma_restart_bh(void *opaque)
 {
-    BMDMAState *bm = opaque;
-    IDEBus *bus = bm->bus;
+    IDEBus *bus = opaque;
+    BMDMAState *bm = DO_UPCAST(BMDMAState, dma, bus->dma);
     IDEState *s;
     bool is_read;
     int error_status;
@@ -240,8 +240,8 @@  static void bmdma_restart_bh(void *opaque)
 
 static void bmdma_restart_cb(void *opaque, int running, RunState state)
 {
-    IDEDMA *dma = opaque;
-    BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma);
+    IDEBus *bus = opaque;
+    BMDMAState *bm = DO_UPCAST(BMDMAState, dma, bus->dma);
 
     if (!running)
         return;