qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCHv3 2/2] vhost: disable on tap link down


From: Michael S. Tsirkin
Subject: [Qemu-devel] [PATCHv3 2/2] vhost: disable on tap link down
Date: Wed, 9 Feb 2011 18:45:09 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

qemu makes it possible to disable link at tap
which is not communicated to the guest but
causes all packets to be dropped.

When vhost-net is enabled, vhost needs to be aware of both the virtio
link_down and the peer link_down. we switch to userspace emulation when
either is down.

Signed-off-by: Michael S. Tsirkin <address@hidden>
Reported-by: pradeep <address@hidden>
---
 hw/virtio-net.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 671d952..20cf680 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -115,7 +115,8 @@ static void virtio_net_vhost_status(VirtIONet *n, uint8_t 
status)
     if (!tap_get_vhost_net(n->nic->nc.peer)) {
         return;
     }
-    if (!!n->vhost_started == virtio_net_started(n, status)) {
+    if (!!n->vhost_started == virtio_net_started(n, status) &&
+                              !n->nic->nc.peer->link_down) {
         return;
     }
     if (!n->vhost_started) {
-- 
1.7.3.2.91.g446ac



reply via email to

[Prev in Thread] Current Thread [Next in Thread]