Bug 1468413 - [qmp] 'query-block' command doesn't show some block device's io-status
[qmp] 'query-block' command doesn't show some block device's io-status
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.4-Alt
All Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Markus Armbruster
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-06 22:40 EDT by yilzhang
Modified: 2017-07-17 01:36 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-14 09:53:26 EDT
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 yilzhang 2017-07-06 22:40:24 EDT
Description of problem:
When using 'query-block' command to check the IO status of block device, qmp doesn't show some device's  "io-status".

Note: virtio-blk and usb storage device both have this problem


Version-Release number of selected component (if applicable):
Host:  kernel: 4.11.0-10.el7a.ppc64le
       qemu-kvm-2.9.0-16.el7a.ppc64le
Guest: 4.11.0-10.el7a.ppc64le

How reproducible: 100%


Steps to Reproduce:
1. boot with QMP enabled like:  QEMU cli:
/usr/libexec/qemu-kvm \
 -name yilzhang_vm \
-serial unix:/tmp/myserial.log,server,nowait \
-smp 8,sockets=2,cores=4,threads=1 -m 8192 \
-qmp tcp:0:9999,server,nowait \
-monitor stdio \
-nodefaults -enable-kvm \
-device virtio-scsi-pci,bus=pci.0,addr=0x3,id=scsi0 \
 -drive file=/home/yilzhang/rhel7.4-alt-20170626.4.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop \
-device scsi-hd,bus=scsi0.0,drive=drive-system-disk,id=system-disk,bootindex=1 \
\
 -drive file=/home/disk/disk0.qcow2,if=none,cache=none,id=data-disk1,format=qcow2 \
-device virtio-blk-pci,drive=data-disk1,bus=pci.0,id=blk-disk1 \
\
 -drive file=/dev/qmp_vg/qmp_lv,if=none,cache=none,id=data-disk2,format=qcow2,werror=report,rerror=report \
-device virtio-blk-pci,drive=data-disk2,bus=pci.0,id=blk-disk2
2. from any box with telnet client, run:   #telnet $HostIP 4444
3. run {"execute": "qmp_capabilities"}
4. start query-block: {"execute": "query-block"}
5. Check the block io status (could be a virtio blk, virtio scsi sata, or usb disk)



Actual results:
one of the three block devices doesn't have "io-status". The output from telnet:
{"return": [{"io-status": "ok", "device": "drive-system-disk", ......}, {"io-status": "ok", "device": "data-disk1", "locked": false, ........}, {"device": "data-disk2", "locked": false, ........}]}

Expected results:
It should display "io-status" of each block device


Additional info:
usb storage device also has this problem
Comment 2 Karen Noel 2017-07-07 07:14:51 EDT
Does this reproduce with x86 or Power 8? Thanks.
Comment 3 yilzhang 2017-07-11 04:29:01 EDT
x86 also has this problem.
host kernel: 4.11.0-10.el7a.x86_64
qemu-kvm-2.9.0-16.el7a.x86_64
guest kernel: 4.11.0-10.el7a.x86_64



Update Qemu command line:
/usr/libexec/qemu-kvm \
 -name yilzhang_vm \
-serial unix:/tmp/myserial.log,server,nowait \
-smp 8,sockets=2,cores=4,threads=1 -m 8192 \
-qmp tcp:0:9999,server,nowait \
-monitor stdio \
-nodefaults -enable-kvm \
-device virtio-scsi-pci,bus=pci.0,addr=0x3,id=scsi0 \
 -drive file=/home/yilzhang/rhel7.4-alt-20170626.4.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop \
-device scsi-hd,bus=scsi0.0,drive=drive-system-disk,id=system-disk,bootindex=1 \
 -drive file=/home/disk/disk0.qcow2,if=none,cache=none,id=data-disk1,format=qcow2 \
-device virtio-blk-pci,drive=data-disk1,bus=pci.0,id=blk-disk1 \
\
 -drive file=/dev/qmp_vg/qmp_lv,if=none,cache=none,id=data-disk2,format=raw,werror=report,rerror=report \
-device virtio-blk-pci,drive=data-disk2,bus=pci.0,id=blk-disk2 \
 -drive file=/dev/sdb6,if=none,cache=none,id=data-disk3,format=raw,werror=report,rerror=report \
-device virtio-blk-pci,drive=data-disk3,bus=pci.0,id=blk-disk3 \
-device nec-usb-xhci,id=xhci0,bus=pci.0,addr=0x5 \
-drive  file=/home/disk/usb-disk1,if=none,cache=none,id=usb-disk1,format=qcow2 \
-device usb-storage,drive=usb-disk1,bus=xhci0.0,id=usb1



In this example, the last three devices don't have 'io-status' via qmp "query-block" command
Comment 5 Markus Armbruster 2017-07-11 11:35:27 EDT
QMP documentation on io-status explains it's "Only present if the device supports it and the VM is configured to stop on errors (supported device models: virtio-blk, IDE, SCSI except scsi-generic)".

Is any of the devices without io-status one of the supported device models and configured to stop on errors?
Comment 6 yilzhang 2017-07-11 22:38:36 EDT
Hi Markus, 

Thank you for detailed explanation :)

I tried these devices: virtio-blk, scsi-hd, scsi-cd, scsi-block
As well, in Qemu cli, I added "werror=stop,rerror=stop" after "-drive ...."

The result is: only scsi-block device has NO "io-status"


Qemu command line may like this:
-drive file=/dev/sdb5,if=none,cache=none,id=data-disk4,format=raw,werror=stop,rerror=stop \
-device scsi-block,bus=scsi0.0,drive=data-disk4,id=scsi-disk1 \
Comment 7 Markus Armbruster 2017-07-12 02:07:48 EDT
As far as I can tell, scsi-block does not support "stop on error" (there is no werror property).  Paolo, can you confirm?
Comment 8 Paolo Bonzini 2017-07-14 09:00:40 EDT
Yes, that's correct.  scsi-generic and scsi-block do not support it, but it can be added at least to scsi-block.
Comment 9 Markus Armbruster 2017-07-14 09:53:26 EDT
As far as I can see, everything works correctly, so closing NOTABUG.

If we need scsi-block to support "stop on error", the first step to get it is filing an BZ asking for it.
Comment 10 yilzhang 2017-07-17 01:36:46 EDT
Hi Markus,

In this case, I will file a new BZ to get "stop on error" support for scsi-block against RHEL7.4 and qemu-kvm-rhev component.

Thanks.

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