mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-08 07:20:18 +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 = $@) {
|
||||
eval { vm_mon_cmd($vmid, "block-job-cancel", device => "drive-$drive"); };
|
||||
while (1) {
|
||||
my $stats = vm_mon_cmd($vmid, "query-block-jobs");
|
||||
my $stat = @$stats[0];
|
||||
last if !$stat;
|
||||
sleep 1;
|
||||
}
|
||||
eval {
|
||||
vm_mon_cmd($vmid, "block-job-cancel", device => "drive-$drive");
|
||||
while (1) {
|
||||
my $stats = vm_mon_cmd($vmid, "query-block-jobs");
|
||||
my $stat = @$stats[0];
|
||||
last if !$stat;
|
||||
sleep 1;
|
||||
}
|
||||
};
|
||||
die "mirroring error: $err";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user