Bug 760885
Summary: | Disable host cdrom passthrough | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Amit Shah <amit.shah> |
Component: | qemu-kvm | Assignee: | Fam Zheng <famz> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | urgent | Docs Contact: | |
Priority: | high | ||
Version: | 7.0 | CC: | ajia, amit.shah, armbru, bili, chhu, crobinso, ctatman, dyuan, famz, hhuang, juzhang, knoel, lcui, marcandre.lureau, mattdm, michen, mzhan, pbonzini, sluo, tgummels, thomas.mingarelli, tzheng, virt-maint, wdai |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | qemu-kvm-1.5.3-15.el7 | Doc Type: | Known Issue |
Doc Text: |
CD-ROM passthrough from to the host to a guest has been disabled in Red Hat Enterprise Linux 7.0 Beta for all front ends. QEMU reports "Driver 'host_cdrom' is not whitelisted" in this scenario.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2014-06-13 11:54:00 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 720747, 801536, 1072610, 1072611, 1247068 |
Description
Amit Shah
2011-12-07 09:34:36 UTC
Scratch bug 729219, add: bug 614340 - Use of /dev/sr0 in host while passed-through causes trouble in guest Note that libvirt bug 696613 is currently WONTFIX. If I understand the issues correctly, a fix depends on non-trivial changes to other packages. Perhaps just udev, perhaps more. hi Amit, Does this just disable the IDE passthrough ? the SCSI passthrough is ok in rhel 7 ? or all of them will disable ? Best Regards. sluo Amit, append anther question, if disable the IDE passthrough, how about the AHCI passthrough, should we will disable it too ? Host CD-ROM passthrough is block backend driver "host_cdrom", regardless of the frontend using it, be it ide-cd connected to piix3-ide, ide-cd connected to ich9-ahci, scsi-cd connected to virtio-scsi-pci, ... Fix included in qemu-kvm-1.5.3-15.el7 Veirfy this issue on qemu-kvm-1.5.3-19.el7.x86_64 with the instruction of comment#4. QEMU will quit with warning message prompt: Driver 'host_cdrom' is not whitelisted. So this issue has been fixed correctly. host info: 3.10.0-41.el7.x86_64 qemu-kvm-1.5.3-19.el7.x86_64 seabios-1.7.2.2-4.el7.x86_64 steps and results: - for scsi: # /usr/libexec/qemu-kvm -S -M pc -cpu host -enable-kvm -m 2048 -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -drive file=/dev/sr0,if=none,id=drive-disk,format=raw,cache=none,media=cdrom,readonly=on -device virtio-scsi-pci,id=scsi1,addr=0x4 -device scsi-block,bus=scsi1.0,drive=drive-disk,id=cdrom,bootindex=0 -k en-us -boot menu=on -vnc :1 -monitor stdio Warning: option deprecated, use lost_tick_policy property of kvm-pit instead. qemu-kvm: -drive file=/dev/sr0,if=none,id=drive-disk,format=raw,cache=none,media=cdrom,readonly=on: could not open disk image /dev/sr0: Driver 'host_cdrom' is not whitelisted # /usr/libexec/qemu-kvm -S -M pc -cpu host -enable-kvm -m 2048 -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -drive file=/dev/sr0,if=none,id=drive-disk,format=raw,cache=none,media=cdrom,readonly=on -device virtio-scsi-pci,id=scsi1,addr=0x4 -device scsi-cd,bus=scsi1.0,drive=drive-disk,id=cdrom,bootindex=0 -k en-us -boot menu=on -vnc :1 -monitor stdio Warning: option deprecated, use lost_tick_policy property of kvm-pit instead. qemu-kvm: -drive file=/dev/sr0,if=none,id=drive-disk,format=raw,cache=none,media=cdrom,readonly=on: could not open disk image /dev/sr0: Driver 'host_cdrom' is not whitelisted - for ide: # /usr/libexec/qemu-kvm -S -M pc -cpu host -enable-kvm -m 2048 -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -drive file=/dev/sr0,if=none,id=drive-disk,format=raw,cache=none,media=cdrom,readonly=on -device ide-drive,bus=ide.0,unit=0,drive=drive-disk,id=cdrom,bootindex=0 -k en-us -boot menu=on -vnc :1 -monitor stdioWarning: option deprecated, use lost_tick_policy property of kvm-pit instead. qemu-kvm: -drive file=/dev/sr0,if=none,id=drive-disk,format=raw,cache=none,media=cdrom,readonly=on: could not open disk image /dev/sr0: Driver 'host_cdrom' is not whitelisted -for ahci: # /usr/libexec/qemu-kvm -S -M q35 -cpu host -enable-kvm -m 2048 -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -drive file=/dev/sr0,if=none,id=drive-disk,format=raw,cache=none,media=cdrom,readonly=on -device ide-drive,bus=ide.0,unit=0,drive=drive-disk,id=cdrom,bootindex=0 -k en-us -boot menu=on -vnc :1 -monitor stdio Warning: option deprecated, use lost_tick_policy property of kvm-pit instead. qemu-kvm: -drive file=/dev/sr0,if=none,id=drive-disk,format=raw,cache=none,media=cdrom,readonly=on: could not open disk image /dev/sr0: Driver 'host_cdrom' is not whitelisted # /usr/libexec/qemu-kvm -S -M pc -cpu host -enable-kvm -m 2048 -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -device ahci,id=ahci0 -drive file=/dev/sr0,if=none,id=drive-disk,format=raw,cache=none,media=cdrom,readonly=on -device ide-drive,bus=ahci0.0,unit=0,drive=drive-disk,id=cdrom,bootindex=0 -k en-us -boot menu=on -vnc :1 -monitor stdio Warning: option deprecated, use lost_tick_policy property of kvm-pit instead. qemu-kvm: -drive file=/dev/sr0,if=none,id=drive-disk,format=raw,cache=none,media=cdrom,readonly=on: could not open disk image /dev/sr0: Driver 'host_cdrom' is not whitelisted Best Regards, sluo Clarified doc text's last sentence: 1. Don't claim "QEMU terminates", because it doesn't when it rejects a monitor command. 2. It's not a warning message, it's an error message. this is sooo annoying... Yeah, virt-manager's UI advertises physical CDROM quite prominently, and it's something that's not generated many complains for the install scenario over the years. I know boxes has quite a bit of workflow around it as well, like offering to install a vm if the user inserts physical install media into the driver. I assume that's what Marc-Andre's comment above is about, and the blocks bugs. Can qemu just treat /dev/sr0 the same as it would treat an iso file? So we don't have the mishmash host passthrough support but people can still use the media in the host cdrom. Obviously this likely isn't acceptable as is, but this will change qemu to just treat /dev/sr0 like a regular block device: diff --git a/block/raw-posix.c b/block/raw-posix.c index 1688e16..7802724 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -2028,28 +2028,7 @@ static int cdrom_open(BlockDriverState *bs, QDict *option static int cdrom_probe_device(const char *filename) { - int fd, ret; - int prio = 0; - struct stat st; - - fd = qemu_open(filename, O_RDONLY | O_NONBLOCK); - if (fd < 0) { - goto out; - } - ret = fstat(fd, &st); - if (ret == -1 || !S_ISBLK(st.st_mode)) { - goto outc; - } - - /* Attempt to detect via a CDROM specific ioctl */ - ret = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT); - if (ret >= 0) - prio = 100; - -outc: - qemu_close(fd); -out: - return prio; + return 0; } If you want to treat /dev/sr0 like an iso file, use "file:/dev/sr0". If you want to let the guest use the host CD-ROM device, try passing through the SCSI device. (In reply to Markus Armbruster from comment #13) > If you want to treat /dev/sr0 like an iso file, use "file:/dev/sr0". Libvirt change. Potentially doable, but libvirt would need to differentiate this behavior based on whether it was building a command line for RHEL qemu-kvm compared to EPEL qemu or qemu.git. So, fragile and more work, with pretty much the exact same result as my patch posted above. > If you want to let the guest use the host CD-ROM device, try passing through > the SCSI device. Requires changes to virt-manager, virt-install, boxes at least. And potentially having to differentiate on whether its RHEL or not, etc. And doesn't this require attaching a scsi controller to the guest? What scsi controller do we support besides virtio-scsi ? if the answer is 'none', then how does this work for windows installs? The only SCSI controllers in RHEL-7 are virtio-scsi-pci, usb-storage and usb-bot. No idea whether SCSI device pass through could work with the latter two. I prefer Cole's approach indeed to backporting those patches so late... So is this the issue where the CDROM radio button stays disabled even when you're trying to install a guest using the Host's physical DVDROM device? Is there a workaround? I know the URL method works as does the method of downloading an ISO file to the Host and using it. Tom This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. FWIW, there is a bug report that is tracking re-enabling cdrom passthrough (sort of, see bug for details). However there's no guarantee that it will actually be re-enabled, we are still discussing: https://bugzilla.redhat.com/show_bug.cgi?id=1077302 |