[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/32] scsi: esp: fix migration
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 17/32] scsi: esp: fix migration |
Date: |
Tue, 28 Jun 2016 19:33:47 +0200 |
Commit 926cde5 ("scsi: esp: make cmdbuf big enough for maximum CDB size",
2016-06-16) changed the size of a migrated field. Split it in two
parts, and only migrate the second part in a new vmstate version.
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi/esp.c | 5 +++--
include/migration/vmstate.h | 5 ++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index baa0a2c..1f2f2d3 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -574,7 +574,7 @@ static bool esp_mem_accepts(void *opaque, hwaddr addr,
const VMStateDescription vmstate_esp = {
.name ="esp",
- .version_id = 3,
+ .version_id = 4,
.minimum_version_id = 3,
.fields = (VMStateField[]) {
VMSTATE_BUFFER(rregs, ESPState),
@@ -585,7 +585,8 @@ const VMStateDescription vmstate_esp = {
VMSTATE_BUFFER(ti_buf, ESPState),
VMSTATE_UINT32(status, ESPState),
VMSTATE_UINT32(dma, ESPState),
- VMSTATE_BUFFER(cmdbuf, ESPState),
+ VMSTATE_PARTIAL_BUFFER(cmdbuf, ESPState, 16),
+ VMSTATE_BUFFER_START_MIDDLE_V(cmdbuf, ESPState, 16, 4),
VMSTATE_UINT32(cmdlen, ESPState),
VMSTATE_UINT32(do_cmd, ESPState),
VMSTATE_UINT32(dma_left, ESPState),
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 25ea58a..15ea767 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -904,8 +904,11 @@ extern const VMStateInfo vmstate_info_bitmap;
#define VMSTATE_PARTIAL_BUFFER(_f, _s, _size) \
VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, 0, _size)
+#define VMSTATE_BUFFER_START_MIDDLE_V(_f, _s, _start, _v) \
+ VMSTATE_STATIC_BUFFER(_f, _s, _v, NULL, _start, sizeof(typeof_field(_s,
_f)))
+
#define VMSTATE_BUFFER_START_MIDDLE(_f, _s, _start) \
- VMSTATE_STATIC_BUFFER(_f, _s, 0, NULL, _start, sizeof(typeof_field(_s,
_f)))
+ VMSTATE_BUFFER_START_MIDDLE_V(_f, _s, _start, 0)
#define VMSTATE_PARTIAL_VBUFFER(_f, _s, _size) \
VMSTATE_VBUFFER(_f, _s, 0, NULL, 0, _size)
--
2.7.4
- [Qemu-devel] [PULL 07/32] pckbd: handle A20 IRQ as GPIO, (continued)
- [Qemu-devel] [PULL 07/32] pckbd: handle A20 IRQ as GPIO, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 08/32] port92: handle A20 IRQ as GPIO, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 09/32] ICH9 SMB: make TYPE_ICH9_SMB_DEVICE macro public, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 11/32] ich9: clean up ich9_lpc_update_pic/ich9_lpc_update_apic and callers, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 12/32] ich9: unify pic and ioapic IRQ vectors, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 10/32] ich9: call ich9_lpc_update_pic for disabled pirqs, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 13/32] ICH9 LPC: handle GSI as qdev GPIO, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 14/32] ICH9 LPC: move call of isa_bus_irqs to 'realize' method, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 16/32] MC146818 RTC: add GPIO access to output IRQ, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 15/32] isa: introduce wrapper isa_connect_gpio_out, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 17/32] scsi: esp: fix migration,
Paolo Bonzini <=
- [Qemu-devel] [PULL 18/32] vnc: generalize "VNC server running on ..." message, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 19/32] pci-assign: Move "Invalid ROM" error message to pci-assign-load-rom.c, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 21/32] char: clean up remaining chardevs when leaving, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 22/32] socket: add listen feature, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 23/32] socket: unlink unix socket on remove, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 24/32] iscsi: fix assertion in is_sector_request_lun_aligned, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 26/32] serial: simplify tsr_retry reset, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 20/32] target-*: Don't redefine cpu_exec(), Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 25/32] serial: make tsr_retry unsigned, Paolo Bonzini, 2016/06/28
- [Qemu-devel] [PULL 29/32] serial: remove watch on reset, Paolo Bonzini, 2016/06/28