Patchwork [3/3] virtio-net: set referred object for virtio net's bh

login
register
mail settings
Submitter pingfan liu
Date June 25, 2013, 5:38 p.m.
Message ID <1372181916-4676-4-git-send-email-pingfank@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/254023/
State New
Headers show

Comments

pingfan liu - June 25, 2013, 5:38 p.m.
Expose object to bh, so bh will pin virtio-net against unplugged in
parallel

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
 hw/net/virtio-net.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 1ea9556..7c0ded9 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1124,6 +1124,7 @@  static void virtio_net_set_multiqueue(VirtIONet *n, int multiqueue)
             n->vqs[i].tx_vq =
                 virtio_add_queue(vdev, 256, virtio_net_handle_tx_bh);
             n->vqs[i].tx_bh = qemu_bh_new(virtio_net_tx_bh, &n->vqs[i]);
+            qemu_bh_set_obj(n->vqs[i].tx_bh, OBJECT(n));
         }
 
         n->vqs[i].tx_waiting = 0;