qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark McLoughlin <markmc@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Rusty@blaa.localdomain, Mark McLoughlin <markmc@redhat.com>,
	qemu-devel@nongnu.org, "Russell <rusty"@rustcorp.com.au
Subject: [Qemu-devel] [PATCH] Don't notify virtio devices before S_DRIVER_OK
Date: Thu, 29 Jan 2009 15:33:50 +0000	[thread overview]
Message-ID: <1233243230-8280-1-git-send-email-markmc@redhat.com> (raw)

Current Linux guests oops if the host notifies of a
config change before a driver has been bound to the
device.

It's pretty pointless for us to do notify of config
changes before status is S_DRIVER_OK anyway, so let's
just not do it.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
 qemu/hw/virtio.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/qemu/hw/virtio.c b/qemu/hw/virtio.c
index 35f4669..78bcc2e 100644
--- a/qemu/hw/virtio.c
+++ b/qemu/hw/virtio.c
@@ -738,6 +738,9 @@ void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
 
 void virtio_notify_config(VirtIODevice *vdev)
 {
+    if (!(vdev->status & VIRTIO_CONFIG_S_DRIVER_OK))
+        return;
+
     vdev->isr |= 0x03;
     virtio_update_irq(vdev);
 }
-- 
1.6.0.6

             reply	other threads:[~2009-01-29 15:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-29 15:33 Mark McLoughlin [this message]
2009-01-29 17:03 ` [Qemu-devel] Re: [PATCH] Don't notify virtio devices before S_DRIVER_OK Anthony Liguori
2009-01-29 17:25   ` Mark McLoughlin

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=1233243230-8280-1-git-send-email-markmc@redhat.com \
    --to=markmc@redhat.com \
    --cc="Russell <rusty"@rustcorp.com.au \
    --cc=Rusty@blaa.localdomain \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /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).