Skip to contentSkip to conversation

bugfix: cannot remove chardev after the vhost-user does hot add/del pci device

PATCH New zhangkun 1 participant 1 message Jan 23, 2015 Networking

lore
Share & tools
lore

zhangkun

author
#0 lore raw

PATCH 1/1 bugfix: cannot remove chardev after the vhost-user does hot add/del pci device

From: zhangkun <[email protected]>

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

---
 net/vhost-user.c | 1 +
 1 file changed, 1 insertion(+)
net/vhost-user.c +1 -0
index 24e050c..d6936ca 100644
@@ -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);
 }
 
Signature · 1 line
1.7.12.4