diff options
author | Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> | 2014-08-28 15:18:46 +0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-09-11 12:20:32 +0200 |
commit | 461a2753a195b2f508b4438c8a58208a69ad7772 (patch) | |
tree | 24c4cdb9f690bd7eb047b0cbd10fb0d09991f222 /hw/char/parallel.c | |
parent | c0b92f30373ce69811073eabf43f07f37f22c97a (diff) |
parallel: adding vmstate for save/restore
VMState added by this patch preserves correct
loading of the parallel port controller state.
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Acked-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/char/parallel.c')
-rw-r--r-- | hw/char/parallel.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/char/parallel.c b/hw/char/parallel.c index 7ac90a512b..c2b553f0d1 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -477,6 +477,23 @@ static const MemoryRegionPortio isa_parallel_portio_sw_list[] = { PORTIO_END_OF_LIST(), }; + +static const VMStateDescription vmstate_parallel_isa = { + .name = "parallel_isa", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) { + VMSTATE_UINT8(state.dataw, ISAParallelState), + VMSTATE_UINT8(state.datar, ISAParallelState), + VMSTATE_UINT8(state.status, ISAParallelState), + VMSTATE_UINT8(state.control, ISAParallelState), + VMSTATE_INT32(state.irq_pending, ISAParallelState), + VMSTATE_INT32(state.epp_timeout, ISAParallelState), + VMSTATE_END_OF_LIST() + } +}; + + static void parallel_isa_realizefn(DeviceState *dev, Error **errp) { static int index; @@ -606,6 +623,7 @@ static void parallel_isa_class_initfn(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = parallel_isa_realizefn; + dc->vmsd = &vmstate_parallel_isa; dc->props = parallel_isa_properties; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } |