libvirt/examples
Eric Blake c1ff5dc63d snapshot: better events when starting paused
There are two classes of management apps that track events - one
that only cares about on/off (and only needs to track EVENT_STARTED
and EVENT_STOPPED), and one that cares about paused/running (also
tracks EVENT_SUSPENDED/EVENT_RESUMED).  To keep both classes happy,
any transition that can go from inactive to paused must emit two
back-to-back events - one for started and one for suspended (since
later resuming of the domain will only send RESUMED, but the first
class isn't tracking that).

This also fixes a bug where virDomainCreateWithFlags with the
VIR_DOMAIN_START_PAUSED flag failed to start paused when restoring
from a managed save image.

* include/libvirt/libvirt.h.in (VIR_DOMAIN_EVENT_SUSPENDED_RESTORED)
(VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT)
(VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT): New sub-events.
* src/qemu/qemu_driver.c (qemuDomainRevertToSnapshot): Use them.
(qemuDomainSaveImageStartVM): Likewise, and add parameter.
(qemudDomainCreate, qemuDomainObjStart): Send suspended event when
starting paused.
(qemuDomainObjRestore): Add parameter.
(qemuDomainObjStart, qemuDomainRestoreFlags): Update callers.
* examples/domain-events/events-c/event-test.c
(eventDetailToString): Map new detail strings.
2011-09-02 10:00:06 -06:00
..
apparmor maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
domain-events snapshot: better events when starting paused 2011-09-02 10:00:06 -06:00
dominfo maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
domsuspend maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
hellolibvirt maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
openauth maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
python maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
systemtap maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
xml maint: add missing copyright notices 2011-07-28 15:01:17 -06:00