mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
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>
This commit is contained in:
parent
2d1e9f96a2
commit
6f67c50ff4
2 changed files with 39 additions and 0 deletions
21
savevm.c
21
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue