提交 016584c5 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 49ea62e5
......@@ -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
......
......@@ -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,
......
......@@ -2976,7 +2976,7 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObjPtr vm,
job->disk = disk;
if (mirror)
qemuBlockJobDiskRegisterMirror(job);
job->mirrorChain = virObjectRef(job->disk->mirror);
qemuDomainObjPrivateXMLParseBlockjobDataSpecific(job, ctxt);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册