| 1 | #################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # This file was generated using XDR::Parse version v1.0.1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # and LibVirt version v12.9.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | # Don't edit this file, use the source template instead | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # ANY CHANGES HERE WILL BE LOST ! | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | #################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use v5.26; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | use experimental 'signatures'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | use Future::AsyncAwait; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | ▶ | use Object::Pad; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | class Sys::Async::Virt::Connection::Factory v0.6.9; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | use Log::Any qw($log); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use Protocol::Sys::Virt::URI; # imports 'parse_url' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | our @default_drivers = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | { transport => '', class => 'Local', host => 0 }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | { transport => 'unix', class => 'Local', host => 0 }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | { transport => '', class => 'TLS', host => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | { transport => 'tls', class => 'TLS' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | { transport => 'tcp', class => 'TCP' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | { transport => 'ext', class => 'Process' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | { transport => 'ssh', class => 'SSH' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | field $_drivers :param = \@default_drivers; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | # Not documented in the POD: not a method | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 1 | ▶ | sub _cls_name($n) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_cls_name: not called CC=2 SCAR=13.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | return ($n =~ s/^\+//) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | ? $n : "Sys::Async::Virt::Connection::$n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | method create_connection( $url, %args ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_connection: not called CC=12 SCAR=50.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | my %components = parse_url( $url ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | my $transport = $components{transport} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$components{"transport"} // ""
MC/DC0%0/1
$components{"transport"} // ""
$components{"transport"}
Truth table0%0/2
A
A= $components{"transport"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | my $host = $components{host} // ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$components{"host"} // ""
MC/DC0%0/1
$components{"host"} // ""
$components{"host"}
Truth table0%0/2
A
A= $components{"host"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | for my $driver ($_drivers->@*) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | if ($transport eq $driver->{transport}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | if (defined $driver->{host}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | if (($driver->{host} and $host) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$driver->{"host"} and $host or not $driver->{"host"} || $host
$driver->{"host"} and $host
$driver->{'host'} || $host
MC/DC0%0/4
$driver->{"host"} and $host or not $driver->{"host"} || $host
$driver->{"host"}
$host
$driver->{'host'}
$host
Truth table0%0/7
A and B or not(C || D)
A= $driver->{"host"}B= $hostC= $driver->{'host'}D= $host
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | or (not $driver->{host} and not $host)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | my $c = _cls_name( $driver->{class} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | if (not eval "require $c; 1") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | die @!; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | return $c->new( url => $url, %args ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | else { # "host" not defined, so not required | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | my $c = _cls_name( $driver->{class} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | ▶ | if (not eval "require $c; 1") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | die @!; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | return $c->new( url => $url, %args ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | die $log->fatal( "No handler for: $url" ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 1 | } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||