Commit f74b52f8 authored by Daniel P. Berrange's avatar Daniel P. Berrange

Extend events example to deal with agent lifecycle events

parent 91e83ebb
......@@ -9,6 +9,7 @@ Revision history for perl module Sys::Virt
- Add support for VIR_CONNECT_DOMAIN_EVENT_ID_AGENT_LIFECYCLE
event callbacks & constants
- Fix docs for Sys::Virt::Domain::get_time method
- Demo agent lifecycle events in example program
1.2.9 2014-10-02
......
......@@ -20,10 +20,20 @@ sub lifecycle_event {
print "$dom $event $detail\n";
}
sub agent_lifecycle_event {
my $dom = shift;
my $state = shift;
my $reason = shift;
print "Agent $dom state=$state reason=$reason\n";
}
$c->domain_event_register_any(undef,
Sys::Virt::Domain::EVENT_ID_LIFECYCLE,
\&lifecycle_event);
$c->domain_event_register_any(undef,
Sys::Virt::Domain::EVENT_ID_AGENT_LIFECYCLE,
\&agent_lifecycle_event);
$c->register_close_callback(
sub {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment