提交 8551d39f 编写于 作者: P Peter Krempa

qemu: blockcopy: Save monitor error prior to calling into lock manager

The error would be overwritten otherwise producing a meaningless error
message.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1302171
上级 0dd1f7d2
......@@ -16657,6 +16657,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
virQEMUDriverConfigPtr cfg = NULL;
const char *format = NULL;
int desttype = virStorageSourceGetActualType(mirror);
virErrorPtr monitor_error = NULL;
/* Preliminaries: find the disk we are editing, sanity checks */
virCheckFlags(VIR_DOMAIN_BLOCK_COPY_SHALLOW |
......@@ -16807,6 +16808,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
if (ret < 0) {
monitor_error = virSaveLastError();
qemuDomainDiskChainElementRevoke(driver, vm, mirror);
goto endjob;
}
......@@ -16827,6 +16829,10 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
VIR_WARN("unable to unlink just-created %s", mirror->path);
virStorageSourceFree(mirror);
qemuDomainObjEndJob(driver, vm);
if (monitor_error) {
virSetError(monitor_error);
virFreeError(monitor_error);
}
cleanup:
VIR_FREE(device);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册