test-bdrv-drain: Fix data races
This patch addresses potential data races involving access to Job fields
in the test-bdrv-drain test.
Fixes: 7253220de4 ("test-bdrv-drain: Test drain vs. block jobs")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2900
Signed-off-by: Vitalii Mordan <mordan@ispras.ru>
Message-ID: <20250402102119.3345626-1-mordan@ispras.ru>
[kwolf: Fixed up coding style and one missing atomic access]
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
61b6d9b749
commit
f8222bfba3
3 changed files with 28 additions and 13 deletions
6
job.c
6
job.c
|
|
@ -251,6 +251,12 @@ bool job_is_cancelled_locked(Job *job)
|
|||
return job->force_cancel;
|
||||
}
|
||||
|
||||
bool job_is_paused(Job *job)
|
||||
{
|
||||
JOB_LOCK_GUARD();
|
||||
return job->paused;
|
||||
}
|
||||
|
||||
bool job_is_cancelled(Job *job)
|
||||
{
|
||||
JOB_LOCK_GUARD();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue