Bug 681777

Summary: floppy I/O error after live migration while floppy in use
Product: Red Hat Enterprise Linux 6 Reporter: Mike Cao <bcao>
Component: qemu-kvmAssignee: jason wang <jasowang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.1CC: bcao, flang, juzhang, michen, mkenneth, quintela, syeghiay, tburke, virt-maint, xfu
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.157.el6 Doc Type: Bug Fix
Doc Text:
Cause: the media_changed flag were not save and restored during migration, bug in the floppy migration code. Consequence: Guest driver may always think the floppy drive were changed after migration, so after the migration, the floppy were unusable. Fix: Fix floppy migration code. Result: transfer file to floppy during migration would works well
Story Points: ---
Clone Of:
: 699370 (view as bug list) Environment:
Last Closed: 2011-05-19 11:26:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 699370    

Description Mike Cao 2011-03-03 08:33:14 UTC
Description of problem:
keep write date to floppy ,do live migration during the time .After migration competed ,floppy returns Input/output error

Version-Release number of selected component (if applicable):
# uname -r
2.6.32-118.el6.x86_64
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.148.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.start VM with floppy disk
eg:/usr/libexec/qemu-kvm -enable-kvm -m 4G -smp 4 -name rhel6U1 -uuid adcbfb49-3411-1701-3c36-6bdbc00bedb9 -rtc base=utc,clock=host,driftfix=slew -boot c -drive file=/dev/mike/RHEL6U1_backup,if=none,id=mike_d1,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,drive=mike_d1,id=mike_d1 -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=a2:54:50:a4:c2:c1 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc :2 -device virtio-balloon-pci,id=ballooning -monitor stdio -drive file=/mnt/virtio-win_mike.vfd,if=none,id=f1,format=raw,cache=none -global isa-fdc.driveA=f1
2.in the guest ,open the floppy in gnome .Write data on the floppy 
for((;;))
do 
  echo hello > /media/disk/file
  rm -rf /media/disk/file
  echo "good"
done
3.do live migration
(qemu) migrate -d tcp:t1:5888
  
Actual results:
After migration ,the floppy returns I/O error,can not write date to floppy.
#demsg
floppy0: disk absent or changed during operation
end_request: I/O error, dev fd0, sector 2
floppy0: disk absent or changed during operation
end_request: I/O error, dev fd0, sector 16
EXT4-fs error (device fd0): ext4_read_block_bitmap: Cannot read block bitmap - block_group = 0, block_bitmap = 8
EXT4-fs (fd0): previous I/O error to superblock detected
floppy0: disk absent or changed during operation
end_request: I/O error, dev fd0, sector 2
EXT4-fs (fd0): previous I/O error to superblock detected
floppy0: disk absent or changed during operation
end_request: I/O error, dev fd0, sector 2
__ratelimit: 2658 callbacks suppressed
Buffer I/O error on device fd0, logical block 1
lost page write due to I/O error on fd0
floppy0: disk absent or changed during operation
end_request: I/O error, dev fd0, sector 82
Buffer I/O error on device fd0, logical block 41
lost page write due to I/O error on fd0

Expected results:
the scripts still works to write data on floppy.

Additional info:

Comment 12 Mike Cao 2011-04-13 09:19:55 UTC
Reproduced on qemu-kvm-0.12.1.2-2.135.el6
Verified on qemu-kvm-0.12.1.2-2.158.el6 with the steps on comment #0

Actual Results:
After migration,the scripts still works

Based on above ,this issue has been fixed ald.

Comment 13 FuXiangChun 2011-04-14 10:55:18 UTC
this issue have been fixed on windows2008r2.
verify steps and version info:
1.
/usr/libexec/qemu-kvm -m 6G -smp 1 -drive file=/mnt/2008r2-des.raw,media=disk,if=none,id=drive-virtio0-0-0,format=raw,werror=stop,rerror=stop,cache=none -device ide-drive,drive=drive-virtio0-0-0,id=virti0-0-0 -netdev tap,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:94:a3:8b -uuid 9e6f04cf-2ad7-45aa-9333-2d2ee26570c6  -boot c -monitor stdio -spice id=on,disable-ticketing,port=5911 -vga qxl -device virtio-balloon-pci,id=balloon1 -drive file=/mnt/virtio-win-1.1.16.vfd,if=none,id=f1,format=raw,cache=none -global isa-fdc.driveA=f1

2.rpm -qa|grep kvm
qemu-kvm-0.12.1.2-2.158.el6.x86_64

3. after migration,loop script still can write date on floppy.

4. @echo off
   :for1
    for /l %%i in (1 2 3) do (
    echo "test">A:\test1
    del A:\test1
    )
    goto for1

Comment 14 Mike Cao 2011-04-14 11:04:23 UTC
based on comment #12 &comment #13 ,move staus to VERIFIED.

Comment 15 jason wang 2011-05-05 09:47:17 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: the media_changed flag were not save and restored during migration, bug in the floppy migration code.

Consequence: Guest driver may always think the floppy drive were changed after migration, so after the migration, the floppy were unusable.

Fix: Fix floppy migration code.

Result: transfer file to floppy during migration would works well

Comment 16 errata-xmlrpc 2011-05-19 11:26:25 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html

Comment 17 errata-xmlrpc 2011-05-19 13:01:53 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html

Comment 18 Mike Cao 2011-09-21 11:14:43 UTC
Hi ,Jason

Since we support migration between RHEL6.0.0 host and RHEL6.2.0 host 
I think we need to backport this patch to rhel6.0.z .
What's your opinion ?

Comment 19 jason wang 2012-08-03 05:09:24 UTC
Hi Mike:

This patch is functionally reverted in 6.1. I don't know the current status of the fixing for this in either RHEL6 or upstream. I think maybe you can ask Kevin or Markus for this.

Thanks