qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Yan Vugenfirer <yvugenfi@redhat.com>
Cc: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] VirtIO: Fix QEMU crash during Windows PNP tests
Date: Mon, 1 Mar 2010 12:14:43 +0100	[thread overview]
Message-ID: <BAEAF048-3CD5-4F5E-B938-DBB751F35318@suse.de> (raw)
In-Reply-To: <1252935086-8856-1-git-send-email-yvugenfi@redhat.com>


On 14.09.2009, at 15:31, Yan Vugenfirer wrote:

> Signed-off-by: Yan Vugenfirer <yvugenfi@redhat.com>
> 
> ---
> hw/virtio-pci.c |   14 ++++++++++++--
> 1 files changed, 12 insertions(+), 2 deletions(-)
> 
> 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 = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
> +
> +    if (PCI_COMMAND == address) {
> +        if (!(val & PCI_COMMAND_MASTER)) {
> +            proxy->vdev->status &= ~VIRTIO_CONFIG_S_DRIVER_OK;

This part breaks PCI hotplug with Linux guests.

What happens is the following:

(qemu) pci_add auto nic model=virtio,vlan=0
  - 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=/tmp/image.raw,if=virtio
  - Virtio dev 1 -> write config (0x3)
  -> Unset DRIVER_OK bit
  -> network device becomes unresponsive 
  - 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

  reply	other threads:[~2010-03-01 11:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14 13:31 [Qemu-devel] [PATCH] VirtIO: Fix QEMU crash during Windows PNP tests Yan Vugenfirer
2010-03-01 11:14 ` Alexander Graf [this message]
2010-03-01 11:26   ` Gleb Natapov
2010-03-02 10:09     ` Michael S. Tsirkin
2010-03-02 11:03       ` Alexander Graf
2010-03-02 11:05         ` Michael S. Tsirkin
2010-03-02 11:43           ` Alexander Graf
  -- strict thread matches above, loose matches on Subject: below --
2009-09-08 14:49 Yan Vugenfirer
2009-09-11 13:36 ` Anthony Liguori
2009-09-13 11:47   ` Yan Vugenfirer
2009-09-14 12:50     ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAEAF048-3CD5-4F5E-B938-DBB751F35318@suse.de \
    --to=agraf@suse.de \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yvugenfi@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).