X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=exec.c;h=50ea9c5aaa8f2ad732793b91625194f781e8e24f;hb=4bb4a2732e097cd20594bab9039fcba9fac0b31f;hp=4e734770c20fe1a0a9b5b28d4a56b4d90f50ff0a;hpb=8482ff2eb3bb95020eb2f370a9b3ea26511e41df;p=mirror_qemu.git diff --git a/exec.c b/exec.c index 4e734770c2..50ea9c5aaa 100644 --- a/exec.c +++ b/exec.c @@ -16,7 +16,9 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see . */ + #include "qemu/osdep.h" +#include "qemu-common.h" #include "qapi/error.h" #include "qemu/cutils.h" @@ -32,6 +34,7 @@ #endif #include "sysemu/kvm.h" #include "sysemu/sysemu.h" +#include "sysemu/tcg.h" #include "qemu/timer.h" #include "qemu/config-file.h" #include "qemu/error-report.h" @@ -1871,6 +1874,7 @@ static void *file_ram_alloc(RAMBlock *block, bool truncate, Error **errp) { + MachineState *ms = MACHINE(qdev_get_machine()); void *area; block->page_size = qemu_fd_getpagesize(fd); @@ -1927,7 +1931,7 @@ static void *file_ram_alloc(RAMBlock *block, } if (mem_prealloc) { - os_mem_prealloc(fd, area, memory, smp_cpus, errp); + os_mem_prealloc(fd, area, memory, ms->smp.cpus, errp); if (errp && *errp) { qemu_ram_munmap(fd, area, memory); return NULL;