hw/net/can: interrupt cleanup

Define two functions to update the interrupt state, and call them
on loadvm.  This removes the need to migrate the state as part of
vmstate_kvaser_pci.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2018-01-29 23:30:17 +01:00
parent e73e09481c
commit a62ed5d106
2 changed files with 45 additions and 41 deletions

View file

@ -264,10 +264,10 @@ static const VMStateDescription vmstate_kvaser_pci = {
.minimum_version_id_old = 1,
.fields = (VMStateField[]) {
VMSTATE_PCI_DEVICE(dev, KvaserPCIState),
/* Load this before sja_state. */
VMSTATE_UINT32(s5920_intcsr, KvaserPCIState),
VMSTATE_STRUCT(sja_state, KvaserPCIState, 0, vmstate_can_sja,
CanSJA1000State),
VMSTATE_UINT32(s5920_intcsr, KvaserPCIState),
VMSTATE_UINT32(s5920_irqstate, KvaserPCIState),
VMSTATE_END_OF_LIST()
}
};