[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 16/17] ahci: Recompute cur_cmd on migrate post lo
From: |
John Snow |
Subject: |
[Qemu-devel] [PATCH v2 16/17] ahci: Recompute cur_cmd on migrate post load |
Date: |
Tue, 16 Dec 2014 20:36:06 -0500 |
When the AHCI HBA device is migrated, all of the information that
led to the request being created is stored in the AHCIDevice
structures, except for pointers into guest data where return
information needs to be stored.
The "cur_cmd" field is usually responsible for this.
To rebuild the cur_cmd pointer post-migration, we can utilize
the busy_slot index to figure out where the command header
we are still processing is.
This allows a machine in a halted state from rerror=stop or
werror=stop to be migrated and resume operations without issue.
Signed-off-by: John Snow <address@hidden>
---
hw/ide/ahci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index c153228..8078d3e 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1373,6 +1373,10 @@ static int ahci_state_post_load(void *opaque, int
version_id)
*/
if (ad->busy_slot == -1) {
check_cmd(s, i);
+ } else {
+ /* We are in the middle of a command, and may need to access
+ * the command header in guest memory again. */
+ ad->cur_cmd = &((AHCICmdHdr *)ad->lst)[ad->busy_slot];
}
}
--
1.9.3
- [Qemu-devel] [PATCH v2 09/17] ide: place initial state of the current request to IDEBus, (continued)
- [Qemu-devel] [PATCH v2 09/17] ide: place initial state of the current request to IDEBus, John Snow, 2014/12/16
- [Qemu-devel] [PATCH v2 11/17] ide: commonize io_buffer_index initialization, John Snow, 2014/12/16
- [Qemu-devel] [PATCH v2 10/17] ide: migrate initial request state via IDEBus, John Snow, 2014/12/16
- [Qemu-devel] [PATCH v2 12/17] ide: make more functions static, John Snow, 2014/12/16
- [Qemu-devel] [PATCH v2 13/17] ide: support PIO restart for the ISA controller, John Snow, 2014/12/16
- [Qemu-devel] [PATCH v2 15/17] ahci: add support for restarting non-queued commands, John Snow, 2014/12/16
- [Qemu-devel] [PATCH v2 14/17] ahci: Migrate IDEStatus, John Snow, 2014/12/16
- [Qemu-devel] [PATCH v2 17/17] qtest/ide: Test flush / retry for ISA and PCI, John Snow, 2014/12/16
- [Qemu-devel] [PATCH v2 16/17] ahci: Recompute cur_cmd on migrate post load,
John Snow <=
- Re: [Qemu-devel] [PATCH v2 00/17] ide: rerror and werror support for IDE and AHCI, Markus Armbruster, 2014/12/17