qemu/hw/ide
Pavel Butsykin 218fd37c68 ide: don't lose pending dma state
If the migration occurs after the IDE DMA has been set up but before it
has been initiated, the state gets lost upon save/restore. Specifically,
->dma_cb callback gets cleared, so, when the guest eventually starts bus
mastering, the DMA never completes, causing the guest to time out the
operation.

OTOH all the infrastructure is already in place to restart the DMA if
the migration happens while the DMA is in progress.

So reuse that infrastructure, by setting bus->error_status based on
->dma_cmd in pre_save if ->dma_cb callback is already set but DMAING is
clear. This will indicate the need for restart and make sure ->dma_cb
is restored in ide_restart_bh(); howeover since DMAING is clear the state
upon restore will be exactly "ready for DMA" as before the save.

Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1459924806-306-2-git-send-email-den@openvz.org
Signed-off-by: John Snow <jsnow@redhat.com>
2016-04-12 16:47:52 -04:00
..
ahci.c ahci: prohibit "restarting" the FIS or CLB engines 2016-02-10 13:29:40 -05:00
ahci.h ahci: Add allwinner AHCI 2015-11-06 14:09:01 -05:00
atapi.c ide: Clean up includes 2016-01-29 15:07:23 +00:00
cmd646.c ide: Clean up includes 2016-01-29 15:07:23 +00:00
core.c ide: don't lose pending dma state 2016-04-12 16:47:52 -04:00
ich.c ide: Clean up includes 2016-01-29 15:07:23 +00:00
internal.h ide: don't lose pending dma state 2016-04-12 16:47:52 -04:00
isa.c ide: Clean up includes 2016-01-29 15:07:23 +00:00
macio.c macio: add dma_active to VMStateDescription 2016-01-30 23:37:36 +11:00
Makefile.objs hw: make all of hw/ide/ configurable via default-configs/ 2013-04-08 18:13:12 +02:00
microdrive.c ide: Clean up includes 2016-01-29 15:07:23 +00:00
mmio.c ide: Clean up includes 2016-01-29 15:07:23 +00:00
pci.c ide: don't lose pending dma state 2016-04-12 16:47:52 -04:00
pci.h ide: place initial state of the current request to IDEBus 2015-03-10 14:02:22 +01:00
piix.c xen: Fix IDE unplug 2016-04-12 16:47:52 -04:00
qdev.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
via.c ide: Clean up includes 2016-01-29 15:07:23 +00:00