summaryrefslogtreecommitdiffstats
path: root/hw/i2c/smbus_ich9.c
diff options
context:
space:
mode:
authorCorey Minyard2016-12-22 19:28:23 +0100
committerCorey Minyard2019-02-28 04:06:08 +0100
commit4ab2f2a8aabfea95cc53c64e13b3f67960b27fdf (patch)
treecdffe992b01919724c9320bed2c3646e60d2b540 /hw/i2c/smbus_ich9.c
parentmigration: Add a VMSTATE_BOOL_TEST() macro (diff)
downloadqemu-4ab2f2a8aabfea95cc53c64e13b3f67960b27fdf.tar.gz
qemu-4ab2f2a8aabfea95cc53c64e13b3f67960b27fdf.tar.xz
qemu-4ab2f2a8aabfea95cc53c64e13b3f67960b27fdf.zip
i2c:pm_smbus: Fix state transfer
Transfer the state information for the SMBus registers and internal data so it will work on a VM transfer. Signed-off-by: Corey Minyard <cminyard@mvista.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'hw/i2c/smbus_ich9.c')
-rw-r--r--hw/i2c/smbus_ich9.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
index e6d8d28194..7b24be8256 100644
--- a/hw/i2c/smbus_ich9.c
+++ b/hw/i2c/smbus_ich9.c
@@ -43,12 +43,20 @@ typedef struct ICH9SMBState {
PMSMBus smb;
} ICH9SMBState;
+static bool ich9_vmstate_need_smbus(void *opaque, int version_id)
+{
+ return pm_smbus_vmstate_needed();
+}
+
static const VMStateDescription vmstate_ich9_smbus = {
.name = "ich9_smb",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
- VMSTATE_PCI_DEVICE(dev, struct ICH9SMBState),
+ VMSTATE_PCI_DEVICE(dev, ICH9SMBState),
+ VMSTATE_BOOL_TEST(irq_enabled, ICH9SMBState, ich9_vmstate_need_smbus),
+ VMSTATE_STRUCT_TEST(smb, ICH9SMBState, ich9_vmstate_need_smbus, 1,
+ pmsmb_vmstate, PMSMBus),
VMSTATE_END_OF_LIST()
}
};