Received: from eggs.gnu.org ([2001:4830:134:3::10]:42286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biKJA-000103-90 for qemu-devel@nongnu.org; Fri, 09 Sep 2016 07:49:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biKJ6-0004yx-3E for qemu-devel@nongnu.org; Fri, 09 Sep 2016 07:49:23 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54911 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biKJ5-0004yj-To for qemu-devel@nongnu.org; Fri, 09 Sep 2016 07:49:20 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u89BmpYt108620 for ; Fri, 9 Sep 2016 07:49:19 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 25bc2qyewn-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 09 Sep 2016 07:49:19 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Sep 2016 12:49:17 +0100 Date: Fri, 9 Sep 2016 13:49:13 +0200 From: Cornelia Huck In-Reply-To: <3368b8a8-b996-d38d-fd82-44e17b9402cf@redhat.com> References: <1473416072-7063-1-git-send-email-maxime.coquelin@redhat.com> <1473416072-7063-3-git-send-email-maxime.coquelin@redhat.com> <20160909124038.10fb8181.cornelia.huck@de.ibm.com> <20160909132056.736715d2.cornelia.huck@de.ibm.com> <3368b8a8-b996-d38d-fd82-44e17b9402cf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160909134913.2d9f1f04.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-pci: Disable modern interface if backend without VIRTIO_F_VERSION_1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Maxime Coquelin Cc: Marcel Apfelbaum , mst@redhat.com, qemu-devel@nongnu.org, vkaplans@redhat.com, qemu-stable@nongnu.org On Fri, 9 Sep 2016 13:44:35 +0200 Maxime Coquelin wrote: > On 09/09/2016 01:20 PM, Cornelia Huck wrote: > > On Fri, 9 Sep 2016 14:04:55 +0300 > > Marcel Apfelbaum wrote: > > > >> On 09/09/2016 01:40 PM, Cornelia Huck wrote: > >>> On Fri, 9 Sep 2016 12:14:32 +0200 > >>> Maxime Coquelin wrote: > >>> > >>>> This patch makes pci devices plugging more robust, by not confusing > >>>> guest with modern interface when the backend doesn't support > >>>> VIRTIO_F_VERSION_1. > >>>> > >>>> Cc: Marcel Apfelbaum > >>>> Cc: Michael S. Tsirkin > >>>> Cc: qemu-stable@nongnu.org > >>>> Signed-off-by: Maxime Coquelin > >>>> --- > >>>> hw/virtio/virtio-pci.c | 15 +++++++++++++++ > >>>> hw/virtio/virtio-pci.h | 5 +++++ > >>>> 2 files changed, 20 insertions(+) > >>> > >>> Note that 11380b361 ("virtio: handle non-virtio-1-capable backend for > >>> ccw") fixes this issue for ccw via the introduction of a > >>> ->post_plugged() callback. Unfortunately, we did not find a good way to > >>> make it work for pci back then. > >> > >> It seems that for ccw is enough to rewind dev->rev_max, > >> sadly for pci we need to rewind a lot of settings/resources. > > > > Yes, that what I meant with 'more flexibility for ccw'. > Maybe we could replace post_plugged with a pre_plugged approach? > > In ->pre_plugged(), cww and pci would specify which features it can > support using virtio_add_feature(). > Then we could call get_features() before ->device_plugged(). I think that would work for ccw (haven't looked at pci). > > Doing this, both ccw and pci would have the needed information without > having to rewind any settings. > > Does that make sense? > > But for now, I think it would be better to merge something in the spirit > of this series (taking into account to remarks). > Indeed, I think we want this fixed in stable, but the above proposal > would be too huge for stable. A 'just check for VERSION_1' approach would probably be best for stable.