]> git.proxmox.com Git - mirror_qemu.git/commit
jobs: add job lock in find_* functions
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Mon, 26 Sep 2022 09:32:01 +0000 (05:32 -0400)
committerKevin Wolf <kwolf@redhat.com>
Fri, 7 Oct 2022 10:11:41 +0000 (12:11 +0200)
commit962411244192a21717dcce216ec7bbc44272184c
tree714caf8f46a56202c29b391b15165da739253850
parentf41ab73fa283f4f4d79102d1c8e8bad456218751
jobs: add job lock in find_* functions

Both blockdev.c and job-qmp.c have TOC/TOU conditions, because
they first search for the job and then perform an action on it.
Therefore, we need to do the search + action under the same
job mutex critical section.

Note: at this stage, job_{lock/unlock} and job lock guard macros
are *nop*.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20220926093214.506243-9-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c
job-qmp.c