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 1095663 - Support read only VirtIO-SCSI direct LUNs in QEMU
Summary: Support read only VirtIO-SCSI direct LUNs in QEMU
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1095666 1110396
TreeView+ depends on / blocked
 
Reported: 2014-05-08 10:18 UTC by Allon Mureinik
Modified: 2014-07-11 15:14 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
: 1110396 (view as bug list)
Environment:
Last Closed: 2014-06-17 14:44:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Allon Mureinik 2014-05-08 10:18:27 UTC
Description of problem:
After discussing the issue with Paolo on bug 1082673, it is clear that QEMU does not support read-only access to VirtIO-SCSI direct LUNs:

"""
Making a SCSI LUN read-only requires intercepting passed-through commands and modifying the results (for example change the inquiry data to report the LUN as read-only, and QEMU never needed to do this yet).

Is QEMU running as root?  If so, one problem is that the kernel doesn't filter write commands on read-only file descriptors when the process has CAP_SYS_RAWIO.  This would be a separate fix.

But even if QEMU is not running as root, the kernel will treat the disk as writable and write data to the page cache, only to fail later at writeback time.  If QEMU is not running as root, you should notice that adding "oflag=direct" causes writes to fail directly, because they bypass the page cache.
"""

This bug is opened to track the effort of supporting such a flow.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-0.12.1.2-2.415.el6_5.7.x86_64

How reproducible:
100%

Steps to Reproduce
(copied from bug 1082673, and edited to remove RHEVM specific terminology):
1. Create a VM with disk attached, install RHEL 6.5 guest OS
2. Expose a LUN to the host
3. Attach the LUN to the VM as direct LUN via Virt-IO-SCSI as read-only
4. Try to write to the disk from the guest. I tried with 'dd':

# dd if=/dev/zero of=/dev/sdc bs=1K count=50


Actual results:

Data is written on the device when it is connected via Virt-IO-SCSI:

[root@localhost ~]# dd if=/dev/zero of=/dev/sdc bs=1K count=50
50+0 records in
50+0 records out
51200 bytes (51 kB) copied, 0.0255978 s, 2.0 MB/s

Comment 1 Allon Mureinik 2014-05-08 10:23:48 UTC
Sean, IIUC, this usecase is especially interesting for CFME. Can you elaborate please?

Comment 2 Andrew Cathrow 2014-05-19 14:26:40 UTC
Is this a realistic RFE, it makes sense for virtio-blk but do we want to go down this path for virtio-scsi

Comment 3 Andrew Cathrow 2014-05-19 14:26:51 UTC
Is this a realistic RFE, it makes sense for virtio-blk but do we want to go down this path for virtio-scsi

Comment 7 Ademar Reis 2014-06-17 14:44:59 UTC
Clone for RHEL7: Bug 1110396

Closing this RHEL6 version as WONTFIX.


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