mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: process: Fix alias for disk-tray-moved event
Currently we'd report the alias of the drive which is backing the cdrom rather than the device itself: $ virsh event ds tray-change --loop event 'tray-change' for domain ds disk drive-ide0-0-1: opened event 'tray-change' for domain ds disk drive-ide0-0-1: closed Report the disk device alias as we document in the API docs: https://libvirt.org/html/libvirt-libvirt-domain.html#virConnectDomainEventTrayChangeCallback Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
cab1843914
commit
799c8c9bba
@ -1053,9 +1053,7 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
disk = qemuProcessFindDomainDiskByAlias(vm, devAlias);
|
||||
|
||||
if (disk) {
|
||||
event = virDomainEventTrayChangeNewFromObj(vm,
|
||||
devAlias,
|
||||
reason);
|
||||
event = virDomainEventTrayChangeNewFromObj(vm, disk->info.alias, reason);
|
||||
/* Update disk tray status */
|
||||
if (reason == VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN)
|
||||
disk->tray_status = VIR_DOMAIN_DISK_TRAY_OPEN;
|
||||
|
Loading…
x
Reference in New Issue
Block a user