Bug 984904

Summary: data loss in virtio-serial port after disconnect/reconnect chardev
Product: Red Hat Enterprise Linux 6 Reporter: Sibiao Luo <sluo>
Component: qemu-kvmAssignee: Amit Shah <amit.shah>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: amit.shah, chayang, juzhang, mdeng, michen, mkenneth, qzhang, rbalakri, rpacheco, sluo, virt-maint, xfu, yfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-30 12:38:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sibiao Luo 2013-07-16 10:27:23 UTC
Description of problem:
boot guest with the MAX number (30) of virtio serial ports, and transfer data from guest to host via every virtio-serial-port and find the second port not work well.

Version-Release number of selected component (if applicable):
host info:
kernel-2.6.32-398.el6.x86_64
qemu-kvm-0.12.1.2-2.378.el6.x86_64
guest info:
kernel-2.6.32-398.el6.x86_64

How reproducible:
always.

Steps to Reproduce:
1.boot guest with the MAX number (30) of virtio serial ports.
2.dd a file in guest and check the md5 for it.
# dd if=/dev/zero of=guest-file bs=1M count=2000
# md5sum guest-file 
a981130cf2b7e09f4686dc273cf7187e  guest-file
3.transfer data from guest to host via every virtio-serial-port and check the md5.

Actual results:
after step3, the second port not work well.
guest]#  cat guest-file > /dev/vport0p2
host ]# nc -U /tmp/helloworld2 > received-file
host ]# md5sum received-file 
6e127dad4b2fde03556bb185a39d4e20  received-file  <------Fail

guest]#  cat guest-file > /dev/vport0p29
host ]# nc -U /tmp/helloworld29 > received-file
host ]# md5sum received-file 
a981130cf2b7e09f4686dc273cf7187e  received-file  <------Pass

guest]#  cat guest-file > /dev/vport0p30
host ]# nc -U /tmp/helloworld30 > received-file
host ]# md5sum received-file 
a981130cf2b7e09f4686dc273cf7187e  received-file  <------Pass

guest]#  cat guest-file > /dev/vport0p2
host ]# nc -U /tmp/helloworld2 > received-file
host ]# md5sum received-file 
6e127dad4b2fde03556bb185a39d4e20  received-file  <------Fail

guest]#  cat guest-file > /dev/vport0p15
host ]# nc -U /tmp/helloworld15 > received-file
host ]# md5sum received-file 
a981130cf2b7e09f4686dc273cf7187e  received-file  <------Pass

guest]#  cat guest-file > /dev/vport0p2
host ]# nc -U /tmp/helloworld2 > received-file
host ]# md5sum received-file 
6e127dad4b2fde03556bb185a39d4e20  received-file  <------Fail

Expected results:
all the 30 ports should work well.

Additional info:

Comment 1 Sibiao Luo 2013-07-16 10:28:10 UTC
# /usr/libexec/qemu-kvm -S -M rhel6.5.0 -cpu SandyBridge -enable-kvm -m 4096 -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -name sluo -uuid 43425b70-86e5-4664-bf2c-3b76699b8bec -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,max_ports=31,bus=pci.0,addr=0x3 -drive file=/home/RHEL6.5-20130712.n.0-6.5-Server-x64.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial="QEMU-DISK1" -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-system-disk,id=system-disk,bootindex=1 -device virtio-balloon-pci,id=ballooning,bus=pci.0,addr=0x5 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=2C:41:38:B6:40:21,bus=pci.0,addr=0x6,bootindex=2 -drive file=/home/my-data-disk.qcow2,if=none,id=drive-data-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial="QEMU-DISK2" -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-data-disk,id=data-disk,bootindex=3 -k en-us -boot menu=on -qmp tcp:0:4444,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :1 -spice port=5931,disable-ticketing -monitor stdio -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,nr=1,chardev=channel1,name=com.redhat.rhevm.vdsm1,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,nr=2,chardev=channel2,name=com.redhat.rhevm.vdsm2,bus=virtio-serial0.0,id=port2 -chardev socket,id=channel3,path=/tmp/helloworld3,server,nowait -device virtserialport,nr=3,chardev=channel3,name=com.redhat.rhevm.vdsm3,bus=virtio-serial0.0,id=port3 -chardev socket,id=channel4,path=/tmp/helloworld4,server,nowait -device virtserialport,nr=4,chardev=channel4,name=com.redhat.rhevm.vdsm4,bus=virtio-serial0.0,id=port4 -chardev socket,id=channel5,path=/tmp/helloworld5,server,nowait -device virtserialport,nr=5,chardev=channel5,name=com.redhat.rhevm.vdsm5,bus=virtio-serial0.0,id=port5 -chardev socket,id=channel6,path=/tmp/helloworld6,server,nowait -device virtserialport,nr=6,chardev=channel6,name=com.redhat.rhevm.vdsm6,bus=virtio-serial0.0,id=port6 -chardev socket,id=channel7,path=/tmp/helloworld7,server,nowait -device virtserialport,nr=7,chardev=channel7,name=com.redhat.rhevm.vdsm7,bus=virtio-serial0.0,id=port7 -chardev socket,id=channel8,path=/tmp/helloworld8,server,nowait -device virtserialport,nr=8,chardev=channel8,name=com.redhat.rhevm.vdsm8,bus=virtio-serial0.0,id=port8 -chardev socket,id=channel9,path=/tmp/helloworld9,server,nowait -device virtserialport,nr=9,chardev=channel9,name=com.redhat.rhevm.vdsm9,bus=virtio-serial0.0,id=port9 -chardev socket,id=channel10,path=/tmp/helloworld10,server,nowait -device virtserialport,nr=10,chardev=channel10,name=com.redhat.rhevm.vdsm10,bus=virtio-serial0.0,id=port10 -chardev socket,id=channel11,path=/tmp/helloworld11,server,nowait -device virtserialport,nr=11,chardev=channel11,name=com.redhat.rhevm.vdsm11,bus=virtio-serial0.0,id=port11 -chardev socket,id=channel12,path=/tmp/helloworld12,server,nowait -device virtserialport,nr=12,chardev=channel12,name=com.redhat.rhevm.vdsm12,bus=virtio-serial0.0,id=port12 -chardev socket,id=channel13,path=/tmp/helloworld13,server,nowait -device virtserialport,nr=13,chardev=channel13,name=com.redhat.rhevm.vdsm/usr/libexec/qemu-kvm -S -M rhel6.5.0 -cpu SandyBridge -enable-kvm -m 4096 -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -name sluo -uuid 43425b70-86e5-4664-bf2c-3b76699b8bec -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,max_ports=31,bus=pci.0,addr=0x3 -drive file=/home/RHEL6.5-20130712.n.0-6.5-Server-x64.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial="QEMU-DISK1" -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-system-disk,id=system-disk,bootindex=1 -device virtio-balloon-pci,id=ballooning,bus=pci.0,addr=0x5 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=2C:41:38:B6:40:21,bus=pci.0,addr=0x6,bootindex=2 -drive file=/home/my-data-disk.qcow2,if=none,id=drive-data-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial="QEMU-DISK2" -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-data-disk,id=data-disk,bootindex=3 -k en-us -boot menu=on -qmp tcp:0:4444,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :1 -spice port=5931,disable-ticketing -monitor stdio -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,nr=1,chardev=channel1,name=com.redhat.rhevm.vdsm1,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,nr=2,chardev=channel2,name=com.redhat.rhevm.vdsm2,bus=virtio-serial0.0,id=port2 -chardev socket,id=channel3,path=/tmp/helloworld3,server,nowait -device virtserialport,nr=3,chardev=channel3,name=com.redhat.rhevm.vdsm3,bus=virtio-serial0.0,id=port3 -chardev socket,id=channel4,path=/tmp/helloworld4,server,nowait -device virtserialport,nr=4,chardev=channel4,name=com.redhat.rhevm.vdsm4,bus=virtio-serial0.0,id=port4 -chardev socket,id=channel5,path=/tmp/helloworld5,server,nowait -device virtserialport,nr=5,chardev=channel5,name=com.redhat.rhevm.vdsm5,bus=virtio-serial0.0,id=port5 -chardev socket,id=channel6,path=/tmp/helloworld6,server,nowait -device virtserialport,nr=6,chardev=channel6,name=com.redhat.rhevm.vdsm6,bus=virtio-serial0.0,id=port6 -chardev socket,id=channel7,path=/tmp/helloworld7,server,nowait -device virtserialport,nr=7,chardev=channel7,name=com.redhat.rhevm.vdsm7,bus=virtio-serial0.0,id=port7 -chardev socket,id=channel8,path=/tmp/helloworld8,server,nowait -device virtserialport,nr=8,chardev=channel8,name=com.redhat.rhevm.vdsm8,bus=virtio-serial0.0,id=port8 -chardev socket,id=channel9,path=/tmp/helloworld9,server,nowait -device virtserialport,nr=9,chardev=channel9,name=com.redhat.rhevm.vdsm9,bus=virtio-serial0.0,id=port9 -chardev socket,id=channel10,path=/tmp/helloworld10,server,nowait -device virtserialport,nr=10,chardev=channel10,name=com.redhat.rhevm.vdsm10,bus=virtio-serial0.0,id=port10 -chardev socket,id=channel11,path=/tmp/helloworld11,server,nowait -device virtserialport,nr=11,chardev=channel11,name=com.redhat.rhevm.vdsm11,bus=virtio-serial0.0,id=port11 -chardev socket,id=channel12,path=/tmp/helloworld12,server,nowait -device virtserialport,nr=12,chardev=channel12,name=com.redhat.rhevm.vdsm12,bus=virtio-serial0.0,id=port12 -chardev socket,id=channel13,path=/tmp/helloworld13,server,nowait -device virtserialport,nr=13,chardev=channel13,name=com.redhat.rhevm.vdsm13,bus=virtio-serial0.0,id=port13 -chardev socket,id=channel14,path=/tmp/helloworld14,server,nowait -device virtserialport,nr=14,chardev=channel14,name=com.redhat.rhevm.vdsm14,bus=virtio-serial0.0,id=port14 -chardev socket,id=channel15,path=/tmp/helloworld15,server,nowait -device virtserialport,nr=15,chardev=channel15,name=com.redhat.rhevm.vdsm15,bus=virtio-serial0.0,id=port15 -chardev socket,id=channel16,path=/tmp/helloworld16,server,nowait -device virtserialport,nr=16,chardev=channel16,name=com.redhat.rhevm.vdsm16,bus=virtio-serial0.0,id=port16 -chardev socket,id=channel17,path=/tmp/helloworld17,server,nowait -device virtserialport,nr=17,chardev=channel17,name=com.redhat.rhevm.vdsm17,bus=virtio-serial0.0,id=port17 -chardev socket,id=channel18,path=/tmp/helloworld18,server,nowait -device virtserialport,nr=18,chardev=channel18,name=com.redhat.rhevm.vdsm18,bus=virtio-serial0.0,id=port18 -chardev socket,id=channel19,path=/tmp/helloworld19,server,nowait -device virtserialport,nr=19,chardev=channel19,name=com.redhat.rhevm.vdsm19,bus=virtio-serial0.0,id=port19 -chardev socket,id=channel20,path=/tmp/helloworld20,server,nowait -device virtserialport,nr=20,chardev=channel20,name=com.redhat.rhevm.vdsm20,bus=virtio-serial0.0,id=port20 -chardev socket,id=channel21,path=/tmp/helloworld21,server,nowait -device virtserialport,nr=21,chardev=channel21,name=com.redhat.rhevm.vdsm21,bus=virtio-serial0.0,id=port21 -chardev socket,id=channel22,path=/tmp/helloworld22,server,nowait -device virtserialport,nr=22,chardev=channel22,name=com.redhat.rhevm.vdsm22,bus=virtio-serial0.0,id=port22 -chardev socket,id=channel23,path=/tmp/helloworld23,server,nowait -device virtserialport,nr=23,chardev=channel23,name=com.redhat.rhevm.vdsm23,bus=virtio-serial0.0,id=port23 -chardev socket,id=channel24,path=/tmp/helloworld24,server,nowait -device virtserialport,nr=24,chardev=channel24,name=com.redhat.rhevm.vdsm24,bus=virtio-serial0.0,id=port24 -chardev socket,id=channel25,path=/tmp/helloworld25,server,nowait -device virtserialport,nr=25,chardev=channel25,name=com.redhat.rhevm.vdsm25,bus=virtio-serial0.0,id=port25 -chardev socket,id=channel26,path=/tmp/helloworld26,server,nowait -device virtserialport,nr=26,chardev=channel26,name=com.redhat.rhevm.vdsm26,bus=virtio-serial0.0,id=port26 -chardev socket,id=channel27,path=/tmp/helloworld27,server,nowait -device virtserialport,nr=27,chardev=channel27,name=com.redhat.rhevm.vdsm27,bus=virtio-serial0.0,id=port27 -chardev socket,id=channel28,path=/tmp/helloworld28,server,nowait -device virtserialport,nr=28,chardev=channel28,name=com.redhat.rhevm.vdsm28,bus=virtio-serial0.0,id=port28 -chardev socket,id=channel29,path=/tmp/helloworld29,server,nowait -device virtserialport,nr=29,chardev=channel29,name=com.redhat.rhevm.vdsm29,bus=virtio-serial0.0,id=port29 -chardev socket,id=channel30,path=/tmp/helloworld30,server,nowait -device virtserialport,nr=30,chardev=channel30,name=com.redhat.rhevm.vdsm30,bus=virtio-serial0.0,id=port30

Comment 2 Sibiao Luo 2013-07-16 10:34:03 UTC
(In reply to Sibiao Luo from comment #1)
> # /usr/libexec/qemu-kvm -S -M rhel6.5.0 -cpu SandyBridge -enable-kvm -m 4096
> -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -name sluo -uuid
> 43425b70-86e5-4664-bf2c-3b76699b8bec -rtc
> base=localtime,clock=host,driftfix=slew -device
> virtio-serial-pci,id=virtio-serial0,max_ports=31,bus=pci.0,addr=0x3 -drive
> file=/home/RHEL6.5-20130712.n.0-6.5-Server-x64.qcow2,if=none,id=drive-system-
> disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial="QEMU-
> DISK1" -device
> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-system-disk,id=system-
> disk,bootindex=1 -device virtio-balloon-pci,id=ballooning,bus=pci.0,addr=0x5
> -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -netdev
> tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device
> virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=2C:41:38:B6:40:21,
> bus=pci.0,addr=0x6,bootindex=2 -drive
> file=/home/my-data-disk.qcow2,if=none,id=drive-data-disk,format=qcow2,
> cache=none,aio=native,werror=stop,rerror=stop,serial="QEMU-DISK2" -device
> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-data-disk,id=data-
> disk,bootindex=3 -k en-us -boot menu=on -qmp tcp:0:4444,server,nowait
> -serial unix:/tmp/ttyS0,server,nowait -vnc :1 -spice
> port=5931,disable-ticketing -monitor stdio -chardev
> socket,id=channel1,path=/tmp/helloworld1,server,nowait -device
> virtserialport,nr=1,chardev=channel1,name=com.redhat.rhevm.vdsm1,bus=virtio-
> serial0.0,id=port1 -chardev
> socket,id=channel2,path=/tmp/helloworld2,server,nowait -device
> virtserialport,nr=2,chardev=channel2,name=com.redhat.rhevm.vdsm2,bus=virtio-
> serial0.0,id=port2 -chardev
> socket,id=channel3,path=/tmp/helloworld3,server,nowait -device
> virtserialport,nr=3,chardev=channel3,name=com.redhat.rhevm.vdsm3,bus=virtio-
> serial0.0,id=port3 -chardev
> socket,id=channel4,path=/tmp/helloworld4,server,nowait -device
> virtserialport,nr=4,chardev=channel4,name=com.redhat.rhevm.vdsm4,bus=virtio-
> serial0.0,id=port4 -chardev
> socket,id=channel5,path=/tmp/helloworld5,server,nowait -device
> virtserialport,nr=5,chardev=channel5,name=com.redhat.rhevm.vdsm5,bus=virtio-
> serial0.0,id=port5 -chardev
> socket,id=channel6,path=/tmp/helloworld6,server,nowait -device
> virtserialport,nr=6,chardev=channel6,name=com.redhat.rhevm.vdsm6,bus=virtio-
> serial0.0,id=port6 -chardev
> socket,id=channel7,path=/tmp/helloworld7,server,nowait -device
> virtserialport,nr=7,chardev=channel7,name=com.redhat.rhevm.vdsm7,bus=virtio-
> serial0.0,id=port7 -chardev
> socket,id=channel8,path=/tmp/helloworld8,server,nowait -device
> virtserialport,nr=8,chardev=channel8,name=com.redhat.rhevm.vdsm8,bus=virtio-
> serial0.0,id=port8 -chardev
> socket,id=channel9,path=/tmp/helloworld9,server,nowait -device
> virtserialport,nr=9,chardev=channel9,name=com.redhat.rhevm.vdsm9,bus=virtio-
> serial0.0,id=port9 -chardev
> socket,id=channel10,path=/tmp/helloworld10,server,nowait -device
> virtserialport,nr=10,chardev=channel10,name=com.redhat.rhevm.vdsm10,
> bus=virtio-serial0.0,id=port10 -chardev
> socket,id=channel11,path=/tmp/helloworld11,server,nowait -device
> virtserialport,nr=11,chardev=channel11,name=com.redhat.rhevm.vdsm11,
> bus=virtio-serial0.0,id=port11 -chardev
> socket,id=channel12,path=/tmp/helloworld12,server,nowait -device
> virtserialport,nr=12,chardev=channel12,name=com.redhat.rhevm.vdsm12,
> bus=virtio-serial0.0,id=port12 -chardev
> socket,id=channel13,path=/tmp/helloworld13,server,nowait -device
> virtserialport,nr=13,chardev=channel13,name=com.redhat.rhevm.vdsm
Note: ignore above one, the following is the correct command line.
> /usr/
> libexec/qemu-kvm -S -M rhel6.5.0 -cpu SandyBridge -enable-kvm -m 4096 -smp
> 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -name sluo -uuid
> 43425b70-86e5-4664-bf2c-3b76699b8bec -rtc
> base=localtime,clock=host,driftfix=slew -device
> virtio-serial-pci,id=virtio-serial0,max_ports=31,bus=pci.0,addr=0x3 -drive
> file=/home/RHEL6.5-20130712.n.0-6.5-Server-x64.qcow2,if=none,id=drive-system-
> disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial="QEMU-
> DISK1" -device
> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-system-disk,id=system-
> disk,bootindex=1 -device virtio-balloon-pci,id=ballooning,bus=pci.0,addr=0x5
> -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -netdev
> tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device
> virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=2C:41:38:B6:40:21,
> bus=pci.0,addr=0x6,bootindex=2 -drive
> file=/home/my-data-disk.qcow2,if=none,id=drive-data-disk,format=qcow2,
> cache=none,aio=native,werror=stop,rerror=stop,serial="QEMU-DISK2" -device
> virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-data-disk,id=data-
> disk,bootindex=3 -k en-us -boot menu=on -qmp tcp:0:4444,server,nowait
> -serial unix:/tmp/ttyS0,server,nowait -vnc :1 -spice
> port=5931,disable-ticketing -monitor stdio -chardev
> socket,id=channel1,path=/tmp/helloworld1,server,nowait -device
> virtserialport,nr=1,chardev=channel1,name=com.redhat.rhevm.vdsm1,bus=virtio-
> serial0.0,id=port1 -chardev
> socket,id=channel2,path=/tmp/helloworld2,server,nowait -device
> virtserialport,nr=2,chardev=channel2,name=com.redhat.rhevm.vdsm2,bus=virtio-
> serial0.0,id=port2 -chardev
> socket,id=channel3,path=/tmp/helloworld3,server,nowait -device
> virtserialport,nr=3,chardev=channel3,name=com.redhat.rhevm.vdsm3,bus=virtio-
> serial0.0,id=port3 -chardev
> socket,id=channel4,path=/tmp/helloworld4,server,nowait -device
> virtserialport,nr=4,chardev=channel4,name=com.redhat.rhevm.vdsm4,bus=virtio-
> serial0.0,id=port4 -chardev
> socket,id=channel5,path=/tmp/helloworld5,server,nowait -device
> virtserialport,nr=5,chardev=channel5,name=com.redhat.rhevm.vdsm5,bus=virtio-
> serial0.0,id=port5 -chardev
> socket,id=channel6,path=/tmp/helloworld6,server,nowait -device
> virtserialport,nr=6,chardev=channel6,name=com.redhat.rhevm.vdsm6,bus=virtio-
> serial0.0,id=port6 -chardev
> socket,id=channel7,path=/tmp/helloworld7,server,nowait -device
> virtserialport,nr=7,chardev=channel7,name=com.redhat.rhevm.vdsm7,bus=virtio-
> serial0.0,id=port7 -chardev
> socket,id=channel8,path=/tmp/helloworld8,server,nowait -device
> virtserialport,nr=8,chardev=channel8,name=com.redhat.rhevm.vdsm8,bus=virtio-
> serial0.0,id=port8 -chardev
> socket,id=channel9,path=/tmp/helloworld9,server,nowait -device
> virtserialport,nr=9,chardev=channel9,name=com.redhat.rhevm.vdsm9,bus=virtio-
> serial0.0,id=port9 -chardev
> socket,id=channel10,path=/tmp/helloworld10,server,nowait -device
> virtserialport,nr=10,chardev=channel10,name=com.redhat.rhevm.vdsm10,
> bus=virtio-serial0.0,id=port10 -chardev
> socket,id=channel11,path=/tmp/helloworld11,server,nowait -device
> virtserialport,nr=11,chardev=channel11,name=com.redhat.rhevm.vdsm11,
> bus=virtio-serial0.0,id=port11 -chardev
> socket,id=channel12,path=/tmp/helloworld12,server,nowait -device
> virtserialport,nr=12,chardev=channel12,name=com.redhat.rhevm.vdsm12,
> bus=virtio-serial0.0,id=port12 -chardev
> socket,id=channel13,path=/tmp/helloworld13,server,nowait -device
> virtserialport,nr=13,chardev=channel13,name=com.redhat.rhevm.vdsm13,
> bus=virtio-serial0.0,id=port13 -chardev
> socket,id=channel14,path=/tmp/helloworld14,server,nowait -device
> virtserialport,nr=14,chardev=channel14,name=com.redhat.rhevm.vdsm14,
> bus=virtio-serial0.0,id=port14 -chardev
> socket,id=channel15,path=/tmp/helloworld15,server,nowait -device
> virtserialport,nr=15,chardev=channel15,name=com.redhat.rhevm.vdsm15,
> bus=virtio-serial0.0,id=port15 -chardev
> socket,id=channel16,path=/tmp/helloworld16,server,nowait -device
> virtserialport,nr=16,chardev=channel16,name=com.redhat.rhevm.vdsm16,
> bus=virtio-serial0.0,id=port16 -chardev
> socket,id=channel17,path=/tmp/helloworld17,server,nowait -device
> virtserialport,nr=17,chardev=channel17,name=com.redhat.rhevm.vdsm17,
> bus=virtio-serial0.0,id=port17 -chardev
> socket,id=channel18,path=/tmp/helloworld18,server,nowait -device
> virtserialport,nr=18,chardev=channel18,name=com.redhat.rhevm.vdsm18,
> bus=virtio-serial0.0,id=port18 -chardev
> socket,id=channel19,path=/tmp/helloworld19,server,nowait -device
> virtserialport,nr=19,chardev=channel19,name=com.redhat.rhevm.vdsm19,
> bus=virtio-serial0.0,id=port19 -chardev
> socket,id=channel20,path=/tmp/helloworld20,server,nowait -device
> virtserialport,nr=20,chardev=channel20,name=com.redhat.rhevm.vdsm20,
> bus=virtio-serial0.0,id=port20 -chardev
> socket,id=channel21,path=/tmp/helloworld21,server,nowait -device
> virtserialport,nr=21,chardev=channel21,name=com.redhat.rhevm.vdsm21,
> bus=virtio-serial0.0,id=port21 -chardev
> socket,id=channel22,path=/tmp/helloworld22,server,nowait -device
> virtserialport,nr=22,chardev=channel22,name=com.redhat.rhevm.vdsm22,
> bus=virtio-serial0.0,id=port22 -chardev
> socket,id=channel23,path=/tmp/helloworld23,server,nowait -device
> virtserialport,nr=23,chardev=channel23,name=com.redhat.rhevm.vdsm23,
> bus=virtio-serial0.0,id=port23 -chardev
> socket,id=channel24,path=/tmp/helloworld24,server,nowait -device
> virtserialport,nr=24,chardev=channel24,name=com.redhat.rhevm.vdsm24,
> bus=virtio-serial0.0,id=port24 -chardev
> socket,id=channel25,path=/tmp/helloworld25,server,nowait -device
> virtserialport,nr=25,chardev=channel25,name=com.redhat.rhevm.vdsm25,
> bus=virtio-serial0.0,id=port25 -chardev
> socket,id=channel26,path=/tmp/helloworld26,server,nowait -device
> virtserialport,nr=26,chardev=channel26,name=com.redhat.rhevm.vdsm26,
> bus=virtio-serial0.0,id=port26 -chardev
> socket,id=channel27,path=/tmp/helloworld27,server,nowait -device
> virtserialport,nr=27,chardev=channel27,name=com.redhat.rhevm.vdsm27,
> bus=virtio-serial0.0,id=port27 -chardev
> socket,id=channel28,path=/tmp/helloworld28,server,nowait -device
> virtserialport,nr=28,chardev=channel28,name=com.redhat.rhevm.vdsm28,
> bus=virtio-serial0.0,id=port28 -chardev
> socket,id=channel29,path=/tmp/helloworld29,server,nowait -device
> virtserialport,nr=29,chardev=channel29,name=com.redhat.rhevm.vdsm29,
> bus=virtio-serial0.0,id=port29 -chardev
> socket,id=channel30,path=/tmp/helloworld30,server,nowait -device
> virtserialport,nr=30,chardev=channel30,name=com.redhat.rhevm.vdsm30,
> bus=virtio-serial0.0,id=port30

Comment 7 Amit Shah 2015-03-26 12:32:36 UTC
What is the file size you are transmitting?

Are you doing all transfers at the same time?

Can you isolate whether this is a guest or a host issue by using RHEL6 host and RHEL7 guest; and RHEL7 host and RHEL6 guest?

Comment 8 Sibiao Luo 2015-03-30 08:03:40 UTC
(In reply to Amit Shah from comment #7)
> What is the file size you are transmitting?
> 
please see comment #0, 2G.

>> 2.dd a file in guest and check the md5 for it.
>> # dd if=/dev/zero of=guest-file bs=1M count=2000
>> # md5sum guest-file 
>> a981130cf2b7e09f4686dc273cf7187e  guest-file

> Are you doing all transfers at the same time?
No, one transfer at one time.

> Can you isolate whether this is a guest or a host issue by using RHEL6 host
> and RHEL7 guest; and RHEL7 host and RHEL6 guest?

+-----------------------+--------------------------------------+
|    Host   |   Guest   |             Test Result              |
+-----------------------+--------------------------------------+
|  rhel6.7  |  rhel6.7  |The second port fail to work.         |
+-----------------------+--------------------------------------+
|  rhel6.7  |  rhel7.1  |The same, the second port fail to work|
+-----------------------+--------------------------------------+
|  rhel7.1  |  rhel6.7  |Work well, did not hit it.            |
+-----------------------+--------------------------------------+

Base on above testing result that it's the rhel6.7 host issue. Please correct me if any mistake, thanks.

Best Regards,
sluo

Comment 11 Amit Shah 2015-11-27 08:35:39 UTC
I tried this with qemu-kvm-0.12.1.2-2.481.el6, and didn't face this problem.  This is a werid problem to happen if it really is a bug: there's no special casing anywhere for any of the ports, and all read/writes happen using the same paths.  Chances are you must've had some process in the  guest writing to the port, causing the difference?

For the file that's different, can you compare the file sizes, and what data has been introduced in it?

Comment 12 juzhang 2015-11-27 09:27:23 UTC
Hi Chao,

Could you handle this issue?

Best Regards,
Junyi

Comment 13 Chao Yang 2015-11-27 10:20:53 UTC
Yanan,

Please give a try. Thanks.

Comment 14 Amit Shah 2015-11-28 04:35:58 UTC
BTW plesae use unique names for ports.  com.redhat.rhevm.vdsm1 etc. are standard names which get used by guest agents.  It's likely a guest agent sees such a port and writes to it, expecting to communicate with the host counterpart.

Please also use this opportunity to update the test plans to mention that we must always use unique test-specific port names so that such conflicts do not occur.

Comment 15 juzhang 2015-11-30 01:32:34 UTC
(In reply to Amit Shah from comment #14)
> BTW plesae use unique names for ports.  com.redhat.rhevm.vdsm1 etc. are
> standard names which get used by guest agents.  It's likely a guest agent
> sees such a port and writes to it, expecting to communicate with the host
> counterpart.
> 
> Please also use this opportunity to update the test plans to mention that we
> must always use unique test-specific port names so that such conflicts do
> not occur.

Got it and Thanks Amit.

Best Regards,
Junyi

Comment 16 Yanan Fu 2015-11-30 08:23:38 UTC
Reproduce this bug successfully.

host info: 
   qemu-kvm-0.12.1.2-2.481.el6
   kernel-2.6.32-573.10.2.el6.x86_64
guest info:
   kernel-2.6.32.431.el6.x86_64


   This bug is not only with the second port vport0p2. I think all the ports have this issue.(I test more than 10, all can reproduce.)

   The crucial for this bug is write to the same port twice and the second time will hit this error.
   
guest]# dd if=/dev/zero of=guest-file bs=1M count=2000
2000+0 records in
2000+0 records out
2097152000 bytes (2.1 GB) copied, 13.6291 s, 154 MB/s
guest]# md5sum guest-file 
f3444be3893c1b9b6fa9dd1acde671a9  guest-file

guest]# cat guest-file > /dev/vport0p2
host]# nc -U /tmp/helloworld1 > received-file1
^C             (after transmission finished )
host]# md5sum received-file1
f3444be3893c1b9b6fa9dd1acde671a9  received-file1-------->pass

guest]# cat guest-file > /dev/vport0p1
host]# nc -U /tmp/helloworld1 > received-file1
^C             (after transmission finished )
host]# md5sum received-file1
ab20cf6a8784710e53f83b6bb452127c  received-file1-------->fail

guest-file:    2097152000
received-file: 2092957696

copy guest-file to the host, and check with md5sum, there is no change, then:

host]# cmp guest-file received-file1
cmp: EOF on received-file1

I test with different ports,port 1 and port 12 write twice, port 15 write once.

cat guest-file > /dev/vport0p* 
nc -U /tmp/helloworld* > received-file*

result:
received-file1  :2092957696
received-file12 :2092957696
received-file15 :2097152000  ---> same with guest-file

# md5sum received-file12
ab20cf6a8784710e53f83b6bb452127c  received-file12 ---> fail,same with received-file1.

# md5sum received-file15
f3444be3893c1b9b6fa9dd1acde671a9  received-file15 ---> pass,same with guest-file.
 
#cmp received-file12 received-file1 --> no output,the two failed files are same.

#cmp guest-file received-file15 --> no output,received-file15 is same with guest

#cmp received-file15 received-file12
cmp: EOF on received-file12

As the test result above, if write to same port twice,will cause some data lose, and the lost data is same. If any mistake please feel free contact me, thanks.

Comment 17 Amit Shah 2015-11-30 12:38:55 UTC
Thanks for the new info.

So this doesn't happen because of max nr_ports; it's just because the host-side chardev is disconnected and reconnected, and this isn't recognised by qemu soon enough.  This results in qemu attempting to write to the previous socket, which is closed, and that data gets dropped.  When qemu realises the disconnect, it re-connects and then the data flows again, as expected.

To test this, you can do this: without closing the nc on the host, write the file from the guest two times, and check the host file size: it will be exactly twice the size of guest file.

There is another bug with this same reproducer: bug 702271 and all its duplicates.  We moved the bug to RHEL7 as it requires quite a few changes to qemu.  As noted in comment 8, this is indeed fixed in RHEL7.  We won't get to this in RHEL6, unfortunately.

Comment 18 Yanan Fu 2015-12-01 01:17:24 UTC
(In reply to Amit Shah from comment #17)
> Thanks for the new info.
> 
> So this doesn't happen because of max nr_ports; it's just because the
> host-side chardev is disconnected and reconnected, and this isn't recognised
> by qemu soon enough.  This results in qemu attempting to write to the
> previous socket, which is closed, and that data gets dropped.  When qemu
> realises the disconnect, it re-connects and then the data flows again, as
> expected.
> 
> To test this, you can do this: without closing the nc on the host, write the
> file from the guest two times, and check the host file size: it will be
> exactly twice the size of guest file.

Already confirmed, with out close the nc on the host, write the file from guest two times, and the host file size is exactly twice the size of guest file. write from guest three times, and the host file size is thrice the size of the guest file ...

> There is another bug with this same reproducer: bug 702271 and all its
> duplicates.  We moved the bug to RHEL7 as it requires quite a few changes to
> qemu.  As noted in comment 8, this is indeed fixed in RHEL7.  We won't get
> to this in RHEL6, unfortunately.

Comment 19 Amit Shah 2015-12-01 04:59:24 UTC
Thank you for confirming.