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
262561c4
Commit
262561c4
authored
Feb 12, 2020
by
Francesc Guasch
Browse files
fix(qcow): check the volume is not in use
parent
51cc9588
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada/Volume/QCOW2.pm
View file @
262561c4
...
...
@@ -50,6 +50,13 @@ sub prepare_base($self) {
}
sub
clone
($self, $file_clone) {
my
$n
=
10
;
for
(;;)
{
my
@stat
=
stat
(
$self
->
file
);
last
if
time
-
$stat
[
9
]
||
$n
--<
0
;
sleep
1
;
die
"
Error:
"
.
$self
->
file
.
"
looks active
"
if
$n
--
<
0
;
}
my
@cmd
=
(
$QEMU_IMG
,'
create
'
,'
-f
','
qcow2
'
,"
-b
",
$self
->
file
...
...
@@ -138,14 +145,5 @@ sub block_commit($self) {
my
@cmd
=
(
$QEMU_IMG
,'
commit
','
-q
','
-d
');
my
(
$out
,
$err
)
=
$self
->
vm
->
run_command
(
@cmd
,
$self
->
file
);
warn
$err
if
$err
;
for
(;;)
{
return
if
!-
e
$self
->
file
;
my
$t0
=
time
;
my
@stat
=
stat
(
$self
->
file
);
my
$mtime
=
$stat
[
9
];
return
if
$t0
-
$mtime
>
0
;
sleep
1
;
}
}
1
;
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