| 1 | # | ||||||||||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||||||||||
| 3 | # | ||||||||||
| 4 | |||||||||||
| 5 | package Rex::Virtualization::LibVirt::clone; | ||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use v5.14.4; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | our $VERSION = '1.16.1'; # VERSION | |||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | use Rex::Logger; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | ▶ | use Rex::Helper::Run; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | ▶ | use XML::Simple; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 20 | 0 | my ( $class, $vmname, $newname ) = @_; | |||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | unless ($vmname) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | die("You have to define the vm name!"); | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | unless ($newname) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | die("You have to define the new vm name!"); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 0 | my $connect = Rex::Config->get('virtualization')->{connect}; | |||||||||
| 31 | |||||||||||
| 32 | 0 | i_run | |||||||||
| 33 | "/usr/bin/virt-clone --connect '$connect' -o '$vmname' -n '$newname' --auto-clone"; | ||||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | 1 | 1; | |||||||||