RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1256618 - Chardev remains busy after hot remove vhost-user that connected to the chardev.
Summary: Chardev remains busy after hot remove vhost-user that connected to the chardev.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.2
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Marc-Andre Lureau
QA Contact: Pei Zhang
URL:
Whiteboard:
: 1256619 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-25 06:50 UTC by Qian Guo
Modified: 2017-10-09 01:14 UTC (History)
10 users (show)

Fixed In Version: qemu-kvm-rhev-2.9.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 23:29:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:2392 0 normal SHIPPED_LIVE Important: qemu-kvm-rhev security, bug fix, and enhancement update 2017-08-01 20:04:36 UTC

Description Qian Guo 2015-08-25 06:50:44 UTC
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 14:22:13 UTC
sent a RFC to qemu-devel "vhost-user: release chardev on cleanup"

Comment 5 Marc-Andre Lureau 2016-04-06 15:39:15 UTC
no comments on rfc, patches resent

Comment 8 Ademar Reis 2017-02-03 21:20:00 UTC
(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>
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>
    Reviewed-by: Michael S. Tsirkin <mst>
    Signed-off-by: Michael S. Tsirkin <mst>
    Reviewed-by: Eric Blake <eblake>

Comment 10 Pei Zhang 2017-05-18 14:21:04 UTC
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 23:29:42 UTC
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-02 01:07:21 UTC
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-02 01:59:20 UTC
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-02 02:40:06 UTC
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-02 03:04:50 UTC
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-02 03:24:58 UTC
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-09 01:14:26 UTC
*** 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.