提交 a6922778 编写于 作者: J Jiri Denemark

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: NJiri Denemark <jdenemar@redhat.com>
上级 5139924b
...@@ -1862,6 +1862,8 @@ static int ...@@ -1862,6 +1862,8 @@ static int
qemuMigrationCancelDriveMirror(virQEMUDriverPtr driver, qemuMigrationCancelDriveMirror(virQEMUDriverPtr driver,
virDomainObjPtr vm) virDomainObjPtr vm)
{ {
virErrorPtr err = NULL;
int ret = 0;
size_t i; size_t i;
for (i = 0; i < vm->def->ndisks; i++) { for (i = 0; i < vm->def->ndisks; i++) {
...@@ -1871,13 +1873,20 @@ qemuMigrationCancelDriveMirror(virQEMUDriverPtr driver, ...@@ -1871,13 +1873,20 @@ qemuMigrationCancelDriveMirror(virQEMUDriverPtr driver,
if (!diskPriv->migrating || !diskPriv->blockJobSync) if (!diskPriv->migrating || !diskPriv->blockJobSync)
continue; continue;
if (qemuMigrationCancelOneDriveMirror(driver, vm, disk) < 0) if (qemuMigrationCancelOneDriveMirror(driver, vm, disk) < 0) {
return -1; ret = -1;
if (!err)
err = virSaveLastError();
}
diskPriv->migrating = false; diskPriv->migrating = false;
} }
return 0; if (err) {
virSetError(err);
virFreeError(err);
}
return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册