diff options
author | Alon Levy <alevy@redhat.com> | 2011-07-26 11:49:36 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2011-07-26 11:49:36 +0300 |
commit | c8594da2dbc10e4d18b06d2e05090af4dfabb6a4 (patch) | |
tree | 571ae75aef7a774b5ce1735fedf03c4af33ed1ea | |
parent | 0f94d6da357954857f95d5be69817d8551a5526f (diff) |
virtio-serial-bus: replay guest_open on migrationpull-libcacard.afe
Signed-off-by: Alon Levy <alevy@redhat.com>
-rw-r--r-- | hw/virtio-serial-bus.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 6d7338644..45a8a6786 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -618,14 +618,20 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id) for (i = 0; i < nr_active_ports; i++) { uint32_t id; bool host_connected; + VirtIOSerialPortInfo *info; id = qemu_get_be32(f); port = find_port_by_id(s, id); if (!port) { return -EINVAL; } - port->guest_connected = qemu_get_byte(f); + info = DO_UPCAST(VirtIOSerialPortInfo, qdev, port->dev.info); + if (port->guest_connected && info->guest_open) { + /* replay guest open */ + info->guest_open(port); + + } host_connected = qemu_get_byte(f); if (host_connected != port->host_connected) { /* |