Bug 1854271 - When using '-device usb-storage', hit 'blk_update_request: I/O error' is encountered on the guest.
Summary: When using '-device usb-storage', hit 'blk_update_request: I/O error' is enco...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.3
Hardware: Unspecified
OS: Linux
high
medium
Target Milestone: rc
: 8.3
Assignee: Gerd Hoffmann
QA Contact: yduan
URL:
Whiteboard:
: 1856686 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-07 02:54 UTC by Zhenyu Zhang
Modified: 2021-01-20 06:42 UTC (History)
16 users (show)

Fixed In Version: qemu-kvm-5.1.0-6.module+el8.3.0+8041+42ff16b8.x86_64.
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-01-08 16:30:47 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
dmesg_x86 (52.38 KB, text/plain)
2020-07-08 10:17 UTC, yduan
no flags Details

Description Zhenyu Zhang 2020-07-07 02:54:49 UTC
Description of problem:
When I use '-device usb-storage', the following error is encountered in the guest:
[   14.070220] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[   14.289877] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[   14.321040] sd 0:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=1s
[   14.322517] sd 0:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 03 1f 80 00 00 78 00
[   14.323272] blk_update_request: I/O error, dev sdb, sector 204672 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[   14.470229] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd

Version-Release number of selected component (if applicable):
Host Distro: RHEL-8.3.0-20200704.n.0 BaseOS ppc64le  
Host Kernel: 4.18.0-221.el8.ppc64le
Qemu-kvm: qemu-kvm-5.0.0-0.scrmod+el8.3.0+7241+ccee766e.wrb200701
SLOF: SLOF-20200327-1.git8e012d6f.scrmod+el8.3.0+7241+ccee766e.noarch
Guest Kernel: 4.18.0-221.el8.ppc64le


How reproducible:
100%

Steps to Reproduce:
1.qemu-img create -f qcow2 stg0.qcow2 100M

2. boot guest 
/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1'  \
-sandbox on  \
-machine pseries  \
-nodefaults \
-device VGA,bus=pci.0,addr=0x2 \
-m 116736  \
-smp 80,maxcpus=80,cores=40,threads=1,sockets=2  \
-cpu 'host' \
-chardev socket,id=qmp_id_qmpmonitor1,server,path=/var/tmp/VOqWoB,nowait  \
-mon chardev=qmp_id_qmpmonitor1,mode=control \
-chardev socket,id=chardev_serial0,server,path=/var/tmp/serial-serial0,nowait \
-device spapr-vty,id=serial0,reg=0x30000000,chardev=chardev_serial0 \
-device qemu-xhci,id=usb1,bus=pci.0,addr=0x3 \
-device nec-usb-xhci,id=extra_usb,bus=pci.0,addr=0x4 \
-device usb-tablet,id=usb-tablet1,bus=extra_usb.0,port=1 \
-object iothread,id=iothread0 \
-object iothread,id=iothread1 \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x5,iothread=iothread0 \
-blockdev node-name=file_image1,driver=file,aio=threads,filename=/home/kar/vt_test_images/rhel830-ppc64le-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_image1,driver=qcow2,cache.direct=on,cache.no-flush=off,file=file_image1 \
-device scsi-hd,id=image1,drive=drive_image1,bootindex=0,write-cache=on \
-blockdev node-name=file_stg2,driver=file,aio=threads,filename=/home/kar/vt_test_images/stg0.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_stg2,driver=qcow2,cache.direct=on,cache.no-flush=off,file=file_stg2 \
-device usb-storage,id=stg2,drive=drive_stg2,write-cache=on,bus=extra_usb.0,port=2 \
-device virtio-net-pci,mac=9a:64:02:7d:8e:ad,id=id7xt0rM,netdev=idRiRkIa,bus=pci.0,addr=0x7  \
-netdev tap,id=idRiRkIa,vhost=on  \
-vnc :30  \
-rtc base=utc,clock=host  \
-boot menu=off,order=cdn,once=c,strict=off \
-enable-kvm  \
-monitor stdio 

3. Check dmesg:

[    4.181115] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[    4.401078] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[    4.621098] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[    4.841074] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[    5.061070] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[    5.281069] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[    5.312111] sd 0:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=1s
[    5.313203] sd 0:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 80 00
[    5.313795] blk_update_request: I/O error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[    5.314949] Buffer I/O error on dev sdb, logical block 0, async page read
[    5.461021] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd

4. parted stg0.qcow2

# parted -s "/dev/sdb" mklabel gpt
parted -s "/dev/sdb" mklabel gpt
[ 4073.058015] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[ 4073.277976] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[ 4073.498009] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[ 4073.828005] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[ 4074.048004] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[ 4074.267948] usb 4-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[ 4074.298485] sd 0:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK cmd_age=1s
[ 4074.298547] sd 0:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 80 00
[ 4074.298590] blk_update_request: I/O error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 4074.298647] Buffer I/O error on dev sdb, logical block 0, async page read

5. check stg0.qcow2
[root@ibm-p9wr-21 ~]# qemu-img check /home/kar/vt_test_images/stg0.qcow2 -U
No errors were found on the image.
2/1600 = 0.12% allocated, 0.00% fragmented, 0.00% compressed clusters
Image end offset: 458752

[root@ibm-p9wr-21 ~]# qemu-img info /home/kar/vt_test_images/stg0.qcow2 -U
image: /home/kar/vt_test_images/stg0.qcow2
file format: qcow2
virtual size: 100 MiB (104857600 bytes)
disk size: 388 KiB
cluster_size: 65536
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

(qemu) info  usb
  Device 1.1, Port 1, Speed 480 Mb/s, Product QEMU USB Tablet, ID: usb-tablet1
  Device 1.2, Port 2, Speed 5000 Mb/s, Product QEMU USB MSD, ID: stg2


Actual results:
usb-storage cannot be used, and an error is reported

Expected results:
usb-storage can be used normally

Additional info:
When using qemu-kvm-4.2.0-29.module+el8.3.0+7212+401047e6, usb-storage can be used normally.

Tested on x86 platform, did not encounter this problem.

Comment 1 yduan 2020-07-08 10:17:53 UTC
Created attachment 1700269 [details]
dmesg_x86

Comment 2 yduan 2020-07-08 10:20:21 UTC
Reproduce this with qemu-kvm-core-5.0.0-0.scrmod+el8.3.0+7241+ccee766e.wrb200701.x86_64:
dmesg info is attached.

Command lines:
/usr/libexec/qemu-kvm \
 -S \
 -sandbox on \
 -machine q35,kernel-irqchip=split \
 -device intel-iommu,intremap=on,eim=on,device-iotlb=on \
 -device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1 \
 -device pcie-pci-bridge,id=pcie-pci-bridge-0,addr=0x0,bus=pcie-root-port-0 \
 -nodefaults \
 -device qxl-vga,bus=pcie.0,addr=0x2 \
 -m 4G \
 -smp 8,maxcpus=10,cores=5,threads=1,dies=1,sockets=2 \
 -cpu 'Skylake-Server',+kvm_pv_unhalt \
 -device pvpanic,ioport=0x505,id=id5bgZeb \
 -chardev socket,id=seabioslog,path=/tmp/seabios-log1,server,nowait \
 -device isa-debugcon,chardev=seabioslog,iobase=0x402 \
 -device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2 \
 -device qemu-xhci,id=usbtest,bus=pcie-root-port-1,addr=0x0 \
 -device usb-tablet,id=usb-tablet1,bus=usbtest.0,port=1 \
 -blockdev node-name=file_stg00,driver=file,aio=threads,filename=/home/kvm_autotest_root/images/stg00.qcow2,cache.direct=on,cache.no-flush=off \
 -blockdev node-name=drive_stg00,driver=qcow2,cache.direct=on,cache.no-flush=off,file=file_stg00 \
 -device usb-storage,id=stg00,drive=drive_stg00,write-cache=on,bus=usbtest.0,port=2 \
 -device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x1.0x2,bus=pcie.0,chassis=3 \
 -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie-root-port-2,addr=0x0,iommu_platform=on,ats=on \
 -blockdev node-name=file_image1,driver=file,aio=threads,filename=/home/kvm_autotest_root/images/rhel830-64-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
 -blockdev node-name=drive_image1,driver=qcow2,cache.direct=on,cache.no-flush=off,file=file_image1 \
 -device scsi-hd,id=image1,drive=drive_image1,write-cache=on \
 -device pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x1.0x3,bus=pcie.0,chassis=4 \
 -device virtio-net-pci,mac=9a:e3:a8:3f:9b:42,id=nic0,netdev=net0,bus=pcie-root-port-3,addr=0x0 \
 -netdev tap,id=net0,vhost=on \
 -monitor stdio \
 -spice port=5900,disable-ticketing \
 -vnc :1 \
 -qmp tcp:0:9999,server,nowait \
 -rtc base=utc,clock=host,driftfix=slew \
 -boot menu=off,order=cdn,once=c,strict=off \
 -enable-kvm \

Comment 3 Laurent Vivier 2020-07-08 11:47:16 UTC
As it's not ppc64le, moving back to the pool

Comment 4 Zhenyu Zhang 2020-07-14 08:48:43 UTC
*** Bug 1856686 has been marked as a duplicate of this bug. ***

Comment 6 Gerd Hoffmann 2020-07-16 07:42:25 UTC
https://patchwork.ozlabs.org/project/qemu-devel/patch/20200713062712.1476-1-kraxel@redhat.com/
(not merged yet, should land upstream for 5.1-rc1 though).

Comment 7 Gerd Hoffmann 2020-09-09 06:19:03 UTC
(In reply to Gerd Hoffmann from comment #6)
> https://patchwork.ozlabs.org/project/qemu-devel/patch/20200713062712.1476-1-
> kraxel/
> (not merged yet, should land upstream for 5.1-rc1 though).

Can you retest with latest 5.1 please?
Should be fixed ...

Comment 9 yduan 2020-09-15 07:08:16 UTC
(In reply to Gerd Hoffmann from comment #7)
> (In reply to Gerd Hoffmann from comment #6)
> > https://patchwork.ozlabs.org/project/qemu-devel/patch/20200713062712.1476-1-
> > kraxel/
> > (not merged yet, should land upstream for 5.1-rc1 though).
> 
> Can you retest with latest 5.1 please?
> Should be fixed ...

Sorry for late response.

Cannot reproduce the issue with qemu-kvm-5.1.0-6.module+el8.3.0+8041+42ff16b8.x86_64.

Comment 10 yduan 2020-09-17 15:01:01 UTC
Change to VERIFIED according to comment 9.

Comment 12 Jeff Nelson 2021-01-08 16:30:47 UTC
RHEL AV 8.3.0 has been shipped, therefore marking this BZ CLOSED CURRENTRELEASE.


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