Red Hat Bugzilla – Bug 1256618
Chardev remains busy after hot remove vhost-user that connected to the chardev.
Last modified: 2017-10-08 21:14:26 EDT
Description of problem: 1.Can not hot remove the chardev after hot remove the vhost-user, qemu reports that the chardev is busy 2.Can not hot plug the vhost-user to the chardev which was used by an original vhost-user(not used by any vhost-uesr now.) Version-Release number of selected component (if applicable): qemu-kvm-rhev-2.3.0-18.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.Boot guest with chardev and vhost-user that user the chardev. ... -chardev socket,id=charnet0,path=/var/run/openvswitch/vhost-user1 \ -netdev type=vhost-user,id=hostnet0,chardev=charnet0 \ -device virtio-net-pci,netdev=hostnet0,mrg_rxbuf=off,id=net0,mac=52:54:00:01:0b:11,bus=pci.0,addr=0x9 ... 2.Try to remove the virtual nic and vhost-user netdev. (qemu) device_del net0 (qemu) netdev_del hostnet0 3.Try to remove the chardev that the vhost-user used: Actual results: Failed due to chardev busy: (qemu) chardev-remove charnet0 Chardev 'charnet0' is busy Expected results: Can hot remove the chardev, and if not remove the chardev, can reuse the chardev for the new vhost-user. Additional info:
sent a RFC to qemu-devel "vhost-user: release chardev on cleanup"
no comments on rfc, patches resent
(In reply to Marc-Andre Lureau from comment #7) > still under review upstream, moving to 7.5 Merged upstream: commit e0b283e7c5b020c3e54629d8b82117db0af21cca Author: Marc-André Lureau <marcandre.lureau@redhat.com> Date: Tue Jan 24 23:02:58 2017 +0400 vhost-user: delete chardev on cleanup Remove the chardev implicitly when cleaning up the netdev. This prevents from reusing the chardev since it would be in an incorrect state with the slave. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1256618 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Reproduce: Versions: 3.10.0-666.el7.x86_64 qemu-kvm-rhev-2.3.0-21.el7.x86_64 Steps: 1. Boot guest with vhost-user client mode # /usr/libexec/qemu-kvm \ -name guest=rhel7.4_nonrt \ -cpu host \ -m 8G \ -smp 4,sockets=1,cores=4,threads=1 \ -object memory-backend-file,id=ram-node0,prealloc=yes,mem-path=/dev/hugepages,share=yes,size=8G,host-nodes=0,policy=bind \ -numa node,nodeid=0,cpus=0-3,memdev=ram-node0 \ -drive file=/home/images_nfv-virt-rt-kvm/rhel7.4_nonrt.qcow2,format=qcow2,if=none,id=drive-virtio-disk0,cache=none,aio=threads \ -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0 \ -chardev socket,id=charnet1,path=/var/run/openvswitch/vhost-user0 \ -netdev vhost-user,chardev=charnet1,id=hostnet1 \ -device virtio-net-pci,netdev=hostnet1,id=net1,mac=18:66:da:5f:dd:02 \ -msg timestamp=on \ -monitor stdio \ -vnc :2 2. Do hot-plug vhost-user chardev, fail. (qemu) device_del net1 (qemu) netdev_del hostnet1 (qemu) chardev-remove charnet1 Chardev 'charnet1' is busy So this bug has been reproduced. ==Verification== Versions: qemu-kvm-rhev-2.9.0-5.el7.x86_64 3.10.0-666.el7.x86_64 Steps: 1. Boot guest with vhost-user client mode Same as above Step 1 in reproduce. 2. Do hot-plug vhost-user devices, after netdev_del, the chardev has been removed. (qemu) device_del net1 (qemu) netdev_del hostnet1 (qemu) info chardev parallel0: filename=vc serial0: filename=vc compat_monitor0: filename=stdio 3. Check devices in guest, this vhost-user network has been removed. So this bug has been fixed well. Thanks. Move this bug to 'VERIFIED'.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2017:2392
*** Bug 1256619 has been marked as a duplicate of this bug. ***