[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [QEMU PATCH v6 1/2] migration: extend VMStateInfo
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-ppc] [QEMU PATCH v6 1/2] migration: extend VMStateInfo |
Date: |
Fri, 14 Oct 2016 10:23:23 +0100 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
* Jianjun Duan (address@hidden) wrote:
> 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.
>
> Signed-off-by: Jianjun Duan <address@hidden>
> ---
> hw/display/virtio-gpu.c | 6 ++-
> hw/net/vmxnet3.c | 18 +++++---
> hw/nvram/eeprom93xx.c | 6 ++-
> hw/nvram/fw_cfg.c | 6 ++-
> hw/pci/msix.c | 6 ++-
> hw/pci/pci.c | 12 +++--
> hw/pci/shpc.c | 5 ++-
> hw/scsi/scsi-bus.c | 6 ++-
> hw/timer/twl92230.c | 6 ++-
> hw/usb/redirect.c | 18 +++++---
> hw/virtio/virtio-pci.c | 6 ++-
> hw/virtio/virtio.c | 12 +++--
> include/migration/vmstate.h | 15 +++++--
> migration/savevm.c | 5 ++-
> migration/vmstate.c | 104
> ++++++++++++++++++++++++++++----------------
> target-alpha/machine.c | 5 ++-
> target-arm/machine.c | 12 +++--
> target-i386/machine.c | 21 ++++++---
> target-mips/machine.c | 10 +++--
> target-ppc/machine.c | 10 +++--
> target-sparc/machine.c | 5 ++-
> 21 files changed, 192 insertions(+), 102 deletions(-)
<snip>
> -static int get_int32_as_uint16(QEMUFile *f, void *pv, size_t size)
> +static int get_int32_as_uint16(QEMUFile *f, void *pv, size_t size,
> + VMStateField *field)
> {
> int *v = pv;
> *v = qemu_get_be16(f);
> return 0;
> }
>
> -static void put_int32_as_uint16(QEMUFile *f, void *pv, size_t size)
> +static void put_int32_as_uint16(QEMUFile *f, void *pv, size_t size,
> + VMStateField *field, QJSON *vmdesc)
> {
> int *v = pv;
> qemu_put_be16(f, *v);
> diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
> index d4ca026..1b85c51 100644
> --- a/hw/usb/redirect.c
> +++ b/hw/usb/redirect.c
> @@ -2158,7 +2158,8 @@ static int usbredir_post_load(void *priv, int
> version_id)
> }
>
> /* For usbredirparser migration */
> -static void usbredir_put_parser(QEMUFile *f, void *priv, size_t unused)
> +static void usbredir_put_parser(QEMUFile *f, void *priv, size_t unused,
> + void *opaque, QJSON *vmdesc)
> {
> USBRedirDevice *dev = priv;
> uint8_t *data;
> @@ -2178,7 +2179,8 @@ static void usbredir_put_parser(QEMUFile *f, void
> *priv, size_t unused)
> free(data);
> }
>
> -static int usbredir_get_parser(QEMUFile *f, void *priv, size_t unused)
> +static int usbredir_get_parser(QEMUFile *f, void *priv, size_t unused,
> + void *opaque)
The types here are wrong for usbredir_put_parser and usbredir_get_parser; the
'void *opaque'
should be a VMStateField *field; it causes a build failure for me (I suspect
only
if you have the usbredir libraries)
Also, are you missing kvm_flic_load/save from hw/intc/s390_flic_kvm.c ?
Other than that, it looks good.
Dave
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK