diff options
author | Glauber Costa <glommer@redhat.com> | 2009-10-16 15:27:37 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2009-10-19 17:44:14 -0200 |
commit | e4d6d49061b45e7134437cdd5bae2d443eedc3bc (patch) | |
tree | 437aabda6ec50dadae4cc632b2c2bf0d1c233dcd /savevm.c | |
parent | fix monitor.c build breakage (diff) | |
download | qemu-kvm-e4d6d49061b45e7134437cdd5bae2d443eedc3bc.tar.gz qemu-kvm-e4d6d49061b45e7134437cdd5bae2d443eedc3bc.tar.bz2 qemu-kvm-e4d6d49061b45e7134437cdd5bae2d443eedc3bc.zip |
introduce VMSTATE_U64
This is a patch actually written by Juan, which, according to him,
he plans on posting to qemu.git. Problem is that linux defines
u64 in a way that is type-uncompatible with uint64_t.
I am including it here, because it is a dependency to my patch series
that follows.
Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'savevm.c')
-rw-r--r-- | savevm.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -848,6 +848,29 @@ const VMStateInfo vmstate_info_uint64 = { .put = put_uint64, }; +/* 64 bit linux kernel unsigned int */ + +#ifdef __linux__ +static int get_u64(QEMUFile *f, void *pv, size_t size) +{ + __u64 *v = pv; + qemu_get_be64s(f, (uint64_t *)v); + return 0; +} + +static void put_u64(QEMUFile *f, void *pv, size_t size) +{ + __u64 *v = pv; + qemu_put_be64s(f, (uint64_t *)v); +} + +const VMStateInfo vmstate_info_u64 = { + .name = "__u64", + .get = get_u64, + .put = put_u64, +}; +#endif /* __linux__ */ + /* 8 bit int. See that the received value is the same than the one in the field */ |