5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-10 01:18:01 +03:00

savevm-end : wait that savevm is finished

savevm-end is async, we need to wait that savevm is finished, before continue.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2014-11-20 14:54:10 +01:00 committed by Dietmar Maurer
parent 1b0b51ed94
commit 2c9e8036f5

View File

@ -4935,6 +4935,20 @@ sub snapshot_create {
eval { vm_mon_cmd($vmid, "savevm-end") if $running; };
warn $@ if $@;
#savevm-end is async, we need to wait
if($running) {
for(;;) {
my $stat = vm_mon_cmd_nocheck($vmid, "query-savevm");
if (!$stat->{bytes}) {
last;
} else {
print "savevm not yet finished\n";
sleep(1);
next;
}
}
}
if ($err) {
warn "snapshot create failed: starting cleanup\n";
eval { snapshot_delete($vmid, $snapname, 0, $drivehash); };