Bug 1471625 - [RFE] scsi-block device should support "stop on error" [NEEDINFO]
Summary: [RFE] scsi-block device should support "stop on error"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Fam Zheng
QA Contact: Xueqiang Wei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-17 06:12 UTC by yilzhang
Modified: 2018-11-01 11:01 UTC (History)
12 users (show)

Fixed In Version: qemu-kvm-rhev-2.12.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-01 11:01:10 UTC
Target Upstream Version:
famz: needinfo? (michal.skrivanek)


Attachments (Terms of Use)

Description yilzhang 2017-07-17 06:12:16 UTC
Description of problem:
On rhel7.4, scsi-block does not support "stop on error". There is no werror property, as well, QMP 'query-block' command doesn't show its io-status.

Version-Release number of selected component (if applicable):
Host kernel: 3.10.0-689.el7
qemu-kvm-rhev-2.9.0-14.el7

How reproducible: 100%



Steps to Reproduce:
1. On host, run /usr/libexec/qemu-kvm -device scsi-block,?
2. Boot up a guest with an scsi-block device, and configure the device to stop on errors
QEMU cli:
-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 \

3. Run QMP 'query-block' command to check the IO status of this scsi-block device:
   {"execute": "query-block"}


Actual results:
Step1: the command's output doesn't have werror/rerror property
Step3: scsi-block device doesn't have "io-status". The output of QMP 'query-block' command is as follows:
{"return": [{"io-status": "ok", "device": "drive-system-disk", ......}, {"device": "scsi-block-device4", "locked": false, ... ...}


Expected results:
Step1: the output should have werror/rerror property
Step3: It should display "io-status" for scsi-block device


Additional info:
x86 and PPC both have this problem

Comment 2 CongLi 2017-07-17 07:17:07 UTC
1. Recording Paolo's comment in 1468413#c8:
"Yes, that's correct.  scsi-generic and scsi-block do not support it, but it can be added at least to scsi-block."

2. IMO, if not add attribute 'werror/rerror' to scsi-block, it's better to provide a warning or error info like 'scsi-generic'.
./hw/scsi/scsi-generic.c:526:        error_setg(errp, "Device doesn't support drive option werror");


Thanks.

Comment 3 Fam Zheng 2017-08-17 10:30:19 UTC
Proposed a small change for upstream QEMU:

Author: Fam Zheng <famz@redhat.com>
Date:   Thu Aug 17 17:20:06 2017 +0800

    scsi-block: Add qdev error properties
    
    This makes the werror/rerror options available on the scsi-block device,
    to allow user specify error handling policy in the same way as scsi-hd
    etc.
    
    Signed-off-by: Fam Zheng <famz@redhat.com>

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 5f1e5e8070..27d917f7c3 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2972,6 +2972,7 @@ static const TypeInfo scsi_cd_info = {
 
 #ifdef __linux__
 static Property scsi_block_properties[] = {
+    DEFINE_BLOCK_ERROR_PROPERTIES(SCSIDiskState, qdev.conf),         \
     DEFINE_PROP_DRIVE("drive", SCSIDiskState, qdev.conf.blk),
     DEFINE_PROP_END_OF_LIST(),
 };

Comment 7 Xueqiang Wei 2018-07-12 08:29:06 UTC
reproduce bug on qemu-kvm-rhev-2.10.0-21.el7_5.1

# /usr/libexec/qemu-kvm -device scsi-block,?
scsi-block.bootindex=int32
scsi-block.rotation_rate=uint16
scsi-block.drive=str (Node name or ID of a block device to use as a backend)
scsi-block.lun=uint32
scsi-block.share-rw=bool
scsi-block.channel=uint32
scsi-block.scsi-id=uint32

# /usr/libexec/qemu-kvm -device scsi-generic,?
scsi-generic.bootindex=int32
scsi-generic.drive=str (Node name or ID of a block device to use as a backend)
scsi-generic.lun=uint32
scsi-generic.share-rw=bool
scsi-generic.channel=uint32
scsi-generic.scsi-id=uint32


{"execute": "query-block"}

{"device": "drive_stg0", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 52428800, "filename": "/dev/sdb", "format": "raw", "actual-size": 0, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "#block359", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": true, "writeback": true}, "file": "/dev/sdb", "encryption_key_missing": false}, "qdev": "stg0", "type": "unknown"}]}


Tested on qemu-kvm-rhev-2.12.0-1.el7

# /usr/libexec/qemu-kvm -device scsi-block,?
scsi-block.bootindex=int32
scsi-block.rotation_rate=uint16
scsi-block.drive=str (Node name or ID of a block device to use as a backend)
scsi-block.lun=uint32
scsi-block.scsi_version=int32
scsi-block.share-rw=bool
scsi-block.werror=BlockdevOnError (Error handling policy, report/ignore/enospc/stop/auto)
scsi-block.channel=uint32
scsi-block.rerror=BlockdevOnError (Error handling policy, report/ignore/enospc/stop/auto)
scsi-block.scsi-id=uint32

# /usr/libexec/qemu-kvm -device scsi-generic,?
scsi-generic.bootindex=int32
scsi-generic.drive=str (Node name or ID of a block device to use as a backend)
scsi-generic.lun=uint32
scsi-generic.share-rw=bool
scsi-generic.channel=uint32
scsi-generic.scsi-id=uint32


{"execute": "query-block"}

{"io-status": "ok", "device": "drive_stg0", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 52428800, "filename": "/dev/sdb", "format": "raw", "actual-size": 0, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "#block321", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": true, "writeback": true}, "file": "/dev/sdb", "encryption_key_missing": false}, "qdev": "stg0", "type": "unknown"}]}


As the details above, scsi-block device support "stop on error" already, so verify the bug.


By the way, scsi-generic device not support "stop on error" yet.

Comment 8 Xueqiang Wei 2018-07-13 02:25:09 UTC
Fam,

According to Comment 2 and Comment 7, need to report a new bug for scsi-generic device ?

Comment 9 Fam Zheng 2018-07-18 06:32:49 UTC
I don't know any demand on that feature. What is the use case? I think storage's SCSI passthrough should use scsi-block. scsi-generic is more for non-storage and TBH I don't know if werror/rerror semantics apply there.

Comment 10 Fam Zheng 2018-07-18 06:33:25 UTC
Restoring Michal's needinfo.

Comment 11 Xueqiang Wei 2018-07-18 06:58:48 UTC
According to Comment 2, tested scsi-generic device on qemu-kvm-rhev-2.12.0-7.el7


It has warning as below:

(qemu) qemu-kvm: -device scsi-generic,bus=bus1.0,drive=scsi-disk0,id=disk: Device doesn't support drive option werror

(qemu) qemu-kvm: -device scsi-generic,bus=bus1.0,drive=scsi-disk0,id=disk: Device doesn't support drive option rerror


So verify this bug.

Comment 13 errata-xmlrpc 2018-11-01 11:01:10 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://access.redhat.com/errata/RHBA-2018:3443


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