Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1318569 - Eject cdrom fails since tray is locked but next try succeeds
Eject cdrom fails since tray is locked but next try succeeds
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.3
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Pavel Hrdina
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-17 05:20 EDT by Pei Zhang
Modified: 2016-11-03 14:39 EDT (History)
5 users (show)

See Also:
Fixed In Version: libvirt-1.3.3-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:39:50 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 08:07:06 EDT

  None (edit)
Description Pei Zhang 2016-03-17 05:20:30 EDT
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 08:30:01 EDT
Upstream commit:

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

    qemu-hotplug: fix eject media
Comment 3 Mike McCune 2016-03-28 19:18:47 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 5 lijuan men 2016-04-07 06:01:12 EDT
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 14:39:50 EDT
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.