mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-08 22:42:31 +00:00
cleanup: do not entry wait loop if block-job-cancel() fails.
This commit is contained in:
parent
ab6ecffe53
commit
bcc87408c0
@ -5214,13 +5214,15 @@ sub qemu_drive_mirror {
|
|||||||
|
|
||||||
};
|
};
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
eval { vm_mon_cmd($vmid, "block-job-cancel", device => "drive-$drive"); };
|
eval {
|
||||||
while (1) {
|
vm_mon_cmd($vmid, "block-job-cancel", device => "drive-$drive");
|
||||||
my $stats = vm_mon_cmd($vmid, "query-block-jobs");
|
while (1) {
|
||||||
my $stat = @$stats[0];
|
my $stats = vm_mon_cmd($vmid, "query-block-jobs");
|
||||||
last if !$stat;
|
my $stat = @$stats[0];
|
||||||
sleep 1;
|
last if !$stat;
|
||||||
}
|
sleep 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
die "mirroring error: $err";
|
die "mirroring error: $err";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user