From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjQLc-0008UY-IS for qemu-devel@nongnu.org; Mon, 12 Sep 2016 08:28:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjQLY-0008JX-3n for qemu-devel@nongnu.org; Mon, 12 Sep 2016 08:28:28 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjQLX-0008IH-R0 for qemu-devel@nongnu.org; Mon, 12 Sep 2016 08:28:24 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8CCRcn5091744 for ; Mon, 12 Sep 2016 08:28:22 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 25cb2hse90-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 12 Sep 2016 08:28:22 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Sep 2016 13:28:20 +0100 Date: Mon, 12 Sep 2016 14:28:15 +0200 From: Cornelia Huck In-Reply-To: <1473426607-10516-2-git-send-email-maxime.coquelin@redhat.com> References: <1473426607-10516-1-git-send-email-maxime.coquelin@redhat.com> <1473426607-10516-2-git-send-email-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160912142815.7bf7cc5c.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH v2 1/2] virtio: Add function to check whether backend supports VIRTIO_1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Maxime Coquelin Cc: mst@redhat.com, qemu-devel@nongnu.org, marcel@redhat.com, vkaplans@redhat.com, qemu-stable@nongnu.org On Fri, 9 Sep 2016 15:10:06 +0200 Maxime Coquelin wrote: > This patch adds virtio_test_backend_virtio_1() function to > check whether backend supports VIRTIO_F_VERSION_1 before the > negociation takes place. s/negociation/negotiation/ > > Cc: Cornelia Huck > Cc: Marcel Apfelbaum > Cc: Michael S. Tsirkin > Cc: qemu-stable@nongnu.org > Signed-off-by: Maxime Coquelin > --- > hw/virtio/virtio.c | 13 +++++++++++++ > include/hw/virtio/virtio.h | 1 + > 2 files changed, 14 insertions(+) > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > index 74c085c..8b30b69 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -1481,6 +1481,19 @@ void virtio_vmstate_save(QEMUFile *f, void *opaque, size_t size) > virtio_save(VIRTIO_DEVICE(opaque), f); > } > > +bool virtio_test_backend_virtio_1(VirtIODevice *vdev, Error **errp) > +{ > + VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); > + uint64_t feature; As others had requested, I'd prefer setting this to 0 as well. With that changed: Reviewed-by: Cornelia Huck