migration: extend VMStateInfo

Current migration code cannot handle some data structures such as
QTAILQ in qemu/queue.h. Here we extend the signatures of put/get
in VMStateInfo so that customized handling is supported. put now
will return int type.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Signed-off-by: Jianjun Duan <duanj@linux.vnet.ibm.com>
Message-Id: <1484852453-12728-2-git-send-email-duanj@linux.vnet.ibm.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
Jianjun Duan 2017-01-19 11:00:50 -08:00 committed by Dr. David Alan Gilbert
parent d7fc72ceb5
commit 2c21ee769e
22 changed files with 262 additions and 105 deletions

View file

@ -555,17 +555,21 @@ static void fw_cfg_reset(DeviceState *d)
Or we broke compatibility in the state, or we can't use struct tm
*/
static int get_uint32_as_uint16(QEMUFile *f, void *pv, size_t size)
static int get_uint32_as_uint16(QEMUFile *f, void *pv, size_t size,
VMStateField *field)
{
uint32_t *v = pv;
*v = qemu_get_be16(f);
return 0;
}
static void put_unused(QEMUFile *f, void *pv, size_t size)
static int put_unused(QEMUFile *f, void *pv, size_t size, VMStateField *field,
QJSON *vmdesc)
{
fprintf(stderr, "uint32_as_uint16 is only used for backward compatibility.\n");
fprintf(stderr, "This functions shouldn't be called.\n");
return 0;
}
static const VMStateInfo vmstate_hack_uint32_as_uint16 = {