diff options
author | Juan Quintela <quintela@redhat.com> | 2009-10-16 15:39:58 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-27 12:28:48 -0500 |
commit | 4c18ce94fff28b129b4f311a9efafb97aa8c7543 (patch) | |
tree | 0b1e577e6ab27783672c212f8dec9cece48871da /hw | |
parent | eacf610f37c3ca27870cf0b2d55870e20a042962 (diff) | |
download | qemu-4c18ce94fff28b129b4f311a9efafb97aa8c7543.zip qemu-4c18ce94fff28b129b4f311a9efafb97aa8c7543.tar.gz qemu-4c18ce94fff28b129b4f311a9efafb97aa8c7543.tar.bz2 |
serial: use post_load version_id field and remove pre_load function
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/serial.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/hw/serial.c b/hw/serial.c index 869063c..86ac543 100644 --- a/hw/serial.c +++ b/hw/serial.c @@ -649,17 +649,13 @@ static void serial_pre_save(void *opaque) s->fcr_vmstate = s->fcr; } -static int serial_pre_load(void *opaque) -{ - SerialState *s = opaque; - s->fcr_vmstate = 0; - return 0; -} - static int serial_post_load(void *opaque, int version_id) { SerialState *s = opaque; + if (version_id < 3) { + s->fcr_vmstate = 0; + } /* Initialize fcr via setter to perform essential side-effects */ serial_ioport_write(s, 0x02, s->fcr_vmstate); return 0; @@ -670,7 +666,6 @@ static const VMStateDescription vmstate_serial = { .version_id = 3, .minimum_version_id = 2, .pre_save = serial_pre_save, - .pre_load = serial_pre_load, .post_load = serial_post_load, .fields = (VMStateField []) { VMSTATE_UINT16_V(divider, SerialState, 2), |