Re: [libvirt] [PATCHv2 01/62] qemu: process: Fix alias for disk-tray-moved event

2018-08-14 Thread Ján Tomko

On Mon, Aug 13, 2018 at 05:59:35PM +0200, Peter Krempa wrote:

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.



Maybe link the docs in the commit message?


Signed-off-by: Peter Krempa 
---
src/qemu/qemu_process.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)




Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCHv2 01/62] qemu: process: Fix alias for disk-tray-moved event

2018-08-13 Thread Peter Krempa
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.

Signed-off-by: Peter Krempa 
---
 src/qemu/qemu_process.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index c4e33723d1..c1a8dfda29 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -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;
-- 
2.16.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list