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 1038914 - Guest can't receive any character transmitted from host after hot unplugging virtserialport then hot plugging again
Summary: Guest can't receive any character transmitted from host after hot unplugging ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Gal Hammer
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1027181
Blocks: RHEL7.0Virt-PostBeta(z-stream) 1110219
TreeView+ depends on / blocked
 
Reported: 2013-12-06 06:45 UTC by Amit Shah
Modified: 2015-03-05 08:02 UTC (History)
20 users (show)

Fixed In Version: qemu-kvm-1.5.3-63.el7
Doc Type: Bug Fix
Doc Text:
Previously, when a guest device was hot unplugged, QEMU correctly removed the corresponding file descriptor watch but did not re-create it after the device was re-connected. As a consequence, the guest became unable to receive any data from the host over this device. With this update, the file descriptor's watch is re-created and the guest in the above scenario can communicate with the host as expected.
Clone Of: 1027181
: 1110219 (view as bug list)
Environment:
Last Closed: 2015-03-05 08:02:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0349 0 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2015-03-05 12:27:34 UTC

Description Amit Shah 2013-12-06 06:45:53 UTC
RHEL7 clone

+++ This bug was initially created as a clone of Bug #1027181 +++

Description of problem:
Keep port open in guest, guest could receive characters sent from host via virtserialport, but hot unplug the port then hot plug it on same nr and same chardev, guest wouldn't receive any character any more, except:
1. set up connection from guest by echo aaa > /dev/vportXX
2. re-connect host by nc -U /path/to/unix-socket
3. re-send characters from host

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.412.el6.x86_64
2.6.32-416.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Boot rhel6.5 guest with this command line
/usr/libexec/qemu-kvm -M pc -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew -k en-us -boot menu=on -spice disable-ticketing,port=5930 -vga qxl -monitor stdio -drive file=/home/RHEL-Server-6.4-64-virtio.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:9d,bus=pci.0,addr=0x9   -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0 -chardev socket,id=charchannel0,path=/opt/chardev-testing.com.redhat.rhevm.vdsm,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm

2.transfer data from host to guest
2. On host:
# hexdump -C /dev/sda | nc -U /opt/chardev-testing.com.redhat.rhevm.vdsm

3.In guest, receive the data from host by:
# cat /dev/vport0p

4.hot unplug the virtserialport:
(qemu) device_del channel0

5. hot plug virtserialport:
(qemu) device_add virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm.com

6. cat /dev/vport0p1 in guest

Actual results:

after step6, guest cann't receive any data from host.


Expected results:
guest can receive data after step 6.


Additional info:

--- Additional comment from Gal Hammer on 2013-11-13 20:58:20 IST ---

(In reply to Amit Shah from comment #3)
> For the record, the following was included in -411..-412:
> 
> 0e741f93da41b39a6d5b4b24cf0e843bd7a31c48 os-posix: block SIGUSR2 in
> os_setup_early_signal_handling()
> a9b3aa794a4e8acd8646db12ffc7897d7469ed9f char: remove watch callback on
> chardev detach from frontend

It looks like this one cause the problem. The vport device removal is follow by the removal of the fd watch (qdev_free >> qemu_chr_add_handlers). The fd is not reconnected after the vport returns.

> d5d63d84edf86a0312d56013dff7e94ad5f3daf4 char: use common function to
> disable callbacks on chardev close
> fdc2f959b4c2370865a73f9df8a0dc4e2c26d31a char: move backends' io watch tag
> to CharDriverState

Comment 6 Miroslav Rezanina 2014-06-17 12:40:17 UTC
Fix included in qemu-kvm-1.5.3-63.el7

Comment 7 huiqingding 2014-08-05 08:06:38 UTC
Reproduce this bug using the following version:
qemu-kvm-1.5.3-62.el7.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Reproduce:
1. boot a guest
#/usr/libexec/qemu-kvm -M pc -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew -k en-us -boot menu=on -spice disable-ticketing,port=5930 -vga qxl -monitor stdio -drive file=gluster://10.66.11.129/gv0/rhel7_1.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:9d,bus=pci.0,addr=0x9   -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0 -chardev socket,id=charchannel0,path=/opt/chardev-testing.com.redhat.rhevm.vdsm,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -qmp tcp:0:4445,server,nowait

2.transfer data from host to guest
On host:
# hexdump -C /dev/sda | nc -U /opt/chardev-testing.com.redhat.rhevm.vdsm

3.In guest, receive the data from host by:
# cat /dev/vport0p

4.hot unplug the virtserialport:
{"execute":"device_del","arguments":{"id":"channel0"}}

5. hot plug virtserialport:
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"com.redhat.rhevm.vdsm"}}

6. cat /dev/vport0p1 in guest

Actual results:

after step6, guest cann't receive any data from host.

Comment 8 huiqingding 2014-08-05 08:07:18 UTC
Test this bug on an intel host using the following version:
qemu-kvm-1.5.3-66.el7.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Reproduce:
1. boot a RHEL7.1 guest
#/usr/libexec/qemu-kvm -M pc -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew -k en-us -boot menu=on -spice disable-ticketing,port=5930 -vga qxl -monitor stdio -drive file=gluster://10.66.11.129/gv0/rhel7_1.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:9d,bus=pci.0,addr=0x9   -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0 -chardev socket,id=charchannel0,path=/opt/chardev-testing.com.redhat.rhevm.vdsm,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -qmp tcp:0:4445,server,nowait

2.transfer data from host to guest
On host:
# hexdump -C /dev/sda | nc -U /opt/chardev-testing.com.redhat.rhevm.vdsm

3.In guest, receive the data from host by:
# cat /dev/vport0p1

4.hot unplug the virtserialport:
{"execute":"device_del","arguments":{"id":"channel0"}}

5. hot plug virtserialport:
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"com.redhat.rhevm.vdsm"}}

6. cat /dev/vport0p1 in guest

Results:

after step6, guest can receive data from host.

Addtional test:
also test HMP command as comment 0, after step6, guest can recieve data from host.

Comment 9 huiqingding 2014-08-05 08:35:34 UTC
Test this bug on an intel host using the following version:
qemu-kvm-1.5.3-66.el7.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Reproduce:
1. boot a win7-64 guest
#/usr/libexec/qemu-kvm -M pc -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew -k en-us -boot menu=on -spice disable-ticketing,port=5930 -vga qxl -monitor stdio -drive file=/home/win7-64.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:9d,bus=pci.0,addr=0x9   -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0 -chardev socket,id=charchannel0,path=/opt/chardev-testing.com.redhat.rhevm.vdsm,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -qmp tcp:0:4445,server,nowait

2.transfer data from host to guest
On host:
# python serial-host-send.py /opt/chardev-testing.com.redhat.rhevm.vdsm

3.In guest, receive the data from host by:
# python.exe VirtIoChannel_guest_receive.py com.redhat.rhevm.vdsm

4.hot unplug the virtserialport:
{"execute":"device_del","arguments":{"id":"channel0"}}

5. hot plug virtserialport:
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"com.redhat.rhevm.vdsm"}}

6.transfer data from host to guest
On host:
# python serial-host-send.py /opt/chardev-testing.com.redhat.rhevm.vdsm

7.In guest, receive the data from host by:
# python.exe VirtIoChannel_guest_receive.py com.redhat.rhevm.vdsm

Results:

after step7, guest can receive data from host.

Addtional test:
also test HMP command as comment 0, after step7, guest can recieve data from host.

Comment 10 huiqingding 2014-08-05 08:39:51 UTC
Test this bug on an intel host using the following version:
qemu-kvm-rhev-2.1.0-3.el7ev.preview.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Reproduce:
1. boot a RHEL7.1 guest
#/usr/libexec/qemu-kvm -M pc -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew -k en-us -boot menu=on -spice disable-ticketing,port=5930 -vga qxl -monitor stdio -drive file=gluster://10.66.11.129/gv0/rhel7_1.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:9d,bus=pci.0,addr=0x9   -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0 -chardev socket,id=charchannel0,path=/opt/chardev-testing.com.redhat.rhevm.vdsm,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -qmp tcp:0:4445,server,nowait

2.transfer data from host to guest
On host:
# hexdump -C /dev/sda | nc -U /opt/chardev-testing.com.redhat.rhevm.vdsm

3.In guest, receive the data from host by:
# cat /dev/vport0p1

4.hot unplug the virtserialport:
{"execute":"device_del","arguments":{"id":"channel0"}}

5. hot plug virtserialport:
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"com.redhat.rhevm.vdsm"}}

6. cat /dev/vport0p1 in guest

Results:

after step6, guest can receive data from host.

Addtional test:
also test HMP command as comment 0, after step6, guest can recieve data from host.

Comment 11 huiqingding 2014-08-05 09:59:07 UTC
Test this bug on an amd host using the following version:
qemu-kvm-1.5.3-66.el7.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Reproduce:
1. boot a win7-64 guest
#/usr/libexec/qemu-kvm -M pc -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew -k en-us -boot menu=on -spice disable-ticketing,port=5930 -vga qxl -monitor stdio -drive file=/home/win7-64.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:9d,bus=pci.0,addr=0x9   -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0 -chardev socket,id=charchannel0,path=/opt/chardev-testing.com.redhat.rhevm.vdsm,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -qmp tcp:0:4445,server,nowait

2.transfer data from host to guest
On host:
# python serial-host-send.py /opt/chardev-testing.com.redhat.rhevm.vdsm

3.In guest, receive the data from host by:
# python.exe VirtIoChannel_guest_receive.py com.redhat.rhevm.vdsm

4.hot unplug the virtserialport:
{"execute":"device_del","arguments":{"id":"channel0"}}

5. hot plug virtserialport:
{"execute":"device_add","arguments":{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"com.redhat.rhevm.vdsm"}}

6.transfer data from host to guest
On host:
# python serial-host-send.py /opt/chardev-testing.com.redhat.rhevm.vdsm

7.In guest, receive the data from host by:
# python.exe VirtIoChannel_guest_receive.py com.redhat.rhevm.vdsm

Results:

after step7, guest can receive data from host.

Addtional test:
also test HMP command as comment 0, after step7, guest can recieve data from host.

Comment 12 huiqingding 2014-08-06 08:05:39 UTC
Test this bug on an amd host using the following version:
qemu-kvm-rhev-2.1.0-3.el7ev.preview.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Test:
1. boot a win7-64 guest
#/usr/libexec/qemu-kvm -M pc -enable-kvm -m 4G -smp 4,sockets=1,cores=4,threads=1 -name test -rtc base=localtime,clock=host,driftfix=slew -k en-us -boot menu=on -spice disable-ticketing,port=5930 -vga qxl -monitor stdio -drive file=/home/win7-64.qcow2,if=none,id=drive-system-disk,media=disk,format=qcow2,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-system-disk,id=system-disk -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:22:15:27:54:9d,bus=pci.0,addr=0x9   -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0 -chardev socket,id=charchannel0,path=/opt/chardev-testing.com.redhat.rhevm.vdsm,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -qmp tcp:0:4445,server,nowait

2.transfer data from host to guest
On host:
# python serial-host-send.py /opt/chardev-testing.com.redhat.rhevm.vdsm

3.In guest, receive the data from host by:
# python.exe VirtIoChannel_guest_receive.py com.redhat.rhevm.vdsm


Results:

after step3, guest cannot receive data from host, file a new bz1127111

Comment 16 errata-xmlrpc 2015-03-05 08:02:16 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://rhn.redhat.com/errata/RHSA-2015-0349.html


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