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

View File

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

View File

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

View File

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