From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkbKJ-0006iv-D9 for qemu-devel@nongnu.org; Wed, 14 May 2014 11:42:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkbKA-00077X-3h for qemu-devel@nongnu.org; Wed, 14 May 2014 11:42:39 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:55911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkbK9-00077D-Q8 for qemu-devel@nongnu.org; Wed, 14 May 2014 11:42:30 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 May 2014 16:42:28 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id A035A17D8047 for ; Wed, 14 May 2014 16:43:35 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s4EFgQYU13828248 for ; Wed, 14 May 2014 15:42:26 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s4EFgPXV031327 for ; Wed, 14 May 2014 09:42:26 -0600 From: Greg Kurz Date: Wed, 14 May 2014 17:42:23 +0200 Message-ID: <20140514154222.10746.85230.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 7/8] virtio-rng: 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 While we are here, we also check virtio_load() return value. Signed-off-by: Greg Kurz --- hw/virtio/virtio-rng.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index b6ab361..0371103 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -103,17 +103,28 @@ static void virtio_rng_save(QEMUFile *f, void *opaque) VirtIODevice *vdev = opaque; virtio_save(vdev, f); + virtio_save_subsections(vdev, f); } static int virtio_rng_load(QEMUFile *f, void *opaque, int version_id) { VirtIORNG *vrng = opaque; VirtIODevice *vdev = VIRTIO_DEVICE(vrng); + int ret; if (version_id != 1) { return -EINVAL; } - virtio_load(vdev, f); + + ret = virtio_load(vdev, f); + if (ret) { + return ret; + } + + ret = virtio_load_subsections(vdev, f); + if (ret) { + return ret; + } /* We may have an element ready but couldn't process it due to a quota * limit. Make sure to try again after live migration when the quota may