hostmem: set default prealloc_threads to valid value

Commit 4ebc74dbbf 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 4ebc74dbbf to fix issue.

Fixes: 4ebc74dbbf7ad50e4101629f3f5da5fdc1544051
Reported-by: Raphael Norwitz <>
Signed-off-by: Igor Mammedov <>
Reviewed-by: Laurent Vivier <>
Message-Id: <>
Signed-off-by: Paolo Bonzini <>
1 file changed