]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuBlockJobRefreshJobs: Warn readers that 'job' may be invalid after update
authorPeter Krempa <pkrempa@redhat.com>
Thu, 26 Mar 2020 12:31:05 +0000 (13:31 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 3 Apr 2020 07:34:49 +0000 (09:34 +0200)
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@redhat.com>
Reviewed-by: Pavel Mores <pmores@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_blockjob.c

index 6576f8721f30bcfaf0fdf3ec68b8db28787348cf..2032c0c1c5d78b9c1fa162556d7d5539d6a9855e 100644 (file)
@@ -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