Bug 702271 - Guest terminal returns directly in even number times w/o sending data out via virtio-serial-port
Guest terminal returns directly in even number times w/o sending data out via...
Status: CLOSED WORKSFORME
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Amit Shah
Virtualization Bugs
:
: 729923 797854 962326 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-05 04:55 EDT by Mike Cao
Modified: 2017-01-30 04:56 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-30 04:56:03 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike Cao 2011-05-05 04:55:18 EDT
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 05:32:43 EDT
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 08:53:53 EDT
*** Bug 729923 has been marked as a duplicate of this bug. ***
Comment 6 Amit Shah 2014-07-21 08:54:23 EDT
*** Bug 797854 has been marked as a duplicate of this bug. ***
Comment 7 Amit Shah 2014-07-21 08:58:47 EDT
*** Bug 962326 has been marked as a duplicate of this bug. ***
Comment 8 Amit Shah 2014-07-21 09:06:29 EDT
The duplicates may have different testcases, please check them while verifying this bug too.
Comment 9 Amit Shah 2014-07-21 09:07:33 EDT
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 07:36:36 EST
This should work in RHEL7 now.

Please test.
Comment 14 juzhang 2015-11-30 20:16:32 EST
Hi Jing,

Could you have a test in latest RHEL7.2?

Best Regards,
Junyi
Comment 15 jingzhao 2015-11-30 23:20:30 EST
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.