virtio-serial: don't migrate the config space
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 <agraf@suse.de> [ added missing casts to uint16_t *, added From, SoB and commit message, Greg Kurz <gkurz@linux.vnet.ibm.com> ] Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
032a74a1c0
commit
e38e943a1f
|
@ -663,6 +663,7 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id)
|
||||||
uint32_t max_nr_ports, nr_active_ports, ports_map;
|
uint32_t max_nr_ports, nr_active_ports, ports_map;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int ret;
|
int ret;
|
||||||
|
uint32_t tmp;
|
||||||
|
|
||||||
if (version_id > 3) {
|
if (version_id > 3) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -678,17 +679,12 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The config space */
|
/* Unused */
|
||||||
qemu_get_be16s(f, &s->config.cols);
|
qemu_get_be16s(f, (uint16_t *) &tmp);
|
||||||
qemu_get_be16s(f, &s->config.rows);
|
qemu_get_be16s(f, (uint16_t *) &tmp);
|
||||||
|
qemu_get_be32s(f, &tmp);
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
max_nr_ports = tswap32(s->config.max_nr_ports);
|
||||||
for (i = 0; i < (max_nr_ports + 31) / 32; i++) {
|
for (i = 0; i < (max_nr_ports + 31) / 32; i++) {
|
||||||
qemu_get_be32s(f, &ports_map);
|
qemu_get_be32s(f, &ports_map);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue