Bug 1256618 - Chardev remains busy after hot remove vhost-user that connected to the chardev.
Chardev remains busy after hot remove vhost-user that connected to the chardev.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev (Show other bugs)
7.2
x86_64 Unspecified
medium Severity medium
: rc
: ---
Assigned To: Marc-Andre Lureau
Pei Zhang
:
: 1256619 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-25 02:50 EDT by Qian Guo
Modified: 2017-10-08 21:14 EDT (History)
10 users (show)

See Also:
Fixed In Version: qemu-kvm-rhev-2.9.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 19:29:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Qian Guo 2015-08-25 02:50:44 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:
Comment 2 Marc-Andre Lureau 2015-09-03 10:22:13 EDT
sent a RFC to qemu-devel "vhost-user: release chardev on cleanup"
Comment 5 Marc-Andre Lureau 2016-04-06 11:39:15 EDT
no comments on rfc, patches resent
Comment 8 Ademar Reis 2017-02-03 16:20:00 EST
(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>
Comment 10 Pei Zhang 2017-05-18 10:21:04 EDT
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'.
Comment 12 errata-xmlrpc 2017-08-01 19:29:42 EDT
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
Comment 13 errata-xmlrpc 2017-08-01 21:07:21 EDT
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
Comment 14 errata-xmlrpc 2017-08-01 21:59:20 EDT
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
Comment 15 errata-xmlrpc 2017-08-01 22:40:06 EDT
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
Comment 16 errata-xmlrpc 2017-08-01 23:04:50 EDT
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
Comment 17 errata-xmlrpc 2017-08-01 23:24:58 EDT
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
Comment 18 xiywang 2017-10-08 21:14:26 EDT
*** Bug 1256619 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.