tested on qemu v8.10.0-87-ga2ae3d299c and qemu-kvm-7.1.0-6.el9.x86_64
1. Start VM and then eject the CDROM in guest. Check the tray status:
# virsh qemu-monitor-command rhel-9.2 --hmp info block
libvirt-2-format: /var/lib/libvirt/images/rhel-9.2.qcow2 (qcow2)
Attached to: /machine/peripheral/virtio-disk0/virtio-backend
Cache mode: writeback
libvirt-1-format: /var/lib/libvirt/images/boot.iso (raw, read-only)
Attached to: scsi0-0-0-2
Removable device: not locked, tray open
Cache mode: writeback
2. Reboot the VM by guest, `virsh reset`, `virsh reboot`. Then check the tray status:
# virsh qemu-monitor-command rhel-9.2 --hmp info block
libvirt-2-format: /var/lib/libvirt/images/rhel-9.2.qcow2 (qcow2)
Attached to: /machine/peripheral/virtio-disk0/virtio-backend
Cache mode: writeback
The tray status is reset to locked, tray closed.
However, no tray-change event is emitted. Expect to emit the tray-change event with the reason TRAY_CLOSE.
tested on qemu v8.10.0- 87-ga2ae3d299c and qemu-kvm- 7.1.0-6. el9.x86_ 64 command rhel-9.2 --hmp info block libvirt/ images/ rhel-9. 2.qcow2 (qcow2) peripheral/ virtio- disk0/virtio- backend
1. Start VM and then eject the CDROM in guest. Check the tray status:
# virsh qemu-monitor-
libvirt-2-format: /var/lib/
Attached to: /machine/
Cache mode: writeback
libvirt-1-format: /var/lib/ libvirt/ images/ boot.iso (raw, read-only)
Attached to: scsi0-0-0-2
Removable device: not locked, tray open
Cache mode: writeback
2. Reboot the VM by guest, `virsh reset`, `virsh reboot`. Then check the tray status: command rhel-9.2 --hmp info block libvirt/ images/ rhel-9. 2.qcow2 (qcow2) peripheral/ virtio- disk0/virtio- backend
# virsh qemu-monitor-
libvirt-2-format: /var/lib/
Attached to: /machine/
Cache mode: writeback
libvirt-1-format: /var/lib/ libvirt/ images/ boot.iso (raw, read-only)
Attached to: scsi0-0-0-2
Removable device: locked, tray closed
Cache mode: writeback
The tray status is reset to locked, tray closed.
However, no tray-change event is emitted. Expect to emit the tray-change event with the reason TRAY_CLOSE.