qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: [Qemu-devel] [PATCHv2 2/2] tap: mark fd handler as device
Date: Thu, 4 Nov 2010 20:06:37 +0200	[thread overview]
Message-ID: <5f91d600c749e66de107f60298c5ebd36645beff.1288892774.git.mst@redhat.com> (raw)
In-Reply-To: <20101104180406.GA2820@redhat.com>

There's no reason for tap to run when VM is stopped.
If we let it, it confuses the bridge on TX
and corrupts DMA memory on RX.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/vhost_net.c |    2 +-
 net/tap.c      |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/vhost_net.c b/hw/vhost_net.c
index c068be1..7061d6c 100644
--- a/hw/vhost_net.c
+++ b/hw/vhost_net.c
@@ -139,7 +139,7 @@ int vhost_net_start(struct vhost_net *net,
     }
 
     net->vc->info->poll(net->vc, false);
-    qemu_set_fd_handler(net->backend, NULL, NULL, NULL);
+    qemu_set_fd_handler3(true, net->backend, NULL, NULL, NULL, NULL);
     file.fd = net->backend;
     for (file.index = 0; file.index < net->dev.nvqs; ++file.index) {
         r = ioctl(net->dev.control, VHOST_NET_SET_BACKEND, &file);
diff --git a/net/tap.c b/net/tap.c
index 4afb314..246ef01 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -71,7 +71,8 @@ static void tap_writable(void *opaque);
 
 static void tap_update_fd_handler(TAPState *s)
 {
-    qemu_set_fd_handler2(s->fd,
+    qemu_set_fd_handler3(true,
+                         s->fd,
                          s->read_poll  ? tap_can_send : NULL,
                          s->read_poll  ? tap_send     : NULL,
                          s->write_poll ? tap_writable : NULL,
-- 
1.7.3.2.91.g446ac

  parent reply	other threads:[~2010-11-04 18:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04 18:04 [Qemu-devel] [PATCHv2 0/2] migration: stop dma while VM is stopped Michael S. Tsirkin
2010-11-04 18:06 ` [Qemu-devel] [PATCHv2 1/2] char: separate device and system fd handlers Michael S. Tsirkin
2010-11-16 10:24   ` [Qemu-devel] " Juan Quintela
2010-11-04 18:06 ` Michael S. Tsirkin [this message]
2010-11-15 14:52   ` [Qemu-devel] Re: [PATCHv2 2/2] tap: mark fd handler as device Juan Quintela
2010-11-15 14:55     ` Anthony Liguori
2010-11-15 15:18       ` Michael S. Tsirkin
2010-11-15 16:09         ` Anthony Liguori
2010-11-15 20:26           ` Michael S. Tsirkin
2010-11-15 20:37             ` Anthony Liguori
2010-11-15 20:53           ` Stefan Hajnoczi
2010-11-15 21:05             ` Anthony Liguori
2010-11-15 22:44               ` Michael S. Tsirkin
2010-11-15 23:46                 ` Anthony Liguori
2010-11-15 15:21     ` Michael S. Tsirkin

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=5f91d600c749e66de107f60298c5ebd36645beff.1288892774.git.mst@redhat.com \
    --to=mst@redhat.com \
    --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).