util/oslib-posix: Let touch_all_pages() return an error
commit6c427ab926fd79e05ff650884babee962cdeaeb9
authorDavid Hildenbrand <david@redhat.com>
Fri, 17 Dec 2021 13:46:04 +0000 (17 14:46 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 7 Jan 2022 10:19:55 +0000 (7 05:19 -0500)
treec5bdf8081c003568106e736ae7d67cd4cf01b22c
parent0a963af3e3c12074ed93babe0b908a1bce79f84f
util/oslib-posix: Let touch_all_pages() return an error

Let's prepare touch_all_pages() for returning differing errors. Return
an error from the thread and report the last processed error.

Translate SIGBUS to -EFAULT, as a SIGBUS can mean all different kind of
things (memory error, read error, out of memory). When allocating memory
fails via the current SIGBUS-based mechanism, we'll get:
    os_mem_prealloc: preallocating memory failed: Bad address

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-2-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
util/oslib-posix.c