liang chaojun
2022-Jul-25  05:10 UTC
Eject CD ROM medium fails with 'Tray of device is not open'
Hi Guys,
I have hit an issue on testing against our testbed, It's failed to eject
cdrom media after reboot from installed the guest OS.
The reproduce step:
  1.   Attach a block device with a ISO media and start install VM from ISO.
  2.   <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source
dev='/dev/disk/by-id/pbdx-vol-cfe60dca-c271-491b-be3c-11fa8d7625a4'
index='6'/>
      <backingStore/>
      <target dev='hda' bus='ide' tray='open'/>
      <readonly/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0'
target='0' unit='0'/>
    </disk>
  3.  After installed the OS and reboot from system disk successful.
  4.  Then I want to eject CDROM through update device with the xml like below
or using virsh tool 'virsh change-media iso_test hda --eject'
  5.  All those will failed at "internal error: unable to execute QEMU
command 'blockdev-remove-medium': Tray of device 'ide0-0-0' is
not open"
<disk type='block' device='cdrom'>
   <driver name='qemu' type='raw'/>
      <backingStore/>
      <target dev='hda' bus='ide' tray='open'/>
      <readonly/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0'
target='0' unit='0'/>
</disk>
block info looks like below:
virsh qemu-monitor-command iso_test --hmp info block
setlocale: No such file or directory
libvirt-6-format: /dev/disk/by-id/pbdx-vol-cfe60dca-c271-491b-be3c-11fa8d7625a4
(raw, read-only)
    Attached to:      ide0-0-0
    Removable device: locked, tray closed
    Cache mode:       writeback
Reproduce envrionment:
     Operating system: rhat8.4
     Architecture:x86
     kernel version:4.18.0-305
     libvirt version:v7.9.0(private build)
     Hypervisor and version:QEMU 5.1.0(private build)
  Is there any workaround?  Any comments are appreciated.
  Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://listman.redhat.com/archives/libvirt-users/attachments/20220725/09c2191d/attachment.htm>
Erik Skultety
2022-Jul-25  07:50 UTC
Eject CD ROM medium fails with 'Tray of device is not open'
On Mon, Jul 25, 2022 at 05:10:26AM +0000, liang chaojun wrote:> Hi Guys, > > I have hit an issue on testing against our testbed, It's failed to eject cdrom media after reboot from installed the guest OS.Sounds like this one: https://gitlab.com/qemu-project/qemu/-/issues/933 so it may we worth following up with it. If it's the same issue (from your description it sure looks like it) then it is a race condition in the IDE emulation in QEMU and we had to disable an upstream integration test in libvirt for the suite to stop failing :(. Regards, Erik