qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] bugfix: cannot remove chardev after the vhost-user does hot add/del pci device
@ 2015-01-23 10:01 zhangkun
  0 siblings, 0 replies; only message in thread
From: zhangkun @ 2015-01-23 10:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: zhangkun, jerry.lilijun, qianhuibin

From: zhangkun <zhang.zhangkun@huawei.com>

step for vhost-user hotplug:

1.hot add
  chardev-add backend=socket,id=charnet0,path=/var/run/vhost-user/tap0
  netdev_add type=vhost-user,id=hostnet0,chardev=charnet0
  device_add virtio-net-pci,netdev=hostnet0,id=net0

2.hot del
  device_del net0
  netdev_del hostnet0
  chardev-remove charnet0

Signed-off-by: zhangkun <zhang.zhangkun@huawei.com>
---
 net/vhost-user.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/vhost-user.c b/net/vhost-user.c
index 24e050c..d6936ca 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -72,6 +72,7 @@ static void vhost_user_cleanup(NetClientState *nc)
     VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc);
 
     vhost_user_stop(s);
+    qemu_chr_add_handlers(s->chr, NULL, NULL, NULL, NULL);
     qemu_purge_queued_packets(nc);
 }
 
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-23 10:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-23 10:01 [Qemu-devel] [PATCH] bugfix: cannot remove chardev after the vhost-user does hot add/del pci device zhangkun

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).