From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33018 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PE4D2-0002DN-FY for qemu-devel@nongnu.org; Thu, 04 Nov 2010 14:06:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PE4D0-00048s-Qz for qemu-devel@nongnu.org; Thu, 04 Nov 2010 14:06:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PE4D0-00048l-J2 for qemu-devel@nongnu.org; Thu, 04 Nov 2010 14:06:46 -0400 Date: Thu, 4 Nov 2010 20:06:37 +0200 From: "Michael S. Tsirkin" Message-ID: <5f91d600c749e66de107f60298c5ebd36645beff.1288892774.git.mst@redhat.com> References: <20101104180406.GA2820@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101104180406.GA2820@redhat.com> Subject: [Qemu-devel] [PATCHv2 2/2] tap: mark fd handler as device List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Anthony Liguori 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 --- 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