Received: from eggs.gnu.org ([2001:4830:134:3::10]:47429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biev9-0005Cx-4E for qemu-devel@nongnu.org; Sat, 10 Sep 2016 05:50:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biev8-0005t7-4t for qemu-devel@nongnu.org; Sat, 10 Sep 2016 05:49:59 -0400 Sender: Paolo Bonzini References: <1473495817-29952-1-git-send-email-maxime.coquelin@redhat.com> From: Paolo Bonzini Message-ID: <462c857b-d4b8-b3f5-52f3-70180f2b0782@redhat.com> Date: Sat, 10 Sep 2016 11:49:46 +0200 MIME-Version: 1.0 In-Reply-To: <1473495817-29952-1-git-send-email-maxime.coquelin@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-bus: Plug devices after features are negotiated List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Maxime Coquelin , mst@redhat.com, qemu-devel@nongnu.org, cornelia.huck@de.ibm.com Cc: marcel@redhat.com, vkaplans@redhat.com, qemu-stable@nongnu.org On 10/09/2016 10:23, Maxime Coquelin wrote: > Currently, devices are plugged before features are negotiated. > If the backend doesn't support VIRTIO_F_VERSION_1, the transport > need to rewind some settings. > > This is the case for CCW, for which a post_plugged callback had > been introduced, where max_rev field is just updated if > VIRTIO_F_VERSION_1 is not supported by the backend. > For PCI, implementing the post_plugged would be much more > complicated, so it needs to know whether the backend supports > VIRTIO_F_VERSION_1 at plug time. > > Currently, nothing is done for PCI. Modern capabilitities get > exposed to the guest even if VIRTIO_F_VERSION_1 is not supported > by the backend, which confuses the guest. > > This patch proposes to replace existing post_plugged solution > with an approach that fits with both transports. > Features negociation is performed before ->device_plugged() call. > A pre_plugged callback is introduced so that the transports can > set their supported features. Have you tested virtio-mmio too? Paolo