mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-12 12:10:05 +00:00
qemu_drive_mirror: correctly call block-job-cancel if block-job-complete fails
This commit is contained in:
parent
37eccdb5bc
commit
2fc6bc1722
@ -4688,6 +4688,11 @@ sub qemu_drive_mirror {
|
|||||||
$old_len = $stat->{offset};
|
$old_len = $stat->{offset};
|
||||||
sleep 1;
|
sleep 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($vmiddst == $vmid) {
|
||||||
|
# switch the disk if source and destination are on the same guest
|
||||||
|
vm_mon_cmd($vmid, "block-job-complete", device => "drive-$drive");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
eval { vm_mon_cmd($vmid, "block-job-cancel", device => "drive-$drive"); };
|
eval { vm_mon_cmd($vmid, "block-job-cancel", device => "drive-$drive"); };
|
||||||
@ -4697,9 +4702,6 @@ sub qemu_drive_mirror {
|
|||||||
if ($vmiddst != $vmid) {
|
if ($vmiddst != $vmid) {
|
||||||
# if we clone a disk for a new target vm, we don't switch the disk
|
# if we clone a disk for a new target vm, we don't switch the disk
|
||||||
vm_mon_cmd($vmid, "block-job-cancel", device => "drive-$drive");
|
vm_mon_cmd($vmid, "block-job-cancel", device => "drive-$drive");
|
||||||
} else {
|
|
||||||
#if source and destination are on the same guest
|
|
||||||
vm_mon_cmd($vmid, "block-job-complete", device => "drive-$drive");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user