qemu: blockjob: Remove qemuBlockJobDiskRegisterMirror

The utility of the function is extremely limited as for block copy
we need to register the mirror chain earlier than when it's set with the
disk. This means that it would be open-coded in that case.

Avoid any weird usage and just open-code the only current usage, remove
the function, and reword the docs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-08-01 16:41:28 +02:00
parent 49ea62e51d
commit 016584c52c
3 changed files with 2 additions and 24 deletions

View File

@ -129,7 +129,7 @@ qemuBlockJobDataNew(qemuBlockJobType type,
* xml (if @savestatus is true).
*
* Note that if @job also references a separate chain e.g. for disk mirroring,
* then qemuBlockJobDiskRegisterMirror should be used separately.
* then job->mirrorchain needs to be set manually.
*/
int
qemuBlockJobRegister(qemuBlockJobDataPtr job,
@ -274,24 +274,6 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
}
/**
* qemuBlockJobDiskRegisterMirror:
* @job: block job to register 'mirror' chain on
*
* In cases when the disk->mirror attribute references a separate storage chain
* such as for block-copy, this function registers it with the job. Note
* that this function does not save the status XML and thus must be used before
* qemuBlockJobRegister or qemuBlockJobStarted to properly track the chain
* in the status XML.
*/
void
qemuBlockJobDiskRegisterMirror(qemuBlockJobDataPtr job)
{
if (job->disk)
job->mirrorChain = virObjectRef(job->disk->mirror);
}
/**
* qemuBlockJobDiskGetJob:
* @disk: disk definition

View File

@ -134,10 +134,6 @@ qemuBlockJobDiskNew(virDomainObjPtr vm,
const char *jobname)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
void
qemuBlockJobDiskRegisterMirror(qemuBlockJobDataPtr job)
ATTRIBUTE_NONNULL(1);
qemuBlockJobDataPtr
qemuBlockJobDiskNewPull(virDomainObjPtr vm,
virDomainDiskDefPtr disk,

View File

@ -2976,7 +2976,7 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObjPtr vm,
job->disk = disk;
if (mirror)
qemuBlockJobDiskRegisterMirror(job);
job->mirrorChain = virObjectRef(job->disk->mirror);
qemuDomainObjPrivateXMLParseBlockjobDataSpecific(job, ctxt);