提交 addb82bc 编写于 作者: P Peter Krempa

qemu: blockjob: Drop unnecessary calls to qemuBlockJobSyncEndDisk

If the job wasn't started, we don't need to end the synchronous job. Add
a note and drop the unnecessary calls.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 e0c4d4fc
......@@ -392,7 +392,9 @@ qemuBlockJobSyncBeginDisk(virDomainDiskDefPtr disk)
* @disk: domain disk
*
* End a synchronous block job for @disk. Any pending block job event
* for the disk is processed.
* for the disk is processed. Note that it's not necessary to call this function
* in case the block job was not started successfully if
* qemuBlockJobStartupFinalize will be called.
*/
void
qemuBlockJobSyncEndDisk(virDomainObjPtr vm,
......
......@@ -703,10 +703,8 @@ qemuMigrationSrcNBDCopyCancel(virQEMUDriverPtr driver,
virDomainDiskDefPtr disk = vm->def->disks[i];
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
if (!diskPriv->blockjob->started) {
qemuBlockJobSyncEndDisk(vm, asyncJob, disk);
if (!diskPriv->blockjob->started)
diskPriv->migrating = false;
}
if (!diskPriv->migrating)
continue;
......@@ -929,10 +927,8 @@ qemuMigrationSrcNBDStorageCopyOne(virQEMUDriverPtr driver,
mirror_flags);
}
if (rc < 0) {
qemuBlockJobSyncEndDisk(vm, QEMU_ASYNC_JOB_MIGRATION_OUT, disk);
if (rc < 0)
goto cleanup;
}
diskPriv->migrating = true;
qemuBlockJobStarted(job);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册