2017-03-15 20:38:55 +01:00
|
|
|
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
|
|
|
|
Date: Sun, 15 Jan 2012 19:53:49 +0100
|
2019-01-04 22:08:16 +01:00
|
|
|
Subject: Raise soft address space limit to hard limit
|
2017-03-15 20:38:55 +01:00
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
For SLES we want users to be able to use large memory configurations
|
|
|
|
with KVM without fiddling with ulimit -Sv.
|
|
|
|
|
|
|
|
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
|
|
|
[BR: add include for sys/resource.h]
|
|
|
|
Signed-off-by: Bruce Rogers <brogers@suse.com>
|
|
|
|
---
|
|
|
|
vl.c | 12 ++++++++++++
|
|
|
|
1 file changed, 12 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/vl.c b/vl.c
|
2019-05-02 00:51:10 +02:00
|
|
|
index c696ad2a13..de43d2adf2 100644
|
2017-03-15 20:38:55 +01:00
|
|
|
--- a/vl.c
|
|
|
|
+++ b/vl.c
|
2018-08-22 16:58:18 +02:00
|
|
|
@@ -29,6 +29,7 @@
|
2017-03-15 20:38:55 +01:00
|
|
|
#include "qemu/cutils.h"
|
|
|
|
#include "qemu/help_option.h"
|
|
|
|
#include "qemu/uuid.h"
|
|
|
|
+#include <sys/resource.h>
|
2018-08-22 16:58:18 +02:00
|
|
|
#include "sysemu/seccomp.h"
|
2017-03-15 20:38:55 +01:00
|
|
|
|
2018-08-22 16:58:18 +02:00
|
|
|
#ifdef CONFIG_SDL
|
2019-05-02 00:51:10 +02:00
|
|
|
@@ -3021,6 +3022,7 @@ int main(int argc, char **argv, char **envp)
|
|
|
|
bool list_data_dirs = false;
|
|
|
|
char *dir, **dirs;
|
|
|
|
BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
|
2017-03-15 20:38:55 +01:00
|
|
|
+ struct rlimit rlimit_as;
|
|
|
|
|
|
|
|
module_call_init(MODULE_INIT_TRACE);
|
|
|
|
|
2019-05-02 00:51:10 +02:00
|
|
|
@@ -3029,6 +3031,16 @@ int main(int argc, char **argv, char **envp)
|
2018-05-01 17:20:58 +02:00
|
|
|
|
2017-03-15 20:38:55 +01:00
|
|
|
qemu_mutex_lock_iothread();
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Try to raise the soft address space limit.
|
|
|
|
+ * Default on SLES 11 SP2 is 80% of physical+swap memory.
|
|
|
|
+ */
|
|
|
|
+ getrlimit(RLIMIT_AS, &rlimit_as);
|
|
|
|
+ if (rlimit_as.rlim_cur < rlimit_as.rlim_max) {
|
|
|
|
+ rlimit_as.rlim_cur = rlimit_as.rlim_max;
|
|
|
|
+ setrlimit(RLIMIT_AS, &rlimit_as);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
atexit(qemu_run_exit_notifiers);
|
|
|
|
error_set_progname(argv[0]);
|
|
|
|
qemu_init_exec_dir(argv[0]);
|