Commit abd72ae1 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Search of a Virtual Manager of a given type

parent 751f3e1a
......@@ -440,6 +440,24 @@ sub _req_method {
return $methods{$cmd};
}
=head2 search_vm
Searches for a VM of a given type
my $vm = $ravada->search_vm('kvm');
=cut
sub search_vm {
my $self = shift;
my $type = shift;
my $class = 'Ravada::VM::'.uc($type);
for my $vm (@{$self->vm}) {
return $vm if ref($vm) eq $class;
}
return;
}
=head1 AUTHOR
......
Supports Markdown
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