qemu: blockjob: Convert qemuBlockJobSyncEndDisk to take job instead of disk

And rename it in accordance with the change.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2018-11-27 18:06:28 +01:00
parent e5f704c971
commit dfe11a705c
4 changed files with 16 additions and 16 deletions

View File

@ -388,12 +388,12 @@ qemuBlockJobUpdate(virDomainObjPtr vm,
* @disk: domain disk * @disk: domain disk
* *
* Begin a new synchronous block job for @disk. The synchronous * Begin a new synchronous block job for @disk. The synchronous
* block job is ended by a call to qemuBlockJobSyncEndDisk, or by * block job is ended by a call to qemuBlockJobSyncEnd, or by
* the guest quitting. * the guest quitting.
* *
* During a synchronous block job, a block job event for @disk * During a synchronous block job, a block job event for @disk
* will not be processed asynchronously. Instead, it will be * will not be processed asynchronously. Instead, it will be
* processed only when qemuBlockJobUpdate or qemuBlockJobSyncEndDisk * processed only when qemuBlockJobUpdate or qemuBlockJobSyncEnd
* is called. * is called.
*/ */
void void
@ -411,7 +411,7 @@ qemuBlockJobSyncBegin(qemuBlockJobDataPtr job)
/** /**
* qemuBlockJobSyncEndDisk: * qemuBlockJobSyncEnd:
* @vm: domain * @vm: domain
* @disk: domain disk * @disk: domain disk
* *
@ -421,16 +421,16 @@ qemuBlockJobSyncBegin(qemuBlockJobDataPtr job)
* qemuBlockJobStartupFinalize will be called. * qemuBlockJobStartupFinalize will be called.
*/ */
void void
qemuBlockJobSyncEndDisk(virDomainObjPtr vm, qemuBlockJobSyncEnd(virDomainObjPtr vm,
int asyncJob, qemuBlockJobDataPtr job,
virDomainDiskDefPtr disk) int asyncJob)
{ {
qemuBlockJobDataPtr job = QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob; const char *diskdst = NULL;
if (!job) if (job->disk)
return; diskdst = job->disk->dst;
VIR_DEBUG("disk=%s", disk->dst); VIR_DEBUG("disk=%s", NULLSTR(diskdst));
qemuBlockJobUpdate(vm, job, asyncJob); qemuBlockJobUpdate(vm, job, asyncJob);
job->synchronous = false; job->synchronous = false;
} }

View File

@ -100,9 +100,9 @@ int qemuBlockJobUpdate(virDomainObjPtr vm,
int asyncJob); int asyncJob);
void qemuBlockJobSyncBegin(qemuBlockJobDataPtr job); void qemuBlockJobSyncBegin(qemuBlockJobDataPtr job);
void qemuBlockJobSyncEndDisk(virDomainObjPtr vm, void qemuBlockJobSyncEnd(virDomainObjPtr vm,
int asyncJob, qemuBlockJobDataPtr job,
virDomainDiskDefPtr disk); int asyncJob);
qemuBlockJobDataPtr qemuBlockJobDataPtr
qemuBlockJobGetByDisk(virDomainDiskDefPtr disk) qemuBlockJobGetByDisk(virDomainDiskDefPtr disk)

View File

@ -17456,8 +17456,8 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
} }
endjob: endjob:
if (disk) if (job && !async)
qemuBlockJobSyncEndDisk(vm, QEMU_ASYNC_JOB_NONE, disk); qemuBlockJobSyncEnd(vm, job, QEMU_ASYNC_JOB_NONE);
qemuDomainObjEndJob(driver, vm); qemuDomainObjEndJob(driver, vm);
cleanup: cleanup:

View File

@ -723,7 +723,7 @@ qemuMigrationSrcNBDCopyCancel(virQEMUDriverPtr driver,
err = virSaveLastError(); err = virSaveLastError();
failed = true; failed = true;
} }
qemuBlockJobSyncEndDisk(vm, asyncJob, disk); qemuBlockJobSyncEnd(vm, job, asyncJob);
diskPriv->migrating = false; diskPriv->migrating = false;
} }