RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 919380 - Add support for rerror/werror to scsi-generic in rhel7
Summary: Add support for rerror/werror to scsi-generic in rhel7
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1021102
TreeView+ depends on / blocked
 
Reported: 2013-03-08 10:01 UTC by Sibiao Luo
Modified: 2015-12-11 14:43 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1021102 (view as bug list)
Environment:
Last Closed: 2015-12-11 14:43:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sibiao Luo 2013-03-08 10:01:57 UTC
Description of problem:
Just as discus with pbonzini that add support for rerror/werror to scsi-generic in rhel7.

Version-Release number of selected component (if applicable):
host info:
kernel-3.8.0-0.40.el7.x86_64
QEMU 1.4.50

How reproducible:
100%

Steps to Reproduce:
1.boot guest with scsi-generic adding werror=stop,rerror=stop.
e.g:...-drive file='/dev/sg1',werror=stop,rerror=stop... -device virtio-scsi-pci,... -device scsi-generic,...
2.
3.
  
Actual results:
after step 1, it will fail to boot up, and qemu will prompt like:
qemu-system-x86_64: -drive file=/dev/sg1,if=none,id=drive-data-disk,format=raw,werror=stop,rerror=stop,cache=none,aio=native: could not open disk image /dev/sg1: Invalid argument

Expected results:
we should add support for rerror/werror to scsi-generic.

Additional info:

Comment 1 Sibiao Luo 2013-03-11 03:47:17 UTC
(In reply to comment #0)  
> Actual results:
> after step 1, it will fail to boot up, and qemu will prompt like:
> qemu-system-x86_64: -drive
> file=/dev/sg1,if=none,id=drive-data-disk,format=raw,werror=stop,rerror=stop,
> cache=none,aio=native: could not open disk image /dev/sg1: Invalid argument
> 
Ignore above prompt, as this prompt is about the cache=none prompt. The right one as following:
e.g:...-drive file=/dev/sg2,if=none,id=drive-data-disk,format=raw,werror=stop,rerror=stop,aio=native -device virtio-scsi-pci,id=scsi1,addr=0x5 -device scsi-generic,bus=scsi1.0,drive=drive-data-disk,id=data-disk

qemu-kvm: -device scsi-generic,bus=scsi1.0,drive=drive-data-disk,id=data-disk: Device doesn't support drive option werror
qemu-kvm: -device scsi-generic,bus=scsi1.0,drive=drive-data-disk,id=data-disk: Device 'scsi-generic' could not be initialized

--------------------------------------------------------------------------------

Paolo, 

    If i boot guest with the cache=none for scsi-generic drive, it will fail to boot up, does it the same issue, does the scsi-generic support the cache=none for drive ? should we need to open a new bug for it ? btw, the "writeback", "unsafe", "directsync" and "writethrough" is ok for cache value of scsi-generic drive. 
e.g:...-drive file=/dev/sg2,if=none,id=drive-data-disk,format=raw,cache=none,aio=native -device virtio-scsi-pci,id=scsi1,addr=0x5 -device scsi-generic,bus=scsi1.0,drive=drive-data-disk,id=data-disk 

qemu-kvm: -drive file=/dev/sg2,if=none,id=drive-data-disk,format=raw,cache=none,aio=native: could not open disk image /dev/sg2: Invalid argument

Best Regards.
sluo

Comment 2 Paolo Bonzini 2013-03-11 10:41:17 UTC
Thanks for the report.  Yes, you can open a separate bug.  QEMU should ignore cache=none for scsi-generic because it always _behaves_ like cache=none but _using_ cache=none fails (O_DIRECT is not supported by /dev/sgN devices).

Comment 3 Sibiao Luo 2013-03-11 10:55:55 UTC
(In reply to comment #2)
> Thanks for the report.  Yes, you can open a separate bug.  QEMU should
> ignore cache=none for scsi-generic because it always _behaves_ like
> cache=none but _using_ cache=none fails (O_DIRECT is not supported by
> /dev/sgN devices).
see bug 920096, thx for your kindly checking.

Comment 4 Markus Armbruster 2013-05-17 13:04:59 UTC
scsi-generic.c needs to call scsi_handle_rw_error() (or equivalent function) like
scsi-disk.c does (see commit ea8a5d7 and commit 5dba48a).  Upstream first.

Comment 6 Markus Armbruster 2014-07-16 11:33:28 UTC
We refined rerror/werror upstream to not apply when the LBA range is
invalid, and are backporting that to RHEL-7 (bug 1085232).

Stupid question: how could we similarly filter out invalid LBA ranges
for scsi-generic?

Comment 8 Markus Armbruster 2014-07-25 12:15:55 UTC
rerror/werror require support in the underlying device model.
Currently, only ide-hd, ide-cd, ide-drive (legacy), scsi-hd, scsi-cd,
scsi-disk (legacy), scsi-block (partially[*]), virtio-blk-device do.

Device models that do not support it: isa-fdc, cfi.pflash01,
scsi-generic, nvme, ...  This bug is only about scsi-generic.

See also bug 1123355 - Document -drive rerror/werror restrictions.


[*] Should work as long as you stick to plain read/write.  Fancy stuff
like write same gets tricky.

Comment 9 Markus Armbruster 2014-07-25 12:21:06 UTC
The obvious way to fully implement rerror/werror for scsi-generic
involves understanding all SCSI commands.  Even vendor-specific
commands.  Defeats the purpose device pass-through.

Perhaps something covering just werror=enospc (and the default
=report, of course) could be hacked up with just understanding sense
codes.

Unless we can come up with workable ideas *and* a business case
justifying the work, this feels like a WONTFIX to me.

However, Paolo would like to address this upstream.  His rough ETA is
in one year.  He's prefer to keep this bug open for now.


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