From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkbK3-0006II-IM for qemu-devel@nongnu.org; Wed, 14 May 2014 11:42:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkbJu-00073h-AC for qemu-devel@nongnu.org; Wed, 14 May 2014 11:42:23 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:55245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkbJu-00073T-2b for qemu-devel@nongnu.org; Wed, 14 May 2014 11:42:14 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 May 2014 16:42:13 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id D301017D8042 for ; Wed, 14 May 2014 16:43:19 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4EFgA8L065904 for ; Wed, 14 May 2014 15:42:10 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4EFgAil001086 for ; Wed, 14 May 2014 09:42:10 -0600 From: Greg Kurz Date: Wed, 14 May 2014 17:42:08 +0200 Message-ID: <20140514154207.10746.61815.stgit@bahia.local> In-Reply-To: <20140514154130.10746.1412.stgit@bahia.local> References: <20140514154130.10746.1412.stgit@bahia.local> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH RFC 5/8] virtio-serial: migrate subsections List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , Anthony Liguori , "Michael S. Tsirkin" , Stefan Hajnoczi , Amit Shah , Paolo Bonzini Cc: Juan Quintela , Fam Zheng , Alexander Graf , Andreas =?utf-8?q?F=C3=A4rber?= , qemu-devel@nongnu.org Signed-off-by: Greg Kurz --- hw/char/virtio-serial-bus.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index 2b647b6..98f32fd 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -522,12 +522,13 @@ static void vser_reset(VirtIODevice *vdev) static void virtio_serial_save(QEMUFile *f, void *opaque) { VirtIOSerial *s = VIRTIO_SERIAL(opaque); + VirtIODevice *vdev = VIRTIO_DEVICE(s); VirtIOSerialPort *port; uint32_t nr_active_ports; unsigned int i, max_nr_ports; /* The virtio device */ - virtio_save(VIRTIO_DEVICE(s), f); + virtio_save(vdev, f); /* The config space */ qemu_put_be16s(f, &s->config.cols); @@ -573,6 +574,8 @@ static void virtio_serial_save(QEMUFile *f, void *opaque) sizeof(port->elem)); } } + + virtio_save_subsections(vdev, f); } static void virtio_serial_post_load_timer_cb(void *opaque) @@ -667,6 +670,7 @@ static int fetch_active_ports_list(QEMUFile *f, int version_id, static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id) { VirtIOSerial *s = VIRTIO_SERIAL(opaque); + VirtIODevice *vdev = VIRTIO_DEVICE(s); uint32_t max_nr_ports, nr_active_ports, ports_map; unsigned int i; int ret; @@ -676,7 +680,7 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id) } /* The virtio device */ - ret = virtio_load(VIRTIO_DEVICE(s), f); + ret = virtio_load(vdev, f); if (ret) { return ret; } @@ -716,7 +720,7 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id) return ret; } } - return 0; + return virtio_load_subsections(vdev, f); } static void virtser_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent);