Bug 1152830 - Fix sense buffer in virtio-scsi LUN passthrough
Summary: Fix sense buffer in virtio-scsi LUN passthrough
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Fam Zheng
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-15 03:26 UTC by tingting zheng
Modified: 2015-03-05 09:56 UTC (History)
20 users (show)

Fixed In Version: qemu-kvm-rhev-2.1.2-6.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 09:56:31 UTC


Attachments (Terms of Use)
guest xml file (4.87 KB, text/plain)
2014-10-15 03:27 UTC, tingting zheng
no flags Details
sceenshot of failure to install virtio scsi lun guest (37.58 KB, image/png)
2014-10-15 03:28 UTC, tingting zheng
no flags Details
sceenshot of virtio scsi lun guest failure (17.54 KB, image/png)
2014-11-03 02:56 UTC, tingting zheng
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0624 normal SHIPPED_LIVE Important: qemu-kvm-rhev security, bug fix, and enhancement update 2015-03-05 14:37:36 UTC

Description tingting zheng 2014-10-15 03:26:25 UTC
Description
Fail to install guest with virtio scsi lun disk from virt-manager

Version:
libvirt-1.2.8-5.el7.x86_64
virt-manager-1.1.0-4.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1.From virt-manager GUI,create a new guest,follow the step until step 5,choose "customize configuration before install".

2.Remove the default disk,add hardware,storage->Select managed or other existing disk,set as "dev/sdb"->Bus type,set as "Virtio SCSI"->Device type,set as "LUN device"->begin install.

3.After the installation begins,during format disk,error shows as the screenshot.

4.Sdb on my host is a usb disk.
Disk /dev/sdb: 16.0 GB, 16022241280 bytes, 31293440 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00095330

   Device Boot      Start         End      Blocks   Id  System

Actual results:
Fail to install guest with virtio scsi lun disk from virt-manager

Expected results:
guest with virtio scsi lun disk can be installed successfully from virt-manager

Additional info:
1.I can use the same usb to install guest with virtio scsi lun disk on rhel6.
On rhel6,xml shows as:
    <disk type='block' device='lun'>
      <driver name='qemu' type='raw' cache='none'/>
      <source dev='/dev/sdb'/>
      <target dev='sda' bus='scsi'/>
      <alias name='scsi0-0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

    <controller type='scsi' index='0'>
      <alias name='scsi0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>

On rhel7,xml shows as:
    <disk type='block' device='lun'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/sdc'/>
      <backingStore/>
      <target dev='sda' bus='scsi'/>
      <alias name='scsi0-0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

    <controller type='scsi' index='0' model='virtio-scsi'>
      <alias name='scsi0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>

2.Attached the xml of the guest.
3.If I use physcial disk eg:second hard disk on my host,no disk will show during disk format steps of installation.

Comment 2 tingting zheng 2014-10-15 03:27:06 UTC
Created attachment 947083 [details]
guest xml file

Comment 3 tingting zheng 2014-10-15 03:28:05 UTC
Created attachment 947084 [details]
sceenshot of failure to install virtio scsi lun guest

Comment 4 Giuseppe Scrivano 2014-10-15 09:33:36 UTC
the XML configuration generated by virt-manager looks similar on RHEL-6 (where works) and RHEL-7 (where it doesn't) so the problem should be somewhere else and I am re-assigning it to libvirt for further probing.  Could you please attach the qemu command line you get both on RHEL-6 and RHEL-7?

Comment 5 tingting zheng 2014-10-15 10:33:19 UTC
(In reply to Giuseppe Scrivano from comment #4)
> the XML configuration generated by virt-manager looks similar on RHEL-6
> (where works) and RHEL-7 (where it doesn't) so the problem should be
> somewhere else and I am re-assigning it to libvirt for further probing. 
> Could you please attach the qemu command line you get both on RHEL-6 and
> RHEL-7?

On rhel7,qemu-kvm command line:
# ps -ef |grep qemu
qemu      4086     1  0 Oct14 ?        00:14:47 /usr/libexec/qemu-kvm -name virtio-scsi-lun -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu Penryn -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid e00a07fa-9ac6-4683-ae26-bd2a5e272f6a -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/virtio-scsi-lun.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-reboot -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -kernel /var/lib/libvirt/boot/virtinst-vmlinuz.i8Tv2R -initrd /var/lib/libvirt/boot/virtinst-initrd.img.NUSkNT -append method=http://download.englab.nay.redhat.com/pub/rhel/rel-eng/latest-RHEL-6/6.6/Server/x86_64/os/ -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x6 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x7 -drive file=/dev/sdb,if=none,id=drive-scsi0-0-0-0,format=raw -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 -netdev tap,fd=23,id=hostnet0,vhost=on,vhostfd=24 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:2c:77:75,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1 -chardev spicevmc,id=charredir2,name=usbredir -device usb-redir,chardev=charredir2,id=redir2 -chardev spicevmc,id=charredir3,name=usbredir -device usb-redir,chardev=charredir3,id=redir3 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -msg timestamp=on
root      7079  7045  0 05:36 pts/0    00:00:00 grep --color=auto qemu


On rhel 6,qemu-kvm command line:
# ps -ef |grep virtio-scsi-lun
qemu      4063     1  9 06:31 ?        00:00:03 /usr/libexec/qemu-kvm -name virtio-scsi-lun -S -M rhel6.6.0 -cpu Penryn -enable-kvm -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 1807e389-4840-5507-225a-7c1afde4db15 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/virtio-scsi-lun.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x7 -drive file=/dev/sdb,if=none,id=drive-scsi0-0-0-0,format=raw,cache=none -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 -netdev tap,fd=24,id=hostnet0,vhost=on,vhostfd=28 -device virtio-net-pci,__com_redhat_macvtap_compat=on,netdev=hostnet0,id=net0,mac=52:54:00:8f:ff:ac,bus=pci.0,addr=0x3,bootindex=1 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -vnc 127.0.0.1:3 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -incoming fd:22 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -msg timestamp=on
root      4132  3973  0 06:32 pts/0    00:00:00 grep virtio-scsi-lun

Comment 6 Martin Kletzander 2014-10-20 09:44:56 UTC
The only differences (related to the disk) I see between those two commands are bootindex=1 and cache=none.  None of these is related to the error, so the problem is either in qemu or in the hardware itself.  I'm re-assigning to qemu (since libvirt does what it should), in the meantime please make sure it is not in the hardware, and also try modifying the cache= parameter (can be changed with virt-manager in Advanced options -> Performance options -> Cache mode) and see whether that helps.

Comment 7 Fam Zheng 2014-10-27 06:57:05 UTC
I cannot reproduce this, both my SSD and usb disk passed to RHEL 7 installation are recognized.

Packages I'm using:

$ rpm -qa  | grep -e qemu-kvm -e libvirt-1.2.8 -e virt-manager
virt-manager-common-1.1.0-4.el7.noarch
qemu-kvm-1.5.3-76.el7.x86_64
qemu-kvm-common-1.5.3-76.el7.x86_64
virt-manager-1.1.0-4.el7.noarch
libvirt-1.2.8-5.el7.x86_64

In the dracut shell, with “dmesg", do you see any virtio lines?

With a different guest (RHEL 7, Fedora or Windows), can you see the device in the guest?

Alternatively, maybe you could give me access to a guest to debug it.

Fam

Comment 8 tingting zheng 2014-10-27 08:12:18 UTC
(In reply to Fam Zheng from comment #7)
> I cannot reproduce this, both my SSD and usb disk passed to RHEL 7
> installation are recognized.
> 
> Packages I'm using:
> 
> $ rpm -qa  | grep -e qemu-kvm -e libvirt-1.2.8 -e virt-manager
> virt-manager-common-1.1.0-4.el7.noarch
> qemu-kvm-1.5.3-76.el7.x86_64
> qemu-kvm-common-1.5.3-76.el7.x86_64
> virt-manager-1.1.0-4.el7.noarch
> libvirt-1.2.8-5.el7.x86_64
> 

My version is:
qemu-kvm-rhev-2.1.2-3.el7.x86_64
libvirt-1.2.8-5.el7.x86_64
virt-manager-1.1.0-4.el7.noarch

> In the dracut shell, with “dmesg", do you see any virtio lines?
> 
> With a different guest (RHEL 7, Fedora or Windows), can you see the device
> in the guest?

If I attach the disk to an already existed guest,I can see the device.

> Alternatively, maybe you could give me access to a guest to debug it.
Okay,I will send you the machine info by xchat.

Comment 9 Fam Zheng 2014-10-28 03:15:48 UTC
Reproduced with qemu-kvm-rhev-2.1.2-3. If I add cache=none, the issue is gone.

With default cache mode, scsi-block handles requests in the same way as scsi-disk. I haven't looked into qemu-kvm-rhev code yet, although qemu-kvm on RHEL seems to work.

A easy fix is to force cache=none for scsi-block devices in virt-manager. Giuseppe, what's your opinion?

Thanks,
Fam

Comment 10 Giuseppe Scrivano 2014-10-28 08:12:23 UTC
I cancel the NEEDINFO as Fam and I had a discussion and he will check it out with Paolo about adding the needed control in scsi-block emulation code.

Comment 12 Paolo Bonzini 2014-10-29 14:20:30 UTC
We should do both.

Comment 13 Fam Zheng 2014-10-30 10:20:55 UTC
Thanks to Paolo's help with debugging, cause of this problem is found:

1. Cache is by default enabled, which means QEMU will use ioctl SG_IO to do all the read/write.

2. Buggy USB key firmware, that responds to READ CAPACITY(16) with a bogus large size (>2T). In this case guest will use READ(16) and WRITE(16) and that's passed on to host device with SG_IO, which is not supported by the device, hence IO error returned to guest.

There is nothing we can do with 2.

To fix issue 1, as said in comment 0, since we used cache=none in RHEL 6, we should continue to do it independently. So changing the assignee, summary and component.

In general, we should discourage any other cache mode than "none" for passthrough devices. Also, we should encourage usb passthrough or use the emulated scsi-disk instead of using scsi-block.

Fam

Comment 14 Martin Kletzander 2014-10-31 13:25:21 UTC
This cannot be dealt with in virt-manager, because that would mean it needs to be dealt with in *all* management applications that deal with libvirt and qemu and that doesn't make sense.

It could be forbidden in libvirt, but that would still require the same action to be taken in all applications using qemu, not just libvirt (although that's definitely a smaller number than the previous option).

If I understand it correctly, this is very rare corner case where you have to have a Buggy USB flash drive, right?  If that's true then close it as a WONTFIX.  If I misunderstood that and it should be disabled in more cases then just buggy HW (or FW), then either a) report error in precise circumstance when it is unsafe to use cache= other than none or b) error out in qemu when virtio-scsi-lun has cache=none and we might duplicate that in libvirt when starting qemu.  But any other solution than these three mentioned here don't make sense IMHO.

Or is there something we're missing?

Comment 15 Fam Zheng 2014-11-03 01:04:34 UTC
OK. Closing as WONTFIX sounds fine for me if virt-manager intends to drop cache='none' by default in RHEL 7 compared to RHEL 6.

Comment 16 tingting zheng 2014-11-03 02:53:40 UTC
(In reply to Martin Kletzander from comment #14)
> This cannot be dealt with in virt-manager, because that would mean it needs
> to be dealt with in *all* management applications that deal with libvirt and
> qemu and that doesn't make sense.
> 
> It could be forbidden in libvirt, but that would still require the same
> action to be taken in all applications using qemu, not just libvirt
> (although that's definitely a smaller number than the previous option).
> 
> If I understand it correctly, this is very rare corner case where you have
> to have a Buggy USB flash drive, right?  If that's true then close it as a
> WONTFIX.  If I misunderstood that and it should be disabled in more cases
> then just buggy HW (or FW), then either a) report error in precise
> circumstance when it is unsafe to use cache= other than none or b) error out
> in qemu when virtio-scsi-lun has cache=none and we might duplicate that in
> libvirt when starting qemu.  But any other solution than these three
> mentioned here don't make sense IMHO.

I've tried several usb disks with at least 3 hosts,the same error shows.

> Or is there something we're missing?

Also tested using virt-manager GUI to install guest with virtio scsi lun disk but use physcial block disk eg:sdc,it fails with no usable disks have been found,I'll attach the screeshot.
Guest xml disk part shows as:
    <disk type='block' device='lun'>
      <driver name='qemu' type='raw'/>
      <source dev='/dev/sdc'/>
      <backingStore/>
      <target dev='sda' bus='scsi'/>
      <alias name='scsi0-0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

Since there is virtio scsi lun disk showed from virt-manager GUI,I think guests with this type of disk(both usb disk and physical disk) should be installed successfully.

Comment 17 tingting zheng 2014-11-03 02:56:35 UTC
Created attachment 952978 [details]
sceenshot of virtio scsi lun guest failure

Comment 18 Fam Zheng 2014-11-03 02:59:57 UTC
Just to be sure that we see the same issue, could you paste the output of

   # sg_readcap --16 /dev/sdX

and 
   # sg_readcap /dev/sdX

of your usb disk(s)?

Fam

Comment 19 tingting zheng 2014-11-03 03:13:59 UTC
(In reply to Fam Zheng from comment #18)
> Just to be sure that we see the same issue, could you paste the output of
> 
>    # sg_readcap --16 /dev/sdX
> 
> and 
>    # sg_readcap /dev/sdX
> 
> of your usb disk(s)?

# sg_readcap --16 /dev/sdi
READ CAPACITY (16) not supported

# sg_readcap /dev/sdi
Read Capacity results:
   Last logical block address=31293439 (0x1dd7fff), Number of blocks=31293440
   Logical block length=512 bytes
Hence:
   Device size: 16022241280 bytes, 15280.0 MiB, 16.02 GB

Comment 20 Fam Zheng 2014-11-03 08:50:05 UTC
Actually there is a bug in QEMU. This is the candidate to fix the problem in qemu.git:

commit b7890c40e557f4733b6fcd1eb79af79b70dc8c05
Author: Ting Wang <kathy.wangting@huawei.com>
Date:   Mon Oct 27 16:51:41 2014 +0800

    virtio-scsi: sense in virtio_scsi_command_complete
    
    If req->resp.cmd.status is not GOOD, the address of sense for
    qemu_iovec_from_buf should be modified from &req->resp to sense.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Ting Wang <kathy.wangting@huawei.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


Tingting, could you give a try to the below scratch build of qemu-kvm-rhev which has the mentioned patch?

Thanks,
Fam

Comment 22 tingting zheng 2014-11-04 05:33:00 UTC
(In reply to Fam Zheng from comment #20)
> Actually there is a bug in QEMU. This is the candidate to fix the problem in
> qemu.git:
> 
> commit b7890c40e557f4733b6fcd1eb79af79b70dc8c05
> Author: Ting Wang <kathy.wangting@huawei.com>
> Date:   Mon Oct 27 16:51:41 2014 +0800
> 
>     virtio-scsi: sense in virtio_scsi_command_complete
>     
>     If req->resp.cmd.status is not GOOD, the address of sense for
>     qemu_iovec_from_buf should be modified from &req->resp to sense.
>     
>     Cc: qemu-stable@nongnu.org
>     Signed-off-by: Ting Wang <kathy.wangting@huawei.com>
>     Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> 
> Tingting, could you give a try to the below scratch build of qemu-kvm-rhev
> which has the mentioned patch?

I've tried the scratch build of qemu-kvm-rhev:
For physical disk,guest can be installed without disk error.
For usb disk,choose replace existing system,another error info shows:"Can't initialize physical volume "dev/sda2" of volume group "VolGroup" without -ff".

Comment 24 Miroslav Rezanina 2014-11-04 09:35:45 UTC
Fix included in qemu-kvm-rhev-2.1.2-6.el7

Comment 26 Sibiao Luo 2014-11-11 09:24:14 UTC
Reproduce this issue.

host info:
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.2-5.el7.x86_64

1.insert a USB stick to host.
2.passthrough this usb stick to KVM guest.
e.g:...-drive file=/dev/sdc,if=none,id=drive-usb-disk,aio=native -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x6 -device scsi-block,bus=scsi0.0,drive=drive-usb-disk,id=usb-disk
3.check the passthrough usb stick work well in guest.
# lsblk
# fdisk -l | grep /dev/sd*
# dmesg

Result:
after step 3,
# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sdb      8:16   0   32G  0 disk 
└─sdb1   8:17   0 29.5G  0 part /
# fdisk -l | grep /dev/sd*
Binary file /dev/sdb matches
Binary file /dev/sdb1 matches
# dmesg | grep " sd 2:0:0:0"
[    0.869938] sd 2:0:0:0: device reset
[    0.869995] sd 2:0:0:0: Device offlined - not ready after error recovery
[    0.871555] sd 2:0:0:0: rejecting I/O to offline device
[    0.871558] sd 2:0:0:0: rejecting I/O to offline device
[    0.871561] sd 2:0:0:0: rejecting I/O to offline device
[    0.871563] sd 2:0:0:0: rejecting I/O to offline device
[    0.871564] sd 2:0:0:0: [sda] READ CAPACITY(16) failed
[    0.871565] sd 2:0:0:0: [sda]  
[    0.871567] sd 2:0:0:0: [sda] Sense not available.
[    0.871568] sd 2:0:0:0: rejecting I/O to offline device
[    0.871569] sd 2:0:0:0: rejecting I/O to offline device
[    0.871571] sd 2:0:0:0: rejecting I/O to offline device
[    0.871573] sd 2:0:0:0: [sda] READ CAPACITY failed
[    0.871574] sd 2:0:0:0: [sda]  
[    0.871575] sd 2:0:0:0: [sda] Sense not available.
[    0.871576] sd 2:0:0:0: rejecting I/O to offline device
[    0.871578] sd 2:0:0:0: rejecting I/O to offline device
[    0.871580] sd 2:0:0:0: rejecting I/O to offline device
[    0.871581] sd 2:0:0:0: [sda] Write Protect is off
[    0.871582] sd 2:0:0:0: [sda] Mode Sense: 00 00 00 00
[    0.871584] sd 2:0:0:0: rejecting I/O to offline device
[    0.871586] sd 2:0:0:0: [sda] Asking for cache data failed
[    0.871587] sd 2:0:0:0: [sda] Assuming drive cache: write through
[    0.871588] sd 2:0:0:0: rejecting I/O to offline device
[    0.871589] sd 2:0:0:0: rejecting I/O to offline device
[    0.871592] sd 2:0:0:0: rejecting I/O to offline device
[    0.885132] sd 2:0:0:0: [sda] Attached SCSI disk

##################################################

Verified this issue.
host info:
# rpm -q qemu-kvm-rhev
qemu-kvm-rhev-2.1.2-7.el7.x86_64

Result:
# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0      2:0    1     4K  0 disk 
sda      8:0    0 119.2G  0 disk 
├─sda1   8:1    0    20G  0 part 
└─sda2   8:2    0    20G  0 part 
sdb      8:16   0    32G  0 disk 
└─sdb1   8:17   0  29.5G  0 part /

# fdisk -l | grep /dev/sd
[  345.519068] end_request: I/O error, dev fd0, sector 0
Disk /dev/sda: 128.0 GB, 128035676160 bytes, 250069680 sectors
/dev/sda1            2048    41945087    20971520   83  Linux
/dev/sda2        41945088    83888127    20971520   83  Linux
Disk /dev/sdb: 34.4 GB, 34359738368 bytes, 67108864 sectors
/dev/sdb1   *        2048    61890559    30944256   83  Linux

# dmesg | grep " sd "   
[    0.710739] sd 0:0:0:0: [sda] 250069680 512-byte logical blocks: (128 GB/119 GiB)
[    0.711338] sd 0:0:0:0: [sda] Write Protect is off
[    0.711339] sd 0:0:0:0: [sda] Mode Sense: 37 00 00 08
[    0.711445] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.714466] sd 0:0:0:0: [sda] Attached SCSI disk
[    0.906217] sd 1:0:0:0: [sdb] 67108864 512-byte logical blocks: (34.3 GB/32.0 GiB)
[    0.906871] sd 1:0:0:0: [sdb] Write Protect is off
[    0.907253] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[    0.907668] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.909343] sd 1:0:0:0: [sdb] Attached SCSI disk

Base on above, this issue has been fixed correctly, move to VERIFIED status. Please correctly me if any mistake, thanks for famz's kindly helps.

Best Regards,
sluo

Comment 27 Sibiao Luo 2014-11-11 09:26:57 UTC
(In reply to Sibiao Luo from comment #26)
> 1.insert a USB stick to host.
> 2.passthrough this usb stick to KVM guest.
Forgot to high light the key to this issue that we should not specify 'cache' in command line at all to reproduce it.
> e.g:...-drive file=/dev/sdc,if=none,id=drive-usb-disk,aio=native -device
> virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x6 -device
> scsi-block,bus=scsi0.0,drive=drive-usb-disk,id=usb-disk
> 3.check the passthrough usb stick work well in guest.
> # lsblk
> # fdisk -l | grep /dev/sd*
> # dmesg

Comment 29 errata-xmlrpc 2015-03-05 09:56:31 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.

https://rhn.redhat.com/errata/RHSA-2015-0624.html


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