Skip to content

Commit 2a4e02d

Browse files
Igor Mammedovbonzini
authored andcommitted
hostmem: set default prealloc_threads to valid value
Commit 4ebc74d removed default prealloc_threads initialization by mistake, and that makes QEMU crash with division on zero at numpages_per_thread = numpages / memset_num_threads; when QEMU is started with following backend -object memory-backend-ram,id=ram-node0,prealloc=yes,size=128M Return back initialization removed by 4ebc74d to fix issue. Fixes: 4ebc74d Reported-by: Raphael Norwitz <[email protected]> Signed-off-by: Igor Mammedov <[email protected]> Reviewed-by: Laurent Vivier <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 267514b commit 2a4e02d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

backends/hostmem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ static void host_memory_backend_init(Object *obj)
280280
/* TODO: convert access to globals to compat properties */
281281
backend->merge = machine_mem_merge(machine);
282282
backend->dump = machine_dump_guest_core(machine);
283+
backend->prealloc_threads = 1;
283284
}
284285

285286
static void host_memory_backend_post_init(Object *obj)

0 commit comments

Comments
 (0)