]> git.proxmox.com Git - mirror_qemu.git/commit
util/oslib-posix: Introduce and use MemsetContext for touch_all_pages()
authorDavid Hildenbrand <david@redhat.com>
Fri, 17 Dec 2021 13:46:06 +0000 (14:46 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 7 Jan 2022 10:19:55 +0000 (05:19 -0500)
commitdba506788b0f84a45c69ee1e0100c65034edffaf
tree82c14f40de3c866e925064be207f031beee2454b
parenta384bfa32ed8d616d766cb33360011157ae2f5c7
util/oslib-posix: Introduce and use MemsetContext for touch_all_pages()

Let's minimize the number of global variables to prepare for
os_mem_prealloc() getting called concurrently and make the code a bit
easier to read.

The only consumer that really needs a global variable is the sigbus
handler, which will require protection via a mutex in the future either way
as we cannot concurrently mess with the SIGBUS handler.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20211217134611.31172-4-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
util/oslib-posix.c