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>
|
|
|
|
---
|
2020-04-29 02:12:31 +02:00
|
|
|
softmmu/vl.c | 12 ++++++++++++
|
2017-03-15 20:38:55 +01:00
|
|
|
1 file changed, 12 insertions(+)
|
|
|
|
|
2020-04-29 02:12:31 +02:00
|
|
|
diff --git a/softmmu/vl.c b/softmmu/vl.c
|
2021-12-17 11:07:39 +01:00
|
|
|
index 620a1f1367e2b033bfec541619d3..527e1d91859b19351d397ef64930 100644
|
2020-04-29 02:12:31 +02:00
|
|
|
--- a/softmmu/vl.c
|
|
|
|
+++ b/softmmu/vl.c
|
2021-04-30 23:53:49 +02:00
|
|
|
@@ -40,6 +40,7 @@
|
2019-11-27 13:46:32 +01:00
|
|
|
#include "sysemu/reset.h"
|
|
|
|
#include "sysemu/runstate.h"
|
2021-04-30 23:53:49 +02:00
|
|
|
#include "sysemu/runstate-action.h"
|
2017-03-15 20:38:55 +01:00
|
|
|
+#include <sys/resource.h>
|
2018-08-22 16:58:18 +02:00
|
|
|
#include "sysemu/seccomp.h"
|
2019-09-12 17:54:03 +02:00
|
|
|
#include "sysemu/tcg.h"
|
2020-08-12 00:53:07 +02:00
|
|
|
#include "sysemu/xen.h"
|
2021-12-17 11:07:39 +01:00
|
|
|
@@ -2772,6 +2773,17 @@ void qemu_init(int argc, char **argv, char **envp)
|
2021-04-30 23:53:49 +02:00
|
|
|
MachineClass *machine_class;
|
|
|
|
bool userconfig = true;
|
|
|
|
FILE *vmstate_dump_file = NULL;
|
2017-03-15 20:38:55 +01:00
|
|
|
+ struct rlimit rlimit_as;
|
2021-04-30 23:53:49 +02:00
|
|
|
+
|
2017-03-15 20:38:55 +01:00
|
|
|
+ /*
|
|
|
|
+ * 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);
|
|
|
|
+ }
|
2019-09-12 17:54:03 +02:00
|
|
|
|
2021-04-30 23:53:49 +02:00
|
|
|
qemu_add_opts(&qemu_drive_opts);
|
|
|
|
qemu_add_drive_opts(&qemu_legacy_drive_opts);
|