[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 06/12] 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>
---
 src/qemu/qemu_blockjob.c | 20 +-------------------
 src/qemu/qemu_blockjob.h |  4 ----
 src/qemu/qemu_domain.c   |  2 +-
 3 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index a5b558b9ab..8303567aed 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -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
diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h
index 8139a1a324..5b740db5a8 100644
--- a/src/qemu/qemu_blockjob.h
+++ b/src/qemu/qemu_blockjob.h
@@ -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,
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e1da0661e6..50dc4f3764 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2976,7 +2976,7 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObjPtr vm,
     job->disk = disk;

     if (mirror)
-        qemuBlockJobDiskRegisterMirror(job);
+        job->mirrorChain = virObjectRef(job->disk->mirror);

     qemuDomainObjPrivateXMLParseBlockjobDataSpecific(job, ctxt);

-- 
2.21.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]