Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/qemu/qemu_process.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 9bbc9dc..8706de3 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8214,6 +8214,12 @@ qemuProcessRefreshLegacyBlockjobs(virQEMUDriverPtr driver,
if (virHashForEach(blockJobs, qemuProcessRefreshLegacyBlockjob, vm) < 0)
goto cleanup;
+ /*
+ * At this point we can have outdated pending events in job->newstate.
+ * These events can arise from qemu events received before we get
+ * reply to query-block-jobs command. So the code that handle legacy
+ * block job events should handle outdated events correctly.
+ */
for (i = 0; i < vm->def->ndisks; i++) {
virDomainDiskDefPtr disk = vm->def->disks[i];
qemuBlockJobDataPtr job = qemuBlockJobDiskGetJob(disk);
--
1.8.3.1