Skip to content
Commit f2f6e00b authored by David Gibson's avatar David Gibson Committed by Amit Shah
Browse files

virtio_serial: Don't use vser->config.max_nr_ports internally



A number of places in the virtio_serial driver retrieve the number of ports
from vser->config.max_nr_ports, which is guest-endian.  But for internal
users, we already have a host-endian copy of the number of ports in
vser->serial.max_virtserial_ports.  Using that instead of the config field
removes the need for easy-to-forget byteswapping.

In particular this fixes a bug on incoming migration, where we don't adjust
the endianness vser->config correctly, because it hasn't yet been loaded
from the migration stream when virtio_serial_load_device() is called.

Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
Signed-off-by: default avatarAmit Shah <amit.shah@redhat.com>
parent ab0302ee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment