[libvirt] RFC: disk tray opened event and changing media API cooperation

Hi, all. I want to remove media if disk is ejected from guest. I can leverage tray opened event for it but this event generated if i change media thru API call too. Thus I can't just remove media on any such event. However it would be possible if libvirt do not propagate tray opened event that originates from qemuDomainUpdateDeviceFlags actions. On this way we need also to close tray back if it was originally closed so state visible to client is in sync with actual. I can imagine other cases when closing tray at the end of qemuDomainUpdateDeviceFlags will be useful. Say implementing a kind of changer in mgmt layer so that if guest ejects disk mgmt insert next media from some playlist. In this case tray should be closed so that guest will see that media is changed. In short I suggest: 1. close tray at the end of chaning/ejecting media 2. if tray is opened during the operation than mask this event from client Nikolay

ping On 29.06.2016 15:12, Nikolay Shirokovskiy wrote:
Hi, all.
I want to remove media if disk is ejected from guest. I can leverage tray opened event for it but this event generated if i change media thru API call too. Thus I can't just remove media on any such event. However it would be possible if libvirt do not propagate tray opened event that originates from qemuDomainUpdateDeviceFlags actions. On this way we need also to close tray back if it was originally closed so state visible to client is in sync with actual. I can imagine other cases when closing tray at the end of qemuDomainUpdateDeviceFlags will be useful. Say implementing a kind of changer in mgmt layer so that if guest ejects disk mgmt insert next media from some playlist. In this case tray should be closed so that guest will see that media is changed.
In short I suggest:
1. close tray at the end of chaning/ejecting media 2. if tray is opened during the operation than mask this event from client
Nikolay
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (1)
-
Nikolay Shirokovskiy