mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 14:35:25 +00:00
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:
parent
49ea62e51d
commit
016584c52c
@ -129,7 +129,7 @@ qemuBlockJobDataNew(qemuBlockJobType type,
|
|||||||
* xml (if @savestatus is true).
|
* xml (if @savestatus is true).
|
||||||
*
|
*
|
||||||
* Note that if @job also references a separate chain e.g. for disk mirroring,
|
* 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
|
int
|
||||||
qemuBlockJobRegister(qemuBlockJobDataPtr job,
|
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:
|
* qemuBlockJobDiskGetJob:
|
||||||
* @disk: disk definition
|
* @disk: disk definition
|
||||||
|
@ -134,10 +134,6 @@ qemuBlockJobDiskNew(virDomainObjPtr vm,
|
|||||||
const char *jobname)
|
const char *jobname)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
|
||||||
|
|
||||||
void
|
|
||||||
qemuBlockJobDiskRegisterMirror(qemuBlockJobDataPtr job)
|
|
||||||
ATTRIBUTE_NONNULL(1);
|
|
||||||
|
|
||||||
qemuBlockJobDataPtr
|
qemuBlockJobDataPtr
|
||||||
qemuBlockJobDiskNewPull(virDomainObjPtr vm,
|
qemuBlockJobDiskNewPull(virDomainObjPtr vm,
|
||||||
virDomainDiskDefPtr disk,
|
virDomainDiskDefPtr disk,
|
||||||
|
@ -2976,7 +2976,7 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObjPtr vm,
|
|||||||
job->disk = disk;
|
job->disk = disk;
|
||||||
|
|
||||||
if (mirror)
|
if (mirror)
|
||||||
qemuBlockJobDiskRegisterMirror(job);
|
job->mirrorChain = virObjectRef(job->disk->mirror);
|
||||||
|
|
||||||
qemuDomainObjPrivateXMLParseBlockjobDataSpecific(job, ctxt);
|
qemuDomainObjPrivateXMLParseBlockjobDataSpecific(job, ctxt);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user