summary refs log tree commit diff stats
path: root/hw/ide/core.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-02-23 11:17:52 -0500
committerKevin Wolf <kwolf@redhat.com>2015-03-10 14:02:22 +0100
commitf878c916077d510be3276dad7c36f606cdcea80a (patch)
treec98666cdab1864856ce4a29674dc29637e685b26 /hw/ide/core.c
parentbd8892c4e6d681517c687ec5ac86eed46b3bb23b (diff)
downloadfocaccia-qemu-f878c916077d510be3276dad7c36f606cdcea80a.tar.gz
focaccia-qemu-f878c916077d510be3276dad7c36f606cdcea80a.zip
ide: introduce ide_register_restart_cb
A helper is added that registers the IDEDMAOp .restart_cb()
via qemu_add_vm_change_state_handler instead of requiring
each HBA to register the callback themselves.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1424708286-16483-4-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/core.c')
-rw-r--r--hw/ide/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index ac3f015a8d..5a42771420 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2330,6 +2330,11 @@ static const IDEDMAOps ide_dma_nop_ops = {
     .restart_cb     = ide_nop_restart,
 };
 
+void ide_register_restart_cb(IDEBus *bus)
+{
+    qemu_add_vm_change_state_handler(bus->dma->ops->restart_cb, bus->dma);
+}
+
 static IDEDMA ide_dma_nop = {
     .ops = &ide_dma_nop_ops,
     .aiocb = NULL,