Bug 1026591 - remove the <"locked": false> from QMP monitor for passthrough disk (scsi-block )
remove the <"locked": false> from QMP monitor for passthrough disk (scsi-block )
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Virtualization Maintenance
Virtualization Bugs
Depends On:
Blocks: 1026595
  Show dependency treegraph
Reported: 2013-11-04 21:46 EST by Sibiao Luo
Modified: 2013-11-05 05:23 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1026595 (view as bug list)
Last Closed: 2013-11-05 05:23:15 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Sibiao Luo 2013-11-04 21:46:23 EST
Description of problem:
We have disable removeable for passthrough cdrom (scsi-block) and remove the locked and tray-open from HMP monitor infos in bug 890011. Lock status is not visible in "info block" for scsi-block, because it is not being emulated by QEMU. But there are still has <"locked": false> in QMP monitor, so i think we should remove it. 

Version-Release number of selected component (if applicable):
host info:
guest info:

How reproducible:

Steps to Reproduce:
1.insert a DVD or CD to host.
2.boot guest with this DVD/CD passthrough via scsi-block interface.
e.g:...-qmp tcp:0:4444,server,nowait -drive file=/dev/sr0,if=none,id=drive-cdrom-disk,format=raw,media=cdrom,cache=none,aio=native -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi0 -device scsi-block,drive=drive-cdrom-disk,id=cdrom-disk,bus=scsi0.0
3.compare the block info between HMP and QMP monitor.
(qemu) info block

Actual results:
after step 3,
- 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:
{"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:
we should remove the <"locked": false> from QMP monitor.

Additional info:
Comment 1 Sibiao Luo 2013-11-04 21:56:04 EST
Also tried the passthrough hard disk which hit the same issue.
e.g:...-drive file=/dev/sdb,if=none,id=drive-disk,format=raw,media=disk,cache=none,aio=native -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi0 -device scsi-block,drive=drive-disk,id=disk,bus=scsi0.0
(qemu) info block
drive-disk: removable=0 io-status=ok file=/dev/sdb ro=0 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
{"return": [...{"io-status": "ok", "device": "drive-disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "iops_wr": 0, "ro": false, "drv": "raw", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "/dev/sdb"}, "type": "unknown"}...]}

Best Regards,
Comment 3 Paolo Bonzini 2013-11-05 05:23:15 EST
For historical reasons, the "locked" field in the output of "query-block" is mandatory.  It will even be present in hard disks, for example (unlike tray-open).  So it cannot be removed.

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