From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSirq-0002My-Um for qemu-devel@nongnu.org; Fri, 21 Aug 2015 05:44:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZSirn-0001ZI-MQ for qemu-devel@nongnu.org; Fri, 21 Aug 2015 05:44:10 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:47800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSirn-0001Z6-CW for qemu-devel@nongnu.org; Fri, 21 Aug 2015 05:44:07 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Aug 2015 10:44:04 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 756FF1B08070 for ; Fri, 21 Aug 2015 10:45:31 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t7L9i1RF35127538 for ; Fri, 21 Aug 2015 09:44:01 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t7L9i1HE024096 for ; Fri, 21 Aug 2015 03:44:01 -0600 Date: Fri, 21 Aug 2015 11:43:59 +0200 From: Cornelia Huck Message-ID: <20150821114359.7008df9c.cornelia.huck@de.ibm.com> In-Reply-To: <1440147950-1178-4-git-send-email-jasowang@redhat.com> References: <1440147950-1178-1-git-send-email-jasowang@redhat.com> <1440147950-1178-4-git-send-email-jasowang@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/6] virtio-pci: fix 1.0 virtqueue migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: qemu-devel@nongnu.org, mst@redhat.com On Fri, 21 Aug 2015 17:05:47 +0800 Jason Wang wrote: > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > index 788b556..c971ba2 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -1056,6 +1056,17 @@ static bool virtio_virtqueue_needed(void *opaque) > return virtio_host_has_feature(vdev, VIRTIO_F_VERSION_1); > } > > +static bool virtio_modern_state_needed(void *opaque) > +{ > + VirtIODevice *vdev = opaque; > + BusState *qbus = qdev_get_parent_bus(DEVICE(vdev)); > + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); > + > + return virtio_virtqueue_needed(opaque) && Why does core want to check that? Shouldn't that be done by the class instead (but see below)? > + k->has_modern_state && > + k->has_modern_state(qbus->parent); > +} I don't really like this "modern_state" stuff (which is pci specific) creeping into core. How about introducing "extra_state" and/or "extra_queue_state" (or something like that) instead?