mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
vmstate: add VMSTATE_UINT32_EQUAL
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
23bfe28fff
commit
9122a8fed7
2 changed files with 25 additions and 0 deletions
21
savevm.c
21
savevm.c
|
@ -882,6 +882,27 @@ const VMStateInfo vmstate_info_uint32 = {
|
|||
.put = put_uint32,
|
||||
};
|
||||
|
||||
/* 32 bit uint. See that the received value is the same than the one
|
||||
in the field */
|
||||
|
||||
static int get_uint32_equal(QEMUFile *f, void *pv, size_t size)
|
||||
{
|
||||
uint32_t *v = pv;
|
||||
uint32_t v2;
|
||||
qemu_get_be32s(f, &v2);
|
||||
|
||||
if (*v == v2) {
|
||||
return 0;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
const VMStateInfo vmstate_info_uint32_equal = {
|
||||
.name = "uint32 equal",
|
||||
.get = get_uint32_equal,
|
||||
.put = put_uint32,
|
||||
};
|
||||
|
||||
/* 64 bit unsigned int */
|
||||
|
||||
static int get_uint64(QEMUFile *f, void *pv, size_t size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue