[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 01/20] virtio-serial: don't migrate the confi
From: |
Michael S. Tsirkin |
Subject: |
Re: [Qemu-devel] [PATCH v8 01/20] virtio-serial: don't migrate the config space |
Date: |
Thu, 19 Jun 2014 14:32:53 +0300 |
On Fri, Jun 13, 2014 at 01:18:42PM +0200, Greg Kurz wrote:
> The device configuration is set at realize time and never changes. It
> should not be migrated as it is done today. For the sake of compatibility,
> let's just skip them at load time.
>
> Signed-off-by: Alexander Graf <address@hidden>
> [ added missing casts to uint16_t *,
> added SoB and commit message,
> Greg Kurz <address@hidden> ]
> Signed-off-by: Greg Kurz <address@hidden>
This one is definitely a good thing to have, regardless.
Reviewed-by: Michael S. Tsirkin <address@hidden>
> ---
> hw/char/virtio-serial-bus.c | 16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
> index 2b647b6..ee1ba16 100644
> --- a/hw/char/virtio-serial-bus.c
> +++ b/hw/char/virtio-serial-bus.c
> @@ -670,6 +670,7 @@ static int virtio_serial_load(QEMUFile *f, void *opaque,
> int version_id)
> uint32_t max_nr_ports, nr_active_ports, ports_map;
> unsigned int i;
> int ret;
> + uint32_t tmp;
>
> if (version_id > 3) {
> return -EINVAL;
> @@ -685,17 +686,12 @@ static int virtio_serial_load(QEMUFile *f, void
> *opaque, int version_id)
> return 0;
> }
>
> - /* The config space */
> - qemu_get_be16s(f, &s->config.cols);
> - qemu_get_be16s(f, &s->config.rows);
> -
> - qemu_get_be32s(f, &max_nr_ports);
> - tswap32s(&max_nr_ports);
> - if (max_nr_ports > tswap32(s->config.max_nr_ports)) {
> - /* Source could have had more ports than us. Fail migration. */
> - return -EINVAL;
> - }
> + /* Unused */
> + qemu_get_be16s(f, (uint16_t *) &tmp);
> + qemu_get_be16s(f, (uint16_t *) &tmp);
> + qemu_get_be32s(f, &tmp);
>
> + max_nr_ports = tswap32(s->config.max_nr_ports);
> for (i = 0; i < (max_nr_ports + 31) / 32; i++) {
> qemu_get_be32s(f, &ports_map);
>
- [Qemu-devel] [PATCH v8 00/20] virtio endian-ambivalent target, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 01/20] virtio-serial: don't migrate the config space, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 02/20] virtio: introduce device specific migration calls, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 03/20] virtio-net: implement per-device migration calls, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 04/20] virtio-blk: implement per-device migration calls, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 05/20] virtio-serial: implement per-device migration calls, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 06/20] virtio-balloon: implement per-device migration calls, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 07/20] virtio-rng: implement per-device migration calls, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 08/20] virtio: add subsections to the migration stream, Greg Kurz, 2014/06/13
- [Qemu-devel] [PATCH v8 09/20] exec: introduce target_words_bigendian() helper, Greg Kurz, 2014/06/13