cleanup: do not entry wait loop if block-job-cancel() fails.

This commit is contained in:
Dietmar Maurer 2014-11-07 15:31:56 +01:00
parent ab6ecffe53
commit bcc87408c0

View File

@ -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";
}