diff options
author | Juan Quintela <quintela@redhat.com> | 2016-01-11 12:40:21 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2016-01-16 12:01:23 +0000 |
commit | 551747491d6677e4cc6cac8750462887a09bc722 (patch) | |
tree | e4cb1d54f966844df51b8035686ed7f7ae58e862 /migration | |
parent | 5a57acb66f19ee52723aa05b8afbbc41c3e9ec99 (diff) |
vmstate: introduce CPU_DoubleU arrays
Add vmstate support for migrating arrays of CPU_DoubleU via
VMSTATE_CPUDOUBLE_ARRAY.
Signed-off-by: Juan Quintela <quintela@redhat.com>
[PMM: rebased, since files have all moved since 2012;
added VMSTATE_CPUDOUBLE_ARRAY_V for consistency with FLOAT64]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/vmstate.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/migration/vmstate.c b/migration/vmstate.c index e8ccf22f67..f70fe59a3c 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -794,6 +794,29 @@ const VMStateInfo vmstate_info_float64 = { .put = put_float64, }; +/* CPU_DoubleU type */ + +static int get_cpudouble(QEMUFile *f, void *pv, size_t size) +{ + CPU_DoubleU *v = pv; + qemu_get_be32s(f, &v->l.upper); + qemu_get_be32s(f, &v->l.lower); + return 0; +} + +static void put_cpudouble(QEMUFile *f, void *pv, size_t size) +{ + CPU_DoubleU *v = pv; + qemu_put_be32s(f, &v->l.upper); + qemu_put_be32s(f, &v->l.lower); +} + +const VMStateInfo vmstate_info_cpudouble = { + .name = "CPU_Double_U", + .get = get_cpudouble, + .put = put_cpudouble, +}; + /* uint8_t buffers */ static int get_buffer(QEMUFile *f, void *pv, size_t size) |