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 1072294 - should disable host_cdrom device pass-through via scsi-generic with correct warning message
Summary: should disable host_cdrom device pass-through via scsi-generic with correct w...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Markus Armbruster
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-04 10:24 UTC by Sibiao Luo
Modified: 2014-06-25 08:36 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-24 13:05:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sibiao Luo 2014-03-04 10:24:35 UTC
Description of problem:
We have disabled host cdrom passthrough in bug 760885 with warning message prompt: Driver 'host_cdrom' is not whitelisted.
But 'Could not open file: Invalid argument' when pass-through host_cdrom device via scsi-generic.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm-rhev
3.10.0-100.el7.x86_64
qemu-kvm-rhev-1.5.3-50.el7.x86_64
guest info:
# uname -r
3.10.0-100.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.insert a DVD/CD to host.
# ls -lh /dev/cdrom 
lrwxrwxrwx. 1 root root 3 Mar  4 18:07 /dev/cdrom -> sr0
# sg_map
/dev/sg0  /dev/sda
/dev/sg1  /dev/sr0
2.pass-through host_cdrom device via scsi-generic.
e.g:...-drive file=/dev/sg1,if=none,id=drive-data-disk,format=raw,media=cdrom,cache=none,aio=native,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi1,indirect_desc=off,event_idx=off,bus=pci.0,addr=0x8 -device scsi-generic,drive=drive-data-disk,id=data-disk
Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
qemu-kvm: -drive file=/dev/sg1,if=none,id=drive-data-disk,format=raw,media=cdrom,cache=none,aio=native,werror=stop,rerror=stop: could not open disk image /dev/sg1: Could not open file: Invalid argument

Actual results:

Expected results:
QEMU will quit with warning message prompt: Driver 'host_cdrom' is not whitelisted.

Additional info:

Comment 1 Sibiao Luo 2014-03-07 03:33:18 UTC
(In reply to Sibiao Luo from comment #0)
> 2.pass-through host_cdrom device via scsi-generic.
> e.g:...-drive
> file=/dev/sg1,if=none,id=drive-data-disk,format=raw,media=cdrom,cache=none,
> aio=native,werror=stop,rerror=stop -device
> virtio-scsi-pci,id=scsi1,indirect_desc=off,event_idx=off,bus=pci.0,addr=0x8
> -device scsi-generic,drive=drive-data-disk,id=data-disk
> Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
> qemu-kvm: -drive
> file=/dev/sg1,if=none,id=drive-data-disk,format=raw,media=cdrom,cache=none,
> aio=native,werror=stop,rerror=stop: could not open disk image /dev/sg1:
> Could not open file: Invalid argument

Hmm, according bug 920096#c1, I should not specify cache=none for scsi-generic, i also tried the cache=writeback/writethrough which can boot up guest successfully and we can see the passthrough host_cdrom in guest correctly.

# sg_map
/dev/sg0  /dev/sda
/dev/sg1  /dev/sr0
e.g:...-drive file=/dev/sg1,if=none,id=drive-data-disk,format=raw,*cache=writeback*,aio=native -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x7 -device scsi-generic,drive=drive-data-disk,bus=scsi1.0,id=data-disk

Expected results:
QEMU will quit with warning message prompt: Driver 'host_cdrom' is not whitelisted.

Base on above, i will raise the priority for it, thanks.

Best Regards,
sluo

Comment 2 Markus Armbruster 2014-06-24 13:05:14 UTC
We disabled host CD-ROM passthrough via block backend host_cdrom (bug
760885).  Therefore, you can't back a scsi-cd or ide-cd device model
with a host CD-ROM device in RHEL-7.

We didn't disable SCSI host device passthrough via device model
scsi-generic.  Therefore, you *can* back a scsi-generic device model
with a host SCSI CD-ROM device in RHEL-7.

Maybe we should've disabled that kind of host CD-ROM passthrough as
well, maybe not.  Question is moot, as 7.0 shipped with it enabled.

Closing NOTABUG.  Please reopen if you think we should disable use of
host SCSI CD-ROM via scsi-generic even though we shipped it in 7.0.

Comment 3 Sibiao Luo 2014-06-25 04:30:56 UTC
(In reply to Markus Armbruster from comment #2)
> We disabled host CD-ROM passthrough via block backend host_cdrom (bug
> 760885).  Therefore, you can't back a scsi-cd or ide-cd device model
> with a host CD-ROM device in RHEL-7.
> 
> We didn't disable SCSI host device passthrough via device model
> scsi-generic.  Therefore, you *can* back a scsi-generic device model
> with a host SCSI CD-ROM device in RHEL-7.
> 
> Maybe we should've disabled that kind of host CD-ROM passthrough as
> well, maybe not.  Question is moot, as 7.0 shipped with it enabled.
> 
> Closing NOTABUG.  Please reopen if you think we should disable use of
> host SCSI CD-ROM via scsi-generic even though we shipped it in 7.0.

I think we should disable pass-through the host CD-ROM via scsi-generic as well, or we should implement it to work well, thanks.

Best Regards,
sluo

Comment 4 Markus Armbruster 2014-06-25 06:09:28 UTC
Comment#1 makes me believe scsi-generic backed by host CD-ROM works: "can boot up guest successfully and we can see the passthrough host_cdrom in guest correctly".  If that's not the case, please describe how exactly it doesn't work.

Comment 5 Sibiao Luo 2014-06-25 06:24:53 UTC
(In reply to Markus Armbruster from comment #4)
> Comment#1 makes me believe scsi-generic backed by host CD-ROM works: "can
> boot up guest successfully and we can see the passthrough host_cdrom in
> guest correctly".  If that's not the case, please describe how exactly it
> doesn't work.
Yes, thanks for your reminds, I just forgot the comment #1, it worked well indeed.

Comment 6 juzhang 2014-06-25 06:30:15 UTC
(In reply to Markus Armbruster from comment #2)
> We disabled host CD-ROM passthrough via block backend host_cdrom (bug
> 760885).  Therefore, you can't back a scsi-cd or ide-cd device model
> with a host CD-ROM device in RHEL-7.
> 
> We didn't disable SCSI host device passthrough via device model
> scsi-generic.  Therefore, you *can* back a scsi-generic device model
> with a host SCSI CD-ROM device in RHEL-7.
> 
> Maybe we should've disabled that kind of host CD-ROM passthrough as
> well, maybe not.  Question is moot, as 7.0 shipped with it enabled.

Hi Markus,

Thanks for your inputs first.

Back to QE POV, do we need to test scsi-generic & CD-ROM passthrough scenario in RHEL7.1? 

Do not disable scsi-generic & CD-ROM passthrough is by design? or just ignore it?

Look forward to your feedback.

Best Regards,
Junyi

> 
> Closing NOTABUG.  Please reopen if you think we should disable use of
> host SCSI CD-ROM via scsi-generic even though we shipped it in 7.0.

Comment 7 Markus Armbruster 2014-06-25 08:31:04 UTC
SCSI host device passthrough (device models scsi-generic and scsi-block) is an intentional RHEL-7 feature.  Evidence: bug 721250.

General rule for RHEL-7: qemu-kvm can do it, libvirt can configure it, we support it.  Exceptions are possible, but should be documented.

Regarding whether we need to test this: excellent point!  I figure our testing of SCSI host device passthrough should cover CD-ROM devices, too.

Comment 8 juzhang 2014-06-25 08:36:26 UTC
(In reply to Markus Armbruster from comment #7)
> SCSI host device passthrough (device models scsi-generic and scsi-block) is
> an intentional RHEL-7 feature.  Evidence: bug 721250.
> 
> General rule for RHEL-7: qemu-kvm can do it, libvirt can configure it, we
> support it.  Exceptions are possible, but should be documented.
> 
> Regarding whether we need to test this: excellent point!  I figure our
> testing of SCSI host device passthrough should cover CD-ROM devices, too.

Thanks Markus.

Best Regards,
Junyi


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