mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
qemu: Don't give up on first error in qemuMigrationCancelDriverMirror
When cancelling drive mirror, always try to do that for all disks even if it fails for some of them. Report the first error we saw. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
5139924b8d
commit
a692277873
@ -1862,6 +1862,8 @@ static int
|
||||
qemuMigrationCancelDriveMirror(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr vm)
|
||||
{
|
||||
virErrorPtr err = NULL;
|
||||
int ret = 0;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < vm->def->ndisks; i++) {
|
||||
@ -1871,13 +1873,20 @@ qemuMigrationCancelDriveMirror(virQEMUDriverPtr driver,
|
||||
if (!diskPriv->migrating || !diskPriv->blockJobSync)
|
||||
continue;
|
||||
|
||||
if (qemuMigrationCancelOneDriveMirror(driver, vm, disk) < 0)
|
||||
return -1;
|
||||
if (qemuMigrationCancelOneDriveMirror(driver, vm, disk) < 0) {
|
||||
ret = -1;
|
||||
if (!err)
|
||||
err = virSaveLastError();
|
||||
}
|
||||
|
||||
diskPriv->migrating = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (err) {
|
||||
virSetError(err);
|
||||
virFreeError(err);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user