Bug 797854

Summary: host can't receive characters if disconnect to TCP socket then re-connect again
Product: Red Hat Enterprise Linux 7 Reporter: Chao Yang <chayang>
Component: qemu-kvmAssignee: Amit Shah <amit.shah>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: acathrow, amit.shah, bsarathy, chayang, juzhang, mdeng, michen, mkenneth, qzhang, rhod, shuang, shu, sluo, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-21 12:54:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Chao Yang 2012-02-27 11:25:52 UTC
Description of problem:
boot a guest with TCP socket backend, transmit characters from guest to host via port, host could receive characters. Disconnect netcat in host by ctrl-c, re-connect again, transmit again from guest, host can't receive characters. *Re-send* in guest, host receives the characters.

Version-Release number of selected component (if applicable):
host:
# rpm -q qemu-kvm;uname -r
qemu-kvm-0.12.1.2-2.231.el6.x86_64
2.6.32-235.el6.x86_64
guest:
2.6.32-236.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. boot with tcp socket as backend:
-chardev socket,id=charchannel1,host=127.0.0.1,port=5555,server,nowait -device virtserialport,bus=virtio-serial0.0,chardev=charchannel1,id=channel1,name=tcp.com.redhat.rhevm.vdsm
# cat /sys/kernel/debug/virtio-ports/vport0p2 
name: tcp.com.redhat.rhevm.vdsm
guest_connected: 0
host_connected: 0
outvq_full: 0
bytes_sent: 0
bytes_received: 0
bytes_discarded: 0
is_console: no
console_vtermno: 2185810413

2. nc 127.0.0.1 5555
# cat /sys/kernel/debug/virtio-ports/vport0p2 
name: tcp.com.redhat.rhevm.vdsm
guest_connected: 0
host_connected: 1
outvq_full: 0
bytes_sent: 0
bytes_received: 0
bytes_discarded: 0
is_console: no
console_vtermno: 2185810413

3.# echo aaaa > /dev/vport0p2 
# cat /sys/kernel/debug/virtio-ports/vport0p2 
name: tcp.com.redhat.rhevm.vdsm
guest_connected: 0
host_connected: 1
outvq_full: 0
bytes_sent: 5
bytes_received: 0
bytes_discarded: 0
is_console: no
console_vtermno: 2185810413

4.Ctrl-c in host
# cat /sys/kernel/debug/virtio-ports/vport0p2 
name: tcp.com.redhat.rhevm.vdsm
guest_connected: 0
host_connected: 1 <----- expected?
outvq_full: 0
bytes_sent: 5
bytes_received: 0
bytes_discarded: 0
is_console: no
console_vtermno: 2185810413

5.re-connect by nc 127.0.0.1 5555

6.# echo aaaa > /dev/vport0p2 
 # cat /sys/kernel/debug/virtio-ports/vport0p2 
name: tcp.com.redhat.rhevm.vdsm
guest_connected: 0
host_connected: 1
outvq_full: 0
bytes_sent: 10
bytes_received: 0
bytes_discarded: 0
is_console: no
console_vtermno: 2185810413

Actual results:
after step 3, host can receive characters
after step 6, host fails to receive characters for the first time transmission, re-send for the second time, host could receive.

Expected results:


Additional info:

Comment 4 RHEL Program Management 2012-07-10 06:06:15 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 5 RHEL Program Management 2012-07-11 02:03:12 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 6 Amit Shah 2012-07-23 11:42:34 UTC
One of the several bugs that need a rewrite of the qemu chardev layer.  Moving to RHEL7.

Comment 10 Amit Shah 2014-07-21 12:54:23 UTC

*** This bug has been marked as a duplicate of bug 702271 ***