Bug 902150 - [virtio-win][serial]virtio-serial driver does not work after S3& s4
[virtio-win][serial]virtio-serial driver does not work after S3& s4
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virtio-win (Show other bugs)
6.5
Unspecified Unspecified
unspecified Severity high
: rc
: ---
Assigned To: Gal Hammer
Virtualization Bugs
:
: 902153 (view as bug list)
Depends On:
Blocks: 572483
  Show dependency treegraph
 
Reported: 2013-01-20 21:57 EST by dawu
Modified: 2013-12-06 02:15 EST (History)
9 users (show)

See Also:
Fixed In Version: virtio-win-prewhql-0.1-53
Doc Type: Bug Fix
Doc Text:
Cause: Virtio-serial doesn't work after resuming from S3/S4. Consequence: after resuming from S3/S4 vioserial device does not operate properly. Fix: Changes in device remove and device D0 state enter and exit logic. Result: With the fixes mentioned above, vioserial device can operate properly after resuming from S3/S4 state.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-21 19:00:49 EST
Type: Bug
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 dawu 2013-01-20 21:57:02 EST
Description of problem:
Guest failure in adding port  for device  virtio-serial  after resume from F4 during transferring data from guest to host

Version-Release number of selected component (if applicable):
kernel-2.6.32-351.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.351.el6.x86_64
virtio-win-prewhql-0.1-51

How reproducible:
100%

Steps to Reproduce:
1.Start guest with CLI:
   /usr/libexec/qemu-kvm -M rhel6.4.0 -m 2G -smp 2 -usb -device usb-tablet,id=tablet0 -drive file=win7-32.qcow2,if=none,id=drive-virtio0-0-0,format=qcow2,werror=stop,rerror=stop,cache=none -device ide-drive,drive=drive-virtio0-0-0,id=virti0-0-0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device rtl8139,netdev=hostnet0,id=net0,mac=00:12:10:94:a3:f8 -uuid 8677bf9b-3cf6-47a1-b3e9-94213b801c87  -monitor stdio -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=0 -vga std -device virtio-serial-pci,id=virtio-serial0,max_ports=16 -chardev socket,id=channel0,path=/tmp/helloworld,server,nowait -device virtserialport,chardev=channel0,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port0  -vnc :1

2.Transerring data from guest to host
eg: in the host : #python serial-host-receive.py /tmp/helloworld
    in the guest: #for ((;;))
                   do 
                   python  VirtIOChannel_guest_send.py com.redhat.rhevm.vdsm;
                   done      
3.Doing hibernate in the guest
4.Resuming guest by start guest CLI again.

Actual results:
Guest can resuming with error from qemu side and serial function fails to work.
  (qemu) qemu-kvm: virtio-serial-bus: Guest failure in adding port 1 for device virtio-serial0.0

Expected results: 
Guest should resume without any error,and serial function works well.

Additional info:
when reboot guest, all can work well.
Comment 2 Gal Hammer 2013-01-21 02:30:15 EST
Adding comment as a reminder: I'm not sure but I think a simpler scenario of device_del and device_add from qemu's monitor also reproduce this problem.
Comment 3 dawu 2013-01-21 02:38:53 EST
*** Bug 902153 has been marked as a duplicate of this bug. ***
Comment 4 Mike Cao 2013-01-21 02:41:55 EST
I think the key point of this bug is that " virtio-serial driver does not work after S3& s4"
Comment 5 Gal Hammer 2013-01-21 03:24:02 EST
(In reply to comment #4)
> I think the key point of this bug is that " virtio-serial driver does not
> work after S3& s4"

Like I wrote in c#2, I think that the problem is that the driver doesn't tell qemu the it re-created the device. So it doesn't related only to s3/s4, but to hot-plugging.
Comment 6 Mike Cao 2013-01-21 03:49:39 EST
(In reply to comment #5)
> (In reply to comment #4)
> > I think the key point of this bug is that " virtio-serial driver does not
> > work after S3& s4"
> 
> Like I wrote in c#2, I think that the problem is that the driver doesn't
> tell qemu the it re-created the device. So it doesn't related only to s3/s4,
> but to hot-plugging.

I tried serialport hotplug/unplug ,can not trigger this issue
So thsi bug is related to s3/s4.
Comment 7 Gal Hammer 2013-01-21 15:25:37 EST
(In reply to comment #6)

> I tried serialport hotplug/unplug ,can not trigger this issue
> So thsi bug is related to s3/s4.

You were right. It was not related to hot plug. I probably mixed the previous bug with the index mismatch error with this one.

A patch was posted.
Comment 9 langfang 2013-03-19 23:52:21 EDT
Test the fixed  version ,Not  hit the error info 
 
(qemu) qemu-kvm: virtio-serial-bus: Guest failure in adding port 1 for device virtio-serial0.0

But after S4 ,serial device can not work. Need to disable then enable serial driver for work.

HOst:
# uname -r
2.6.32-358.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.358.el6.x86_64

Guest :win2008-32

virtio-win-prewhql-0.1-55

steps:
1.Boot guest with serial device
Check serial device.
Transfer data from guest to host and host to guest work OK

2.Do s4 in guest
Choose "Hibernate"

3.Boot guest with same CLI

4.Transfer data from guest to host 

Results:

The serial device can not transfer data anymore ,need to disable then enable serial driver.



CLI:
/usr/libexec/qemu-kvm -name win2008 -M rhel6.4.0 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -uuid 6c547c60-1651-decf-cf03-edcb14a3642b -nodefconfig -nodefaults -monitor stdio -rtc base=localtime,driftfix=slew -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/home/win2008-32.raw,if=none,id=drive-ide0-0-0,format=raw,cache=none -device virtio-blk-pci,scsi=off,drive=drive-ide0-0-0,id=ide0-0-0,addr=0x3,bootindex=1 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,mac=00:10:20:2d:31:21,bus=pci.0,addr=0x6,id=net0 -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x7 -chardev socket,id=channel0,path=/tmp/serial-socket-1,server,nowait -device virtserialport,chardev=channel0,name=org.linux-kvm.port.1,bus=virtio-serial0.0,id=port1,nr=1 -chardev socket,id=channel1,path=/tmp/serial-socket-2,server,nowait -device virtserialport,chardev=channel1,name=org.linux-kvm.port.2,bus=virtio-serial0.0,id=port2 -device virtio-serial-pci,id=virtio-serial1,max_ports=16,bus=pci.0,addr=0x8 -chardev socket,id=channel2,path=/tmp/serial-socket-3,server,nowait -device virtserialport,chardev=channel2,name=org.linux-kvm.port.3,bus=virtio-serial1.0,id=port3,nr=1 -chardev null,id=channel3,path=/tmp/serial-socket-4,server,nowait -device virtserialport,chardev=channel3,name=org.linux-kvm.port.4,bus=virtio-serial1.0,id=port4 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -spice port=5830,disable-ticketing -vga qxl

Addtional info :do S3 hit same problem
Comment 10 Mike Cao 2013-03-20 03:01:40 EDT
According to comment #9 ,this issue does not fixed yet 
Re-assigned this issue
Comment 11 Gal Hammer 2013-04-03 01:18:32 EDT
My fault. I've fixed the original problem (qemu's complain about a "Guest failure in adding port...") and forgot to check that the port is also usable too.

A patch was posted.
Comment 13 dawu 2013-04-18 23:18:20 EDT
Verified this issue on the latest build virtio-win-prewhql-59 with the same steps in the comment #0:

CLI:
/usr/libexec/qemu-kvm -M rhel6.4.0 -m 2G -smp 2 -usb -device usb-tablet,id=tablet0 -drive file=win7-32.qcow2,if=none,id=drive-virtio0-0-0,format=qcow2,werror=stop,rerror=stop,cache=none -device ide-drive,drive=drive-virtio0-0-0,id=virti0-0-0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,id=net0,mac=00:12:10:94:a3:f8 -uuid 8677bf9b-3cf6-47a1-b3e9-94213b801c87  -monitor stdio -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=0 -vga cirrus -device virtio-serial-pci,id=virtio-serial0,max_ports=16 -chardev socket,id=channel0,path=/tmp/helloworld,server,nowait -device virtserialport,chardev=channel0,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port0  -vnc :1

Actual Results:
Guest can resume from S4/S3 without any issue.

Based on above this issue has been fixed.

Thanks!
Best Regards,
Dawn
Comment 14 Mike Cao 2013-04-19 01:08:49 EDT
Based on comment #13 ,move status to VERIFIED.
Comment 22 errata-xmlrpc 2013-11-21 19:00:49 EST
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.

http://rhn.redhat.com/errata/RHBA-2013-1729.html

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