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 702271 - Guest terminal returns directly in even number times w/o sending data out via virtio-serial-port
Summary: Guest terminal returns directly in even number times w/o sending data out via...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Amit Shah
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 729923 797854 962326 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-05 08:55 UTC by Mike Cao
Modified: 2017-01-30 09:56 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-30 09:56:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 909059 0 medium CLOSED Switch to upstream solution for chardev flow control 2021-02-22 00:41:40 UTC

Internal Links: 909059

Description Mike Cao 2011-05-05 08:55:18 UTC
Description of problem:


Version-Release number of selected component (if applicable):
# uname -r
2.6.32-131.0.10.el6.x86_64
[root@localhost Desktop]# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.160.el6.x86_64

Guest
Tried RHEL6.1-2011-04-27 64 bit & RHEL5.7 64 bit guest both hit the issue.

How reproducible:
100%

Steps to Reproduce:
1.start VM with virtio-serial-port
CLI:<CommandLine>
-device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x8 -chardev socket,id=s1,path=/tmp/tt1,server,nowait 
-device virtserialport,chardev=s1,name=org.linux-kvm.port.0,bus=virtio-serial0.0,id=port0
2.in the guest ,send data via /dev/vport0p1
echo c > /dev/vport0p1
(after step2 ,echo stays there waiting to send the data out)
3.on the host , nc -U /tmp/tt ,after received data,stop nc 
4.in the guest ,send data via /dev/vport0p1 2nd time
  
Actual results:
after step2 ,echo will return directly without waiting host receive data.
then repeat step2-4 in a loop ,found that 2nd/4th/6th/8th/10th... times send data via virtio-serial-port,echo commands returns directly while 1st/3th/5th/7th.. times not.


Expected results:
all the times echo command should return after sending data out to host

Additional info:

Comment 1 Amit Shah 2011-05-05 09:32:43 UTC
This might be related to bug 621484.  We used to lose data earlier when a host-side connection was terminated.  After fixing that in bug 621484, we no longer lose data, but still miss the disconnect event.  This can't be fixed till we switch to poll() in qemu's main_loop.  That depends on the glib integration, so looks like we'll have to wait till RHEL7 for the fix here.

Comment 5 Amit Shah 2014-07-21 12:53:53 UTC
*** Bug 729923 has been marked as a duplicate of this bug. ***

Comment 6 Amit Shah 2014-07-21 12:54:23 UTC
*** Bug 797854 has been marked as a duplicate of this bug. ***

Comment 7 Amit Shah 2014-07-21 12:58:47 UTC
*** Bug 962326 has been marked as a duplicate of this bug. ***

Comment 8 Amit Shah 2014-07-21 13:06:29 UTC
The duplicates may have different testcases, please check them while verifying this bug too.

Comment 9 Amit Shah 2014-07-21 13:07:33 UTC
main-loop.c still isn't using poll(), and we need that to detect SIGHUP.  Not likely to happen anytime soon.

Comment 13 Amit Shah 2015-11-30 12:36:36 UTC
This should work in RHEL7 now.

Please test.

Comment 14 juzhang 2015-12-01 01:16:32 UTC
Hi Jing,

Could you have a test in latest RHEL7.2?

Best Regards,
Junyi

Comment 15 jingzhao 2015-12-01 04:20:30 UTC
kernel:3.10.0-327.el7.x86_64 
qemu-kvm-rhev-2.3.0-31.el7,qemu-kvm-1.5.3-105.el7_2.1 and qemu-kvm-rhev-2.3.0-31.el7_2.3
1. Can not reproduce with comment0
2. Hit the data lost in the host when echo data in the guest, but the phenomenon are randomly.
   a.qemu-kvm-rhev-2.3.0-31.el7:
       Steps to Reproduce:
        1.start VM with virtio-serial-port
          CLI:<CommandLine>
            -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0\
            -chardev socket,id=s1,path=/tmp/tt1,server,nowait \
            -device virtserialport,chardev=s1,name=org.linux-kvm.port.0,bus=virtio-serial0.0,id=port0 \
        2.in the guest ,send data via /dev/vport0p1
           echo c > /dev/vport0p1
        3.on the host , nc -U /tmp/tt ,after received data,stop nc
      Result: tried 2 times with above steps, first time: echo will return directly without waiting host receive data after step2 and the data lost in the host after ran step3 ,only echo will waiting host receive data when echo 12 charaters, the second time: echo echo will return directly without waiting host receive data after step2 when ran "echo c > /dev/vport0p1" at 2nd  
   b. qemu-kvm-rhev-2.3.0-31.el7_2.3:
       the steps are same with a
       result:echo echo will return directly without waiting host receive data after step2 when ran "echo c > /dev/vport0p1" at 2nd time
   c. qemu-kvm-1.5.3-105.el7_2.1:
       steps are same with a and b
       result:tried 2 times with above steps, first time: echo will return directly without waiting host receive data after step2 and the data lost in the host after ran step3 ,only echo will waiting host receive data when echo 14 charaters, the second time: echo echo will return directly without waiting host receive data after step2 when ran "echo c > /dev/vport0p1" at 2nd time.


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