[libvirt] [PATCH] qemu: Check for ejected media during startup and migration

Michal Privoznik mprivozn at redhat.com
Wed Sep 14 07:52:30 UTC 2011

On 14.09.2011 01:05, Eric Blake wrote:
> On 09/13/2011 05:03 PM, Eric Blake wrote:
>> On 09/13/2011 10:14 AM, Michal Privoznik wrote:
>>> If the daemon is restarted so we reconnect to monitor, cdrom media
>>> can be ejected. In that case we don't want to show it in domain xml,
>>> or require it on migration destination.
>>> To check for disk status use 'info block' monitor command.
>> Yuck - this is still polling-based (we have to ask qemu every time we
>> want to dumpxml). Whatever happened to the proposal of having
>> interrupt-based cdrom events, where qemu sends an event any time the
>> virtual tray changes state (whether by monitor command or
>> guest-initiated), and libvirt monitors those events to update its
>> internal state at that time, so that libvirt's internal state is always
>> accurate?
> For reference:
> https://www.redhat.com/archives/libvir-list/2011-August/msg00487.html
My patch does not touch dumpxml. It access monitor only on process
reconnect and in early migration phase. In both cases we access monitor

But I agree that events would be nicer, but I don't think they are gonna
be implemented in near future. However, even if they would have been
implemented now, we need to check the tray during process reconnect.
Because if the libvirtd was down and during this time guest ejected
cdrom and qemu sent event, we would not catch it - because we are not
running. So in order to keep things consistent, we must check tray
during startup.
Migration is the same. Even if qemu will sent events at one time, we
still need to check if we are talking to older qemu.


More information about the libvir-list mailing list