Bug 849657

Summary: scsi devices see an unit attention condition on migration
Product: Red Hat Enterprise Linux 6 Reporter: Gerd Hoffmann <kraxel>
Component: qemu-kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: acathrow, areis, bsarathy, chayang, dyasny, juzhang, mkenneth, qzhang, shuang, sluo, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.320.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:38:37 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 Gerd Hoffmann 2012-08-20 13:43:03 UTC
Description of problem:
All scsi devices are affected.
Most visible with removable scsi disks (or usb sticks) as linux guests will rescan the partition table then.

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.303 (+ usb live migration patch series)

How reproducible:
100%

Steps to Reproduce:
1. boot guest with -device usb-storage,drive=$something,removable=on.
   [ virtio-scsi + scsi-hd should shoow this too ]
2. migrate guest.
  
Actual results:
Guest revalidates disk (linux kernel logs a line listing the partitions on disk).

Expected results:
Guest doesn't notice it got migrated.

Additional info:
triggered by drives_reopen()

Comment 2 Gerd Hoffmann 2012-08-20 14:26:14 UTC
patches posted.

Comment 7 Sibiao Luo 2012-10-12 08:21:16 UTC
(In reply to comment #0)
> Description of problem:
> All scsi devices are affected.
> Most visible with removable scsi disks (or usb sticks) as linux guests will
> rescan the partition table then.
> 
> Version-Release number of selected component (if applicable):
> qemu-kvm-0.12.1.2-2.303 (+ usb live migration patch series)
> 
> 
> Steps to Reproduce:
> 1. boot guest with -device usb-storage,drive=$something,removable=on.
>    [ virtio-scsi + scsi-hd should shoow this too ]
> 2. migrate guest.
>   
> Actual results:
> Guest revalidates disk (linux kernel logs a line listing the partitions on
> disk).
> 

hi Gerd,

   I tried to reproduce this issue with your indication, but get nothing from guest dmesg, the linux guests didnot rescan the partition table. Gerd, could you help me check my steps and show me details or give some tips. thx.

host info:
# uname -r && rpm -q qemu-kvm
2.6.32-325.el6.x86_64
qemu-kvm-0.12.1.2-2.320.el6.x86_64
guest info:
rhel6.3 GA 64bit.

Steps:
1.boot a guest in src with -device usb-storage,drive=$something,removable=on.
eg: ...-drive file=/mnt/usb-storage,if=none,id=storage,media=disk,cache=none,format=qcow2 -device usb-storage,drive=storage,removable=on,id=usb-storage
2.# dmesg -c in guest.
3.do migrate from src to dest.
4.# dmesg in guest.

Results:
I got nothing from kernel logs. 
I tried to format the disk, but no effects. 
I also tried the virtio-scsi + scsi-hd, it also got nothing from kernel log.

Thanks.
sluo

Comment 8 Gerd Hoffmann 2012-10-12 08:45:16 UTC
I've seens this with a Fedora 17 guest, maybe RHEL-6.3 behaves in a different way.

Comment 9 Sibiao Luo 2012-10-12 08:49:19 UTC
(In reply to comment #8)
> I've seens this with a Fedora 17 guest, maybe RHEL-6.3 behaves in a
> different way.

Ok, I will try fedora 17 guest, thanks for your reminds.

Comment 10 Sibiao Luo 2012-10-12 11:43:27 UTC
(In reply to comment #8)
> I've seens this with a Fedora 17 guest, maybe RHEL-6.3 behaves in a
> different way.



I have tried the Fedora 17 64bit guest with the same steps as comment #7 using virtio-scsi + scsi-hd, it still fail to reproduce, got nothing from kernel log.

btw, I use the '-device usb-storage,drive=$something,removable=on' with the Fedora 17 64bit guest, it fail to migrate. I donot know whether is a new bug, how about your opinion ?
(qemu) migrate -d tcp:$ip_addr:$port
state blocked by non-migratable device '0000:00:01.2/2.1/usb-storage'

host info:
# uname -r && rpm -q qemu-kvm
2.6.32-325.el6.x86_64
qemu-kvm-0.12.1.2-2.310.el6.x86_64

My cli:
# /usr/libexec/qemu-kvm -M rhel6.3.0 -enable-kvm -m 4096 -smp 2,sockets=2,cores=1,threads=1 -usb -device usb-tablet,id=input0 -name sluo_test -uuid `uuidgen` -drive file=/mnt/Fedora-17-x86_64.qcow2,format=qcow2,if=none,id=drive-disk,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-disk,id=scsi_image,bootindex=1 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,id=virtio-net-pci0,mac=05:1a:4a:02:0b:11,bus=pci.0,bootindex=3 -device virtio-balloon-pci,id=balloon0,bus=pci.0 -serial unix:/tmp/ttyS0,server,nowait -vnc :1 -boot menu=on -monitor stdio -drive file=/mnt/usb-storage,if=none,id=storage,media=disk,cache=none,format=qcow2 -device usb-storage,drive=storage,removable=on,id=usb-storage

Gerd, could you help me see it and give some tips. thx.

Comment 11 Gerd Hoffmann 2012-10-12 12:20:18 UTC
RHEL-6.3 GA doesn't support live migration with usb-storage.

usb-storage (and ehci) live migration was added in qemu-kvm-0.12.1.2-2.312.el6
this bug was fixed in qemu-kvm-0.12.1.2-2.314.el6

So with qemu-kvm-0.12.1.2-2.312.el6 and qemu-kvm-0.12.1.2-2.313.el6 you should see the broken behavior.

Comment 12 Sibiao Luo 2012-10-15 02:45:44 UTC
Reproduce this issue on Fedora 17 64bit guest with the same steps as comment #0 using usb live migration, linux guests will rescan the partition table which we can got from kernel log.

Host info:
# uname -r && rpm -q qemu-kvm
2.6.32-325.el6.x86_64
qemu-kvm-0.12.1.2-2.313.el6.x86_64
Guest info:
Fedora 17 64bit

Steps to Reproduce:
1.boot a guest in src with -device usb-storage,drive=$something,removable=on.
eg:...-boot menu=on -monitor stdio -readconfig /mnt/ich9-ehci-uhci.cfg -drive file=/mnt/usb-storage,if=none,id=storage,media=disk,cache=none,format=qcow2 -device usb-storage,drive=storage,removable=on,id=usb-storage
2.# dmesg -c in guest.
3.do migrate from src to dest.
4.# dmesg in guest.

Results of reproduce:
after steps 4, after live migrate, got log form guest kernel,
# dmesg 
[   90.109415] hrtimer: interrupt took 2999909 ns
[  108.667213]  sda: unknown partition table

Verify this issue with the same steps as reproduce.
host info:
# uname -r && rpm -q qemu-kvm
2.6.32-328.el6.x86_64
qemu-kvm-0.12.1.2-2.320.el6.x86_64
Guest info:
Fedora 17 64bit

Results of verify:
got nothing for guest kernel, did not see the broken behavior. so, the linux guests do not need to rescan the partition table.

Base on above, this issue has been fixed correctly.

Best Regards.
sluo

Comment 14 errata-xmlrpc 2013-02-21 07:38:37 UTC
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-0527.html