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

Add example script for dealing with events

Signed-off-by: 's avatarDaniel P. Berrange <>
parent 83b68785
use Sys::Virt;
use Sys::Virt::Event;
my $uri = shift @ARGV;
my $quit = 0;
my $c = Sys::Virt->new(uri => $uri, readonly => 1);
sub lifecycle_event {
my $dom = shift;
my $event = shift;
my $detail = shift;
print "$dom $event $detail\n";
sub {
my $con = shift ;
my $reason = shift ;
print "Closed reason=$reason\n";
$quit = 1;
while (!$quit) {
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