Thomas Bechtold wrote:
Hi,
during debugging a problem[1] of Openstack Nova I recognized the following:
Doing a reboot (from inside of the VM with "reboot" command) on a kvm VM
doesn't send any lifecycle events (events debugged with [2]).
Doing the same thing with a xen VM leads to 2 events: First a
VIR_DOMAIN_EVENT_STOPPED and then a VIR_DOMAIN_EVENT_STARTED event.
Yep. Same can be said for new libxl Xen driver too.
The problem here is that for the xen case it doesn't seem to be
possible
to recognize that a reboot is ongoing.
Right. There is no VIR_DOMAIN_EVENT_REBOOTED event type.
For that reason the OpenStack
Nova component just forces the domain to stop after receiving the
VIR_DOMAIN_EVENT_STOPPED event.
Yikes!
Is it expected that the 2 drivers send different events for the same
action or a bug in qemu/xen/libvirt?
You mentioned above that the qemu driver doesn't send *any* events when
a reboot occurs within the VM. Looking at the code seems to confirm
that. We could certainly change the Xen drivers to behave similarly, but
I'd like to hear opinions from other libvirt devs. Options for resolving
this include
1. Remove emitting the events from Xen drivers
2. Add the events to qemu driver and fix nova
3. Add VIR_DOMAIN_EVENT_REBOOTED, adapt drivers to use it, and fix nova
Regards,
Jim