Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nm3aO-0006Br-No for qemu-devel@nongnu.org; Mon, 01 Mar 2010 06:14:52 -0500 Received: from [199.232.76.173] (port=47895 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nm3aN-0006At-Rp for qemu-devel@nongnu.org; Mon, 01 Mar 2010 06:14:52 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nm3aM-00082z-6V for qemu-devel@nongnu.org; Mon, 01 Mar 2010 06:14:51 -0500 Received: from cantor.suse.de ([195.135.220.2]:52402 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nm3aL-00082v-RC for qemu-devel@nongnu.org; Mon, 01 Mar 2010 06:14:50 -0500 Subject: Re: [Qemu-devel] [PATCH] VirtIO: Fix QEMU crash during Windows PNP tests Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <1252935086-8856-1-git-send-email-yvugenfi@redhat.com> Date: Mon, 1 Mar 2010 12:14:43 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1252935086-8856-1-git-send-email-yvugenfi@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yan Vugenfirer Cc: "qemu-devel@nongnu.org Developers" , "Michael S. Tsirkin" On 14.09.2009, at 15:31, Yan Vugenfirer wrote: > Signed-off-by: Yan Vugenfirer >=20 > --- > hw/virtio-pci.c | 14 ++++++++++++-- > 1 files changed, 12 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c > index f812ab7..a0a22c4 100644 > --- a/hw/virtio-pci.c > +++ b/hw/virtio-pci.c > @@ -364,8 +364,17 @@ static void virtio_map(PCIDevice *pci_dev, int = region_num, > static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, > uint32_t val, int len) > { > + VirtIOPCIProxy *proxy =3D DO_UPCAST(VirtIOPCIProxy, pci_dev, = pci_dev); > + > + if (PCI_COMMAND =3D=3D address) { > + if (!(val & PCI_COMMAND_MASTER)) { > + proxy->vdev->status &=3D ~VIRTIO_CONFIG_S_DRIVER_OK; This part breaks PCI hotplug with Linux guests. What happens is the following: (qemu) pci_add auto nic model=3Dvirtio,vlan=3D0 - Virtio dev 1 -> write config (0) - Virtio dev 1 -> write config (0x3) - Virtio dev 1 -> set status explicitly to OK (qemu) pci_add auto storage file=3D/tmp/image.raw,if=3Dvirtio - Virtio dev 1 -> write config (0x3) -> Unset DRIVER_OK bit -> network device becomes unresponsive=20 - Virtio dev 2 -> write config (0) - Virtio dev 2 -> write config (0x3) - Virtio dev 2 -> set status explicitly to OK Please either revert this patch or provide a proper fix. Alex=