Received: from eggs.gnu.org ([140.186.70.92]:55847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlhJ5-00018N-Nb for qemu-devel@nongnu.org; Tue, 26 Jul 2011 09:04:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlhJ4-0003Td-RL for qemu-devel@nongnu.org; Tue, 26 Jul 2011 09:04:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlhJ4-0003TR-Jr for qemu-devel@nongnu.org; Tue, 26 Jul 2011 09:04:18 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6QD4Htp013555 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Jul 2011 09:04:17 -0400 From: Alon Levy Date: Tue, 26 Jul 2011 16:03:54 +0300 Message-Id: <1311685434-25282-1-git-send-email-alevy@redhat.com> Subject: [Qemu-devel] [PATCH] virtio-serial-bus: replay guest_open on migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, hdegoede@redhat.com, yhalperi@redhat.com, armbru@redhat.com, quintela@redhat.com Signed-off-by: Alon Levy --- 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 c5eb931..7a652ff 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) { /* -- 1.7.6