summaryrefslogtreecommitdiffstats
path: root/backends
diff options
context:
space:
mode:
authorDavid Hildenbrand2022-10-14 15:47:14 +0200
committerDavid Hildenbrand2022-10-27 11:00:28 +0200
commit6556aadc18c560e493b29dd99cae2cbf86d214cb (patch)
tree7d4b15d6988db2f112fab919483a2b783ad7856a /backends
parenthw/mem/nvdimm: fix error message for 'unarmed' flag (diff)
downloadqemu-6556aadc18c560e493b29dd99cae2cbf86d214cb.tar.gz
qemu-6556aadc18c560e493b29dd99cae2cbf86d214cb.tar.xz
qemu-6556aadc18c560e493b29dd99cae2cbf86d214cb.zip
util: Cleanup and rename os_mem_prealloc()
Let's * give the function a "qemu_*" style name * make sure the parameters in the implementation match the prototype * rename smp_cpus to max_threads, which makes the semantics of that parameter clearer ... and add a function documentation. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Message-Id: <20221014134720.168738-2-david@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'backends')
-rw-r--r--backends/hostmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 4428e06738..491cb10b97 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -232,7 +232,7 @@ static void host_memory_backend_set_prealloc(Object *obj, bool value,
void *ptr = memory_region_get_ram_ptr(&backend->mr);
uint64_t sz = memory_region_size(&backend->mr);
- os_mem_prealloc(fd, ptr, sz, backend->prealloc_threads, &local_err);
+ qemu_prealloc_mem(fd, ptr, sz, backend->prealloc_threads, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
@@ -383,8 +383,8 @@ host_memory_backend_memory_complete(UserCreatable *uc, Error **errp)
* specified NUMA policy in place.
*/
if (backend->prealloc) {
- os_mem_prealloc(memory_region_get_fd(&backend->mr), ptr, sz,
- backend->prealloc_threads, &local_err);
+ qemu_prealloc_mem(memory_region_get_fd(&backend->mr), ptr, sz,
+ backend->prealloc_threads, &local_err);
if (local_err) {
goto out;
}