From: Daniel Veillard Date: Thu, 7 Jan 2010 13:48:06 +0000 (+0100) Subject: Qemu: ask for memory preallocation with large pages X-Git-Tag: v0.7.6~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edcae5a7c4ce05dacd4e475e2b94cc65bb2beff8;p=thirdparty%2Flibvirt.git Qemu: ask for memory preallocation with large pages The -mem-prealloc flag should be used when using large pages This ensures qemu tries to allocate all required memory immediately, rather than when first used. The latter mode will crash qemu if hugepages aren't available when accessed, while the former should gracefully fallback to non-hugepages. * src/qemu/qemu_conf.c: add -mem-prealloc flag to qemu command line when using large pages --- diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 824055f3ca..d3da7768d2 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -2108,6 +2108,7 @@ int qemudBuildCommandLine(virConnectPtr conn, def->emulator); goto error; } + ADD_ARG_LIT("-mem-prealloc"); ADD_ARG_LIT("-mem-path"); ADD_ARG_LIT(driver->hugepage_path); }