Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
as subject, it display 'ro=1' or "ro": true all the time no matter you specify "readonly=on|off".
About the passthrough scsi-block disk can be writed with "readonly=on", please refer to bug 993537.
Version-Release number of selected component (if applicable):
host info:
2.6.32-429.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.415.el6.x86_64
seabios-0.6.1.2-28.el6.x86_64
guest info:
2.6.32-429.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
1.insert a DVD disk to host.
2.boot guest with this dvd disk passthrough.
e.g1:...-drive file=/dev/sr0,if=none,id=drive-cdrom-disk,format=raw,media=cdrom,werror=stop,rerror=stop -device virtio-scsi-pci,bus=pci.0,addr=0x8,id=scsi0 -device scsi-block,drive=drive-cdrom-disk,bus=scsi0.0,id=cdrom-disk,bus=scsi0.0
3.boot guest with this dvd disk passthrough withe readonly=off specified.
e.g2:...-drive file=/dev/sr0,if=none,id=drive-cdrom-disk,format=raw,media=cdrom,werror=stop,rerror=stop,*readonly=off* -device virtio-scsi-pci,bus=pci.0,addr=0x8,id=scsi0 -device scsi-block,drive=drive-cdrom-disk,bus=scsi0.0,id=cdrom-disk,bus=scsi0.0
4.boot guest with this dvd disk passthrough withe readonly=on specified.
e.g3:...-drive file=/dev/sr0,if=none,id=drive-cdrom-disk,format=raw,media=cdrom,werror=stop,rerror=stop,*readonly=on* -device virtio-scsi-pci,bus=pci.0,addr=0x8,id=scsi0 -device scsi-block,drive=drive-cdrom-disk,bus=scsi0.0,id=cdrom-disk,bus=scsi0.0
Actual results:
after step 2-4, all of them display the same info about the passthrough disk.
- HMP:
(qemu) info block
...
drive-cdrom-disk: removable=0 io-status=ok file=/dev/sr0 ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
-QMP:
{"execute":"query-block"}
{"return": [...{"io-status": "ok", "device": "drive-cdrom-disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "iops_wr": 0, "ro": true, "drv": "raw", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "/dev/sr0"}, "type": "unknown"}]}
Expected results:
it should "ro=0" when specify readonly=off, and it should "ro=1" when specify readonly=on, and maybe the default value should be "ro=0".
Additional info:
No matter specify the readonly=off or readonly=on for the passthrough new blank cdrom to guest, we can burn it in the guest successfully, this maybe the bug 993537, please let me separate a new bug if not, thanks in advance.
Also tried the passthrough hard disk with the same testing as comment #0 that did not hit this issue, so this issue is just specified to the passthrough cdrom.
(In reply to Paolo Bonzini from comment #4)
> Not a bug; media=cdrom implies readonly=on.
But i have anther problem. If we need to burn the blank DVD/CD in guest which passthrough to it adding the media=cdrom, it can be burn successfully while it was readonly. Does it not a problem, any idea about it ?
Best Regards,
sluo
media=cdrom only affects whether scsi-disk "becomes" scsi-hd or scsi-cd.
To burn a CD-ROM with passthrough, you need to use scsi-block, thus there is no need to specify the "media" option.
(In reply to Paolo Bonzini from comment #6)
> media=cdrom only affects whether scsi-disk "becomes" scsi-hd or scsi-cd.
>
> To burn a CD-ROM with passthrough, you need to use scsi-block, thus there is
> no need to specify the "media" option.
Ok, good catch, thanks.