Bug 1026274 - fail to specify "readonly=on|off" for pass-through scsi-block and emulated ide cdrom
Summary: fail to specify "readonly=on|off" for pass-through scsi-block and emulated id...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1026583
TreeView+ depends on / blocked
 
Reported: 2013-11-04 10:15 UTC by Sibiao Luo
Modified: 2013-11-11 02:09 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1026583 (view as bug list)
Environment:
Last Closed: 2013-11-05 11:16:52 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Sibiao Luo 2013-11-04 10:15:32 UTC
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:

Comment 1 Sibiao Luo 2013-11-05 02:19:44 UTC
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.

Comment 2 Sibiao Luo 2013-11-05 02:59:16 UTC
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.

Comment 3 Sibiao Luo 2013-11-05 05:58:26 UTC
Also hit it with emulated ide cdrom, but the emulated ide hard disk not met it. So, i modify the issue title.

Comment 4 Paolo Bonzini 2013-11-05 11:16:52 UTC
Not a bug; media=cdrom implies readonly=on.

Comment 5 Sibiao Luo 2013-11-08 08:49:13 UTC
(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

Comment 6 Paolo Bonzini 2013-11-08 09:46:34 UTC
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.

Comment 7 Sibiao Luo 2013-11-11 02:09:27 UTC
(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.


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