Bug 1211761

Summary: change-media --eject fails the first time with 'drive-ide0-0-0' is locked', but succeeds next try
Product: [Fedora] Fedora Reporter: Cole Robinson <crobinso>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: agedosier, berrange, clalancette, itamar, jforbes, laine, libvirt-maint, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-11 23:24:45 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:

Description Cole Robinson 2015-04-14 19:57:21 UTC
$ sudo virsh change-media f22-beta-livecd hda /home/crobinso/Fedora-Server-DVD-x86_64-22_Beta.iso 
succeeded to complete action update on media

[crobinso@colepc ~]$ sudo virsh change-media f22-beta-livecd hda --eject
error: Failed to complete action eject on media
error: internal error: unable to execute QEMU command 'eject': Device 'drive-ide0-0-0' is locked

[crobinso@colepc ~]$ sudo virsh change-media f22-beta-livecd hda --eject
succeeded to complete action eject on media

Sounds like this is a know deficiency of qemu:

https://bugzilla.redhat.com/show_bug.cgi?id=1147471

Comment 1 Cole Robinson 2016-04-11 23:24:45 UTC
This was fixed by

commit 256496e1499fcc7b20a51919eb4471987a36dbab
Author: Pavel Hrdina <phrdina>
Date:   Mon Jun 29 16:18:53 2015 +0200

    monitor: detect that eject fails because the tray is locked

which is in f24+