diff options
author | Juan Quintela <quintela@redhat.com> | 2009-08-20 19:42:35 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-08-27 20:30:22 -0500 |
commit | 6f67c50ff42943a2ae51202dad0ef996dc40bb51 (patch) | |
tree | 0acd576a2ed29828b96a4417716e67b3b6ca6252 /savevm.c | |
parent | 2d1e9f96a2dc081e3a7eeb7b55482e0de4752fca (diff) |
Add VMState support for static sized buffers (uint_8)
This patch adds support for static sized buffer and typecheks that the buffer is right.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r-- | savevm.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -848,6 +848,27 @@ const VMStateInfo vmstate_info_timer = { .put = put_timer, }; +/* uint8_t buffers */ + +static int get_buffer(QEMUFile *f, void *pv, size_t size) +{ + uint8_t *v = pv; + qemu_get_buffer(f, v, size); + return 0; +} + +static void put_buffer(QEMUFile *f, const void *pv, size_t size) +{ + uint8_t *v = (void *)pv; + qemu_put_buffer(f, v, size); +} + +const VMStateInfo vmstate_info_buffer = { + .name = "buffer", + .get = get_buffer, + .put = put_buffer, +}; + typedef struct SaveStateEntry { char idstr[256]; int instance_id; |