line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Linux::Virt; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Linux::Virt::VERSION = '0.15'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
1
|
|
|
1
|
|
167004
|
$Linux::Virt::AUTHORITY = 'cpan:TEX'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
# ABSTRACT: unified Linux virtualization wrapper |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
36
|
use 5.010_000; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
11
|
1
|
|
|
1
|
|
88032
|
use mro 'c3'; |
|
1
|
|
|
|
|
4330
|
|
|
1
|
|
|
|
|
12
|
|
12
|
1
|
|
|
1
|
|
102
|
use feature ':5.10'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
177
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
300446
|
use Moose; |
|
1
|
|
|
|
|
2714819
|
|
|
1
|
|
|
|
|
10
|
|
15
|
1
|
|
|
1
|
|
9389
|
use namespace::autoclean; |
|
1
|
|
|
|
|
1331
|
|
|
1
|
|
|
|
|
5
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# use IO::Handle; |
18
|
|
|
|
|
|
|
# use autodie; |
19
|
|
|
|
|
|
|
# use MooseX::Params::Validate; |
20
|
|
|
|
|
|
|
# use Carp; |
21
|
|
|
|
|
|
|
# use English qw( -no_match_vars ); |
22
|
1
|
|
|
1
|
|
49
|
use Try::Tiny; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
248
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# extends ... |
25
|
|
|
|
|
|
|
# has ... |
26
|
|
|
|
|
|
|
# with ... |
27
|
|
|
|
|
|
|
with 'Config::Yak::OrderedPlugins' => { -version => 0.18 }; |
28
|
|
|
|
|
|
|
# initializers ... |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
0
|
|
|
sub _plugin_base_class { return 'Linux::Virt::Plugin'; } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub vms { |
33
|
0
|
|
|
0
|
|
|
my $self = shift; |
34
|
0
|
|
|
|
|
|
my $running = shift; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my $vm_ref = {}; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
foreach my $virt ( keys %{ $self->plugins() } ) { |
|
0
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
try { |
40
|
0
|
|
|
0
|
|
|
$vm_ref->{$virt} = $self->plugins()->{$virt}->vms(); |
41
|
|
|
|
|
|
|
} catch { |
42
|
0
|
|
|
0
|
|
|
$self->logger()->log( message => 'Failed to get vms from plugin '.$virt.' w/ error: '.$_, level => 'error', ); |
43
|
0
|
|
|
|
|
|
}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
return $vm_ref; |
47
|
|
|
|
|
|
|
} ## end sub vms |
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
1
|
|
5
|
no Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
50
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=pod |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=encoding utf-8 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 NAME |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Linux::Virt - unified Linux virtualization wrapper |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 METHODS |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 vms |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Report all (supported) VMs found on the local host. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 NAME |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Linux::Virt - Linux virtualization manager |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 AUTHOR |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Dominik Schulz <dominik.schulz@gauner.org> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This software is copyright (c) 2012 by Dominik Schulz. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
83
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |