qemuBlockJobRefreshJobs: Warn readers that 'job' may be invalid after update

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>
This commit is contained in:
Peter Krempa 2020-03-26 13:31:05 +01:00
parent ddce75fac0
commit 6746136a27

View 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