File tree Expand file tree Collapse file tree 4 files changed +19
-2
lines changed
Expand file tree Collapse file tree 4 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -485,8 +485,13 @@ sub open_vm {
485485 my $type = shift or confess " I need vm type" ;
486486 my $class = " Ravada::VM::$type " ;
487487
488- if ($VM {$type }) {
489- return $VM {$type }
488+ if (my $vm = $VM {$type }) {
489+ if (!$vm -> ping) {
490+ $vm -> disconnect();
491+ $vm -> connect ();
492+ } else {
493+ return $vm ;
494+ }
490495 }
491496
492497 my $proto = {};
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ requires 'connect';
4444requires ' disconnect' ;
4545requires ' import_domain' ;
4646
47+ requires ' ping' ;
4748# ###########################################################
4849
4950has ' host' => (
Original file line number Diff line number Diff line change @@ -1793,4 +1793,11 @@ sub import_domain {
17931793 return $domain ;
17941794}
17951795
1796+ sub ping($self ) {
1797+ return 0 if !$self ->vm;
1798+ eval { $self ->vm->list_defined_networks };
1799+ return 1 if !$@ ;
1800+ return 0;
1801+ }
1802+
179618031;
Original file line number Diff line number Diff line change @@ -148,6 +148,10 @@ sub import_domain {
148148 confess " Not implemented" ;
149149}
150150
151+ sub refresh_storage {}
152+
153+ sub ping { return 1 }
154+
151155# ########################################################################3
152156
1531571;
You can’t perform that action at this time.
0 commit comments