[PATCH 2/2] qemuBlockJobEventProcess: Always clear 'mirrorState' when a job finishes

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

 



When a block job is terminated we should clear the 'mirrorState' and
'mirrorJob' variables so that stale values are not present prior to a
new job.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_blockjob.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 2a5a5e66f4..0d00dbc947 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -1691,6 +1691,10 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver,
     case QEMU_BLOCKJOB_STATE_FAILED:
     case QEMU_BLOCKJOB_STATE_CANCELLED:
     case QEMU_BLOCKJOB_STATE_CONCLUDED:
+        if (job->disk) {
+            job->disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE;
+            job->disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN;
+        }
         qemuBlockJobEventProcessConcluded(job, driver, vm, asyncJob);
         break;

-- 
2.29.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux