]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: blockjob: Remove qemuBlockJobDiskRegisterMirror
authorPeter Krempa <pkrempa@redhat.com>
Thu, 1 Aug 2019 14:41:28 +0000 (16:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 16 Aug 2019 11:26:10 +0000 (13:26 +0200)
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>
src/qemu/qemu_blockjob.c
src/qemu/qemu_blockjob.h
src/qemu/qemu_domain.c

index a5b558b9ab62a27009469abe3c49156280c57fa3..8303567aed57a8980b801036cd59f7c2870dc2d4 100644 (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
index 8139a1a324f6996daf27ef945bedb3b661ab0160..5b740db5a82ecd96537b4a8f88d70b58628d87a3 100644 (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,
index ddab76d3af916e8e541e5041be2dcab80e6054ca..5b79fc46a350f94aeaf7b0429dbb2dc480aa7fd3 100644 (file)
@@ -2976,7 +2976,7 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObjPtr vm,
     job->disk = disk;
 
     if (mirror)
-        qemuBlockJobDiskRegisterMirror(job);
+        job->mirrorChain = virObjectRef(job->disk->mirror);
 
     qemuDomainObjPrivateXMLParseBlockjobDataSpecific(job, ctxt);