[PATCH 3/3] qemuBlockJobRefreshJobs: Warn readers that 'job' may be invalid after update

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

 



Add a comment noting that job update can cause the pointer to be invalid
and thus should not be accessed after.

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

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 6576f8721f..2032c0c1c5 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -571,6 +571,7 @@ qemuBlockJobRefreshJobs(virQEMUDriverPtr driver,

         if (job->newstate != -1)
             qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE);
+        /* 'job' may be invalid after this update */
     }

     /* remove data for job which qemu didn't report (the algorithm is
-- 
2.24.1





[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