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 1318569 - Eject cdrom fails since tray is locked but next try succeeds
Summary: Eject cdrom fails since tray is locked but next try succeeds
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Pavel Hrdina
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-17 09:20 UTC by Pei Zhang
Modified: 2016-11-03 18:39 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.3.3-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:39:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Pei Zhang 2016-03-17 09:20:30 UTC
Description of problem:
In rhel7.2 update-device and change-media can be done once. but now it needs to execute twice.

Version-Release number of selected component (if applicable):
libvirt-1.3.2-1.el7.x86_64
qemu-kvm-rhev-2.5.0-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. define and start a guest with cdrom device.
# virsh domblklist r72
Target     Source
------------------------------------------------
hdc        /mnt/at-dt/change-media/a.iso
vda        /tmp/zp/r72.qcow2

2. eject cdrom 

# virsh change-media r72 --eject hdc 
error: Failed to complete action eject on media
error: internal error: unable to execute QEMU command 'eject': Tray of device 'drive-ide0-1-0' is not open

# virsh change-media r72 --eject hdc 
Successfully ejected media.


Actual results:
As step2, change-media eject cdrom failed at first time, succeed at the second time.

Expected results:
As the expected result as before, it should be done once. 

Additional info:
In qemu-kvm-rhev-2.5.0-2, the error message after ejecting cdrom is changed.
It is not "is locked" any more. It's "Tray of device xx is not open".
but libvirt is still checking if cdrom "is locked".
......
  if (ret < 0 && c_strcasestr(virJSONValueToString(reply, false), "is locked"))
       ret = -2;
......

Comment 2 Pavel Hrdina 2016-03-22 12:30:01 UTC
Upstream commit:

commit 0f4d31720430b4e3735064cc0d8f88a1a438e154
Author: Pavel Hrdina <phrdina>
Date:   Thu Mar 17 16:38:28 2016 +0100

    qemu-hotplug: fix eject media

Comment 3 Mike McCune 2016-03-28 23:18:47 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 5 lijuan men 2016-04-07 10:01:12 UTC
verify the bug.

version:
libvirt-1.3.3-1.el7.x86_64
qemu-kvm-rhev-2.5.0-4.el7.x86_64

step:
1.define and start a guest with cdrom:
[root@localhost ~]# virsh domblklist r7
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/r7-1.qcow2
vdd        /dev/sdb4
hda        /root/RHEL-7.2-20151030.0-Server-x86_64-dvd1.iso

2.eject cdrom 
[root@localhost ~]# virsh change-media r7 --eject hda
Successfully ejected media.

[root@localhost ~]# virsh domblklist r7
Target     Source
------------------------------------------------
vda        /var/lib/libvirt/images/r7-1.qcow2
vdd        /dev/sdb4
hda        -

Comment 7 errata-xmlrpc 2016-11-03 18:39:50 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/RHSA-2016-2577.html


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