From: zhangkun <zhang.zhangkun@huawei.com>
To: qemu-devel@nongnu.org
Cc: zhangkun <zhang.zhangkun@huawei.com>,
jerry.lilijun@huawei.com, qianhuibin@huawei.com
Subject: [Qemu-devel] [PATCH] bugfix: cannot remove chardev after the vhost-user does hot add/del pci device
Date: Fri, 23 Jan 2015 18:01:59 +0800 [thread overview]
Message-ID: <1422007320-10756-1-git-send-email-zhang.zhangkun@huawei.com> (raw)
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
reply other threads:[~2015-01-23 10:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1422007320-10756-1-git-send-email-zhang.zhangkun@huawei.com \
--to=zhang.zhangkun@huawei.com \
--cc=jerry.lilijun@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=qianhuibin@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).