From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bca7O-0003ny-29 for qemu-devel@nongnu.org; Wed, 24 Aug 2016 11:29:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bca7H-0005l2-V8 for qemu-devel@nongnu.org; Wed, 24 Aug 2016 11:29:29 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bca7H-0005kl-My for qemu-devel@nongnu.org; Wed, 24 Aug 2016 11:29:23 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7OFStvu091408 for ; Wed, 24 Aug 2016 11:29:21 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 250qb4f0sw-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 24 Aug 2016 11:29:19 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 Aug 2016 16:29:17 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id E049F1B0804B for ; Wed, 24 Aug 2016 16:30:53 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7OFTEwO24707390 for ; Wed, 24 Aug 2016 15:29:14 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u7OFTDdW020859 for ; Wed, 24 Aug 2016 09:29:13 -0600 Date: Wed, 24 Aug 2016 17:29:11 +0200 From: Cornelia Huck In-Reply-To: <1472046153-22123-5-git-send-email-dgilbert@redhat.com> References: <1472046153-22123-1-git-send-email-dgilbert@redhat.com> <1472046153-22123-5-git-send-email-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160824172911.4bf037c8.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [RFC 4/6] virtio/migration: Add VMStateDescription to VirtioDeviceClass List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: qemu-devel@nongnu.org, mst@redhat.com, amit.shah@redhat.com, quintela@redhat.com, duanj@linux.vnet.ibm.com On Wed, 24 Aug 2016 14:42:31 +0100 "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > Provide a vmsd pointer for VirtIO devices to use instead of the > load/save methods. > > We'll eventually kill off the load/save methods. > > Signed-off-by: Dr. David Alan Gilbert > --- > hw/virtio/virtio.c | 11 +++++++++++ > include/hw/virtio/virtio.h | 2 ++ > 2 files changed, 13 insertions(+) > > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h > index d2490c1..fd386ac 100644 > --- a/include/hw/virtio/virtio.h > +++ b/include/hw/virtio/virtio.h > @@ -124,8 +124,10 @@ typedef struct VirtioDeviceClass { > * must mask in frontend instead. > */ > void (*guest_notifier_mask)(VirtIODevice *vdev, int n, bool mask); > + /* Saving and loading of a device; use *either* save/load OR vmsd */ Should we try to enforce this in some way? Then virtio_{save,load} can call either/or instead of fallthrough which may have unintended consequences... > void (*save)(VirtIODevice *vdev, QEMUFile *f); > int (*load)(VirtIODevice *vdev, QEMUFile *f, int version_id); > + const VMStateDescription *vmsd; > } VirtioDeviceClass; > > void virtio_instance_init_common(Object *proxy_obj, void *data,