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.

Bug 953070

Summary: QMP: DEVICE_TRAY_MOVED with tray-open=true is emitted twice on floppy change
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: qemu-kvmAssignee: Ademar Reis <areis>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, chayang, flang, hhuang, juzhang, knoel, michen, pbonzini, qzhang, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1025219 (view as bug list) Environment:
Last Closed: 2013-12-10 18:31:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1025219    

Description Sibiao Luo 2013-04-17 09:49:10 UTC
Description of problem:
boot guest with a floppy, then do change the floppy, the QMP will have twice 'tray-open'. 

Version-Release number of selected component (if applicable):
host info:
kernel-3.9.0-0.rc6.51.el7.x86_64
qemu-kvm-1.4.0-2.el7.x86_64
seabios-1.7.2-0.2.gita810e4e7.el7.x86_64
guest info:
kernel-3.9.0-0.rc6.51.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot guest with a floppy.
e.g:...-drive file=/home/floppy1.vfd,if=none,id=drive-fdc0-0-0,format=qcow2 -global isa-fdc.driveA=drive-fdc0-0-0
2.do eject/change the floppy.
{"execute":"eject","arguments":{"device":"drive-fdc0-0-0"}}
{"execute":"change","arguments":{"device":"drive-fdc0-0-0","target":"/home/floppy1.vfd"}}
3.change the floppy.
{"execute":"change","arguments":{"device":"drive-fdc0-0-0","target":"/home/floppy2.vfd"}}
  
Actual results:
after step 2, 
{"execute":"eject","arguments":{"device":"drive-fdc0-0-0"}}
{"timestamp": {"seconds": 1366191346, "microseconds": 831858}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-fdc0-0-0", "tray-open": true}}
{"return": {}}
{"execute":"change","arguments":{"device":"drive-fdc0-0-0","target":"/home/floppy1.vfd"}}
{"timestamp": {"seconds": 1366191349, "microseconds": 458005}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-fdc0-0-0", "tray-open": true}}
{"timestamp": {"seconds": 1366191349, "microseconds": 459138}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-fdc0-0-0", "tray-open": true}}
{"timestamp": {"seconds": 1366191349, "microseconds": 459525}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-fdc0-0-0", "tray-open": false}}
{"return": {}}
after step 3,
{"execute":"change","arguments":{"device":"drive-fdc0-0-0","target":"/home/floppy2.vfd"}}
{"timestamp": {"seconds": 1366191476, "microseconds": 448006}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-fdc0-0-0", "tray-open": true}}
{"timestamp": {"seconds": 1366191476, "microseconds": 449114}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-fdc0-0-0", "tray-open": true}}
{"timestamp": {"seconds": 1366191476, "microseconds": 449453}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "drive-fdc0-0-0", "tray-open": false}}
{"return": {}}

Expected results:
once "tray-open" is ok, not to have twice.

Additional info:
# /usr/libexec/qemu-kvm -S -M q35 -cpu Opteron_G2 -enable-kvm -m 4096 -smp 4,sockets=2,cores=2,threads=1 -no-kvm-pit-reinjection -name sluo-test -uuid 389d06a7-ed31-4fae-baf4-87bdb9b5594e -rtc base=localtime,clock=host,driftfix=slew -readconfig /home/ich9-ehci-uhci.cfg -device usb-tablet,id=tablet0 -device pci-bridge,bus=pcie.0,id=bridge1,chassis_nr=1,addr=0x3 -device virtio-serial-pci,id=virtio-serial0,max_ports=16,vectors=0,bus=bridge1,addr=0x4,ioeventfd=off -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=com.redhat.rhevm.vdsm,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm,id=port2 -drive file=/home/rhel7u64.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=threads,werror=stop,rerror=stop,serial=QEMU-DISK1 -device virtio-blk-pci,scsi=on,bus=bridge1,addr=0x5,drive=drive-system-disk,id=system-disk,bootindex=1,ioeventfd=off -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,id=e1000-net-pci0,mac=00:22:19:27:54:3a,bus=bridge1,addr=0x6,bootindex=2 -device virtio-balloon-pci,id=ballooning,bus=bridge1,addr=0x7 -drive file=/home/usb-storage.qcow2,if=none,id=drive-storage,media=disk,cache=none,format=qcow2 -device usb-storage,drive=drive-storage,id=usb-storage -drive file=/home/my-data-disk.qcow2,if=none,id=drive-data-disk,format=qcow2,cache=none,aio=threads,werror=stop,rerror=stop,serial=QEMU-DISK2 -device virtio-blk-pci,scsi=on,bus=bridge1,addr=0x9,drive=drive-data-disk,id=data-disk,physical_block_size=4096,logical_block_size=512 -qmp tcp:0:4444,server,nowait -k en-us -boot menu=on -vnc :1 -spice disable-ticketing,port=5931 -vga cirrus -monitor stdio -serial unix:/tmp/ttyS0,server,nowait -drive file=/home/floppy1.vfd,if=none,id=drive-fdc0-0-0,format=qcow2 -global isa-fdc.driveA=drive-fdc0-0-0

Comment 1 Sibiao Luo 2013-04-17 09:51:25 UTC
(In reply to comment #0)
>
> Expected results:
> once "tray-open" is ok, not to have twice.
> 
once "tray-open": true and once "tray-open": false, no need twice "tray-open": true.

Comment 2 Luiz Capitulino 2013-04-18 20:23:13 UTC
This also happens upstream and is likely to be the issue which causes the DEVICE_MOVED event to be emitted on guest shutdown.

Will work on this upstream, thanks for reporting.

Comment 3 Luiz Capitulino 2013-07-15 19:58:09 UTC
Pavel is working on a similar bug, re-assigning to him.

Comment 4 Ademar Reis 2013-12-10 18:31:28 UTC
Harmless and won't affect users, as we won't support QMP direct usage.