diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-04 17:11:10 -0400 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-08-15 18:03:12 +0100 |
commit | 4855b57639d181362678ab09614a7f753df8e466 (patch) | |
tree | 9cf869aae86cf71bcada537cf2848e21b0e669e0 /hw/ide/core.c | |
parent | 446351236b6e9c53b25e30d107c6235347df1dde (diff) |
ide: wrap start_dma callback
Make it optional and prepare for the next patches.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/ide/core.c')
-rw-r--r-- | hw/ide/core.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index e5ddecb811..aa561ae4f8 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -745,7 +745,14 @@ static void ide_sector_start_dma(IDEState *s, enum ide_dma_cmd dma_cmd) break; } - s->bus->dma->ops->start_dma(s->bus->dma, s, ide_dma_cb); + ide_start_dma(s, ide_dma_cb); +} + +void ide_start_dma(IDEState *s, BlockDriverCompletionFunc *cb) +{ + if (s->bus->dma->ops->start_dma) { + s->bus->dma->ops->start_dma(s->bus->dma, s, cb); + } } static void ide_sector_write_timer_cb(void *opaque) @@ -2204,11 +2211,6 @@ static void ide_init1(IDEBus *bus, int unit) ide_sector_write_timer_cb, s); } -static void ide_nop_start(IDEDMA *dma, IDEState *s, - BlockDriverCompletionFunc *cb) -{ -} - static int ide_nop_int(IDEDMA *dma, int x) { return 0; @@ -2219,7 +2221,6 @@ static void ide_nop_restart(void *opaque, int x, RunState y) } static const IDEDMAOps ide_dma_nop_ops = { - .start_dma = ide_nop_start, .prepare_buf = ide_nop_int, .rw_buf = ide_nop_int, .set_unit = ide_nop_int, |