Bug 1240310 - {"execute":"query-block"} should not show the cdrom device that have ejected
Summary: {"execute":"query-block"} should not show the cdrom device that have ejected
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: John Snow
QA Contact: FuXiangChun
URL:
Whiteboard:
Depends On: 1199407
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-06 14:13 UTC by Ademar Reis
Modified: 2016-11-07 20:26 UTC (History)
18 users (show)

Fixed In Version: qemu 2.6.0
Doc Type: Bug Fix
Doc Text:
Clone Of: 1199407
Environment:
Last Closed: 2016-11-07 20:26:41 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2673 normal SHIPPED_LIVE qemu-kvm-rhev bug fix and enhancement update 2016-11-08 01:06:13 UTC

Comment 1 John Snow 2016-06-07 22:55:39 UTC
Tested with Fedora 24 Beta Workstation for the guest.

Upstream AHCI ATAPI and IDE ATAPI behavior:

After eject, the media is still present, but tray-open is true. This is the expected behavior.

Also verified with scsi-cd using virtio-scsi-pci device as above.


It is *not expected* that the media (iso) will be absent from query-block when using a tray-model CDROM device after an eject. In much the same way that when you eject a CDROM in real life if you do not also remove the media, closing the tray will re-mount the same CDROM.

Removing the media such that it does not appear in query-block requires the use of the medium-remove command OR the legacy "eject" command.

Tray-open bug appears to have been fixed (at least) as of 2.6.0

Comment 3 Yumei Huang 2016-09-10 08:40:04 UTC
Verify:
qemu-kvm-rhev-2.6.0-23.el7
kernel-3.10.0-497.el7.x86_64

Boot guest with scsi-cd, and eject the cdrom in the guest. The media is present and the tray-open is true.

Details:
// before eject /dev/sr0
{"execute":"query-block"}
{"return": [{"io-status": "ok", "device": "drive-disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 42949672960, "filename": "/home/guest/rhel73.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": 8430391296, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "refcount-bits": 16, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "#block177", "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": true, "writeback": true}, "file": "/home/guest/rhel73.qcow2", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "ok", "device": "cdrom1", "locked": true, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 536870912, "filename": "/home/guest/iso/test.iso", "format": "raw", "actual-size": 536870912, "dirty-flag": false}, "iops_wr": 0, "ro": true, "node-name": "#block330", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": false, "writeback": true}, "file": "/home/guest/iso/test.iso", "encryption_key_missing": false}, "tray_open": false, "type": "unknown"}]}

// eject /dev/sr0  in guest
{"timestamp": {"seconds": 1473495807, "microseconds": 16589}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "cdrom1", "tray-open": true}}

{"execute":"query-block"}
{"return": [{"io-status": "ok", "device": "drive-disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 42949672960, "filename": "/home/guest/rhel73.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": 8430391296, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "refcount-bits": 16, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "node-name": "#block177", "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": true, "writeback": true}, "file": "/home/guest/rhel73.qcow2", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "ok", "device": "cdrom1", "locked": false, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 536870912, "filename": "/home/guest/iso/test.iso", "format": "raw", "actual-size": 536870912, "dirty-flag": false}, "iops_wr": 0, "ro": true, "node-name": "#block330", "backing_file_depth": 0, "drv": "raw", "iops": 0, "bps_wr": 0, "write_threshold": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "cache": {"no-flush": false, "direct": false, "writeback": true}, "file": "/home/guest/iso/test.iso", "encryption_key_missing": false}, "tray_open": true, "type": "unknown"}]}

So the bug is fixed.

Comment 5 errata-xmlrpc 2016-11-07 20:26:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2673.html


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