aboutsummaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-08-20 19:42:35 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:30:22 -0500
commit6f67c50ff42943a2ae51202dad0ef996dc40bb51 (patch)
tree0acd576a2ed29828b96a4417716e67b3b6ca6252 /savevm.c
parent2d1e9f96a2dc081e3a7eeb7b55482e0de4752fca (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.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/savevm.c b/savevm.c
index 0290c2e7e9..68fe924d43 100644
--- a/savevm.c
+++ b/savevm.c
@@ -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;