Bug 1025178 - QMP: "DEVICE_TRAY_MOVED" event is emitted twice when eject or change the scsi-cd cdrom
QMP: "DEVICE_TRAY_MOVED" event is emitted twice when eject or change the scsi...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.5
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Markus Armbruster
Virtualization Bugs
:
Depends On: 890012
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-31 03:45 EDT by Sibiao Luo
Modified: 2015-09-07 08:02 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-05-19 17:56:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sibiao Luo 2013-10-31 03:45:40 EDT
Description of problem:
QMP: "DEVICE_TRAY_MOVED" event is emitted twice when eject or change the scsi-cd cdrom, but the IDE cdrom did not meet such issue.
this issue a little different bug 890012 for tray-open value in HMP monitor, but they are all specified the scsi-cd.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm
2.6.32-425.el6.x86_64
qemu-kvm-0.12.1.2-2.415.el6.x86_64
guest info:
# uname -r
2.6.32-425.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot a guest with scsi-cdrom and QMP server.
e.g:...-qmp tcp:0:4444,server,nowait -drive file=/home/my-cdrom1.iso,media=cdrom,if=none,id=drive-disk1,format=raw,cache=none,aio=native -device virtio-scsi-pci,bus=pci.0,addr=0x8,id=scsi0 -device scsi-cd,bus=scsi0.0,drive=drive-disk1,id=disk1
2.connect the QMP server via nc.
$ telnet 10.16.67.29 4444
Trying 10.16.67.29...
Connected to 10.16.67.29.
Escape character is '^]'.
{"QMP": {"version": {"qemu": {"micro": 1, "minor": 12, "major": 0}, "package": "(qemu-kvm-0.12.1.2)"}, "capabilities": []}}
{"execute":"qmp_capabilities"}
{"return": {}}
3.eject and change the scsi-cd cdrom in QMP monitor.
->{"execute":"eject","arguments":{"device":"drive-disk1","force":true}}
->{"execute":"change","arguments":{"device":"drive-disk1","target":"/home/my-cdrom1.iso"}}

Actual results:
after step 3, the "DEVICE_TRAY_MOVED" event is emitted twice when eject or change the scsi-cd cdrom.
->{"execute":"eject","arguments":{"device":"drive-disk1","force":true}}
{"timestamp": {"seconds": 1383190461, "microseconds": 341709}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-disk1", "tray-open": true}}
{"return": {}}
{"timestamp": {"seconds": 1383190462, "microseconds": 525296}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-disk1", "tray-open": false}}
->{"execute":"change","arguments":{"device":"drive-disk1","target":"/home/my-cdrom1.iso"}}
{"timestamp": {"seconds": 1383190469, "microseconds": 910601}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-disk1", "tray-open": true}}
{"timestamp": {"seconds": 1383190469, "microseconds": 910845}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-disk1", "tray-open": false}}
{"return": {}}

Expected results:
the first DEVICE_TRAY_MOVED to open the tray when eject the cdrom, and the second DEVICE_TRAY_MOVED to close the tray when change the cdrom, like:
->{"execute":"eject","arguments":{"device":"drive-disk1","force":true}}
{"timestamp": {"seconds": 1383190461, "microseconds": 341709}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-disk1", "tray-open": true}}
{"return": {}}

->{"execute":"change","arguments":{"device":"drive-disk1","target":"/home/my-cdrom1.iso"}}
{"timestamp": {"seconds": 1383190469, "microseconds": 910845}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-disk1", "tray-open": false}}
{"return": {}}

Additional info:
Comment 1 Paolo Bonzini 2013-10-31 09:47:20 EDT
The patch for bug 890012 should fix this one as well.
Comment 2 RHEL Product and Program Management 2013-11-03 09:16:03 EST
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 5 Ademar Reis 2015-05-19 17:56:52 EDT
Corner case, no practical impact. Closing it as WONTFIX in RHEL6. Since there's no impact in RHEL7 either, where direct usage of QMP is not even supported, I'm not clonning it there.

Reassigning it to Markus though, who, as the QMP upstream maintainer, may have a different opinion (Markus: feel free to reopen).
Comment 6 Markus Armbruster 2015-09-07 08:02:17 EDT
As far as I can tell, upstream and RHEL-7 behave as expected.

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