Received: from eggs.gnu.org ([2001:4830:134:3::10]:56938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biJcG-00082P-2K for qemu-devel@nongnu.org; Fri, 09 Sep 2016 07:05:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biJcA-0007OS-SB for qemu-devel@nongnu.org; Fri, 09 Sep 2016 07:05:03 -0400 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> From: Marcel Apfelbaum Message-ID: Date: Fri, 9 Sep 2016 14:04:55 +0300 MIME-Version: 1.0 In-Reply-To: <20160909124038.10fb8181.cornelia.huck@de.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: Cornelia Huck , Maxime Coquelin Cc: mst@redhat.com, qemu-devel@nongnu.org, vkaplans@redhat.com, qemu-stable@nongnu.org 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. Thanks, Marcel > > Two comments: > - ->post_plugged() handles the dependencies (as noticed for your first > patch) - and this is due to it being called after the plugging is > already done. > - I don't really like pci and ccw being too different. We have probably > more flexibility with the handling for ccw, so I could probably convert > ccw to the same mechanism that pci uses. Maybe there are other uses for > ->post_plugged()? >