Red Hat Bugzilla – Bug 1038914
Guest can't receive any character transmitted from host after hot unplugging virtserialport then hot plugging again
Last modified: 2015-03-05 03:02:16 EST
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
Fix included in qemu-kvm-1.5.3-63.el7
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.
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.
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.
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.
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.
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
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