Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
f12f1d58
Commit
f12f1d58
authored
Oct 19, 2016
by
Francesc Guasch
Browse files
Don't try to load LXC VM if we don't support it
parent
03829fee
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
f12f1d58
...
...
@@ -37,7 +37,7 @@ our $CONNECTOR;
our
$CONFIG
=
{};
our
$DEBUG
;
our
$CAN_FORK
=
1
;
our
$CAN_LXC
=
0
;
has
'
vm
'
=>
(
is
=>
'
ro
'
...
...
@@ -155,15 +155,19 @@ sub _create_vm {
my
(
$vm_kvm
,
$err_kvm
)
=
$self
->
_create_vm_kvm
();
warn
$err_kvm
if
$err_kvm
;
my
$err
=
$err_kvm
;
push
@vms
,(
$vm_kvm
)
if
$vm_kvm
;
my
$vm_lxc
;
eval
{
$vm_lxc
=
Ravada::VM::
LXC
->
new
(
connector
=>
(
$self
->
connector
or
$CONNECTOR
))
};
push
@vms
,(
$vm_lxc
)
if
$vm_lxc
;
my
$err_lxc
=
$@
;
if
(
$CAN_LXC
)
{
eval
{
$vm_lxc
=
Ravada::VM::
LXC
->
new
(
connector
=>
(
$self
->
connector
or
$CONNECTOR
))
};
push
@vms
,(
$vm_lxc
)
if
$vm_lxc
;
my
$err_lxc
=
$@
;
$err
.=
"
\n
$err_lxc
"
if
$err_lxc
;
}
if
(
!
@vms
)
{
confess
"
No VMs found:
$err
_lxc
\n
$err_kvm
\n
";
confess
"
No VMs found:
$err
\n
";
}
return
\
@vms
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment