Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
f5504bc2
Commit
f5504bc2
authored
Apr 06, 2021
by
Francesc Guasch
Browse files
refactor(volumes): retry clone volume when locked
parent
e3752ee9
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada/Volume/QCOW2.pm
View file @
f5504bc2
...
...
@@ -71,13 +71,18 @@ sub clone($self, $file_clone) {
confess
if
$file_clone
=~
/ISO/i
;
my
$base_format
=
lc
(
Ravada::Volume::
_type_from_file
(
$self
->
file
,
$self
->
vm
));
my
@cmd
=
(
$QEMU_IMG
,'
create
'
,'
-F
',
$base_format
,'
-f
','
qcow2
'
,"
-b
",
$self
->
file
,
$file_clone
);
my
(
$out
,
$err
)
=
$self
->
vm
->
run_command
(
@cmd
);
my
(
$out
,
$err
);
for
(
1
..
3
)
{
my
@cmd
=
(
$QEMU_IMG
,'
create
'
,'
-F
',
$base_format
,'
-f
','
qcow2
'
,"
-b
",
$self
->
file
,
$file_clone
);
(
$out
,
$err
)
=
$self
->
vm
->
run_command
(
@cmd
);
last
if
!
$err
||
$err
!~
/Failed to get .*lock/
;
sleep
1
;
}
confess
$self
->
vm
->
name
.
"
"
.
$err
if
$err
;
return
$file_clone
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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