|
|
38f2fd |
From 66f6a0bad6db35e654b0625d5a3fac939899c997 Mon Sep 17 00:00:00 2001
|
|
|
38f2fd |
Message-Id: <66f6a0bad6db35e654b0625d5a3fac939899c997@dist-git>
|
|
|
38f2fd |
From: Andrea Bolognani <abologna@redhat.com>
|
|
|
38f2fd |
Date: Fri, 20 Nov 2015 13:29:12 +0100
|
|
|
38f2fd |
Subject: [PATCH] qemu: Use qemuDomainRequiresMlock() in qemuBuildCommandLine()
|
|
|
38f2fd |
|
|
|
38f2fd |
This removes a duplication of the logic used to decide whether
|
|
|
38f2fd |
the memory locking limit should be set.
|
|
|
38f2fd |
|
|
|
38f2fd |
(cherry picked from commit cf9bd256556cfa1343e4438e4807625c9e1af921)
|
|
|
38f2fd |
|
|
|
38f2fd |
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1283924
|
|
|
38f2fd |
|
|
|
38f2fd |
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
|
|
38f2fd |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
38f2fd |
---
|
|
|
38f2fd |
src/qemu/qemu_command.c | 9 +++------
|
|
|
38f2fd |
1 file changed, 3 insertions(+), 6 deletions(-)
|
|
|
38f2fd |
|
|
|
38f2fd |
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
|
|
38f2fd |
index 7f8a31b..ece6081 100644
|
|
|
38f2fd |
--- a/src/qemu/qemu_command.c
|
|
|
38f2fd |
+++ b/src/qemu/qemu_command.c
|
|
|
38f2fd |
@@ -8974,7 +8974,6 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|
|
38f2fd |
int usbcontroller = 0;
|
|
|
38f2fd |
int actualSerials = 0;
|
|
|
38f2fd |
bool usblegacy = false;
|
|
|
38f2fd |
- bool mlock = false;
|
|
|
38f2fd |
int contOrder[] = {
|
|
|
38f2fd |
/*
|
|
|
38f2fd |
* List of controller types that we add commandline args for,
|
|
|
38f2fd |
@@ -9158,7 +9157,6 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|
|
38f2fd |
virCommandAddArgFormat(cmd, "mlock=%s",
|
|
|
38f2fd |
def->mem.locked ? "on" : "off");
|
|
|
38f2fd |
}
|
|
|
38f2fd |
- mlock = def->mem.locked;
|
|
|
38f2fd |
|
|
|
38f2fd |
virCommandAddArg(cmd, "-smp");
|
|
|
38f2fd |
if (!(smp = qemuBuildSmpArgStr(def, qemuCaps)))
|
|
|
38f2fd |
@@ -10850,9 +10848,6 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|
|
38f2fd |
"supported by this version of qemu"));
|
|
|
38f2fd |
goto error;
|
|
|
38f2fd |
}
|
|
|
38f2fd |
- /* VFIO requires all of the guest's memory to be locked
|
|
|
38f2fd |
- * resident */
|
|
|
38f2fd |
- mlock = true;
|
|
|
38f2fd |
}
|
|
|
38f2fd |
|
|
|
38f2fd |
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
|
|
|
38f2fd |
@@ -11146,7 +11141,9 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|
|
38f2fd |
goto error;
|
|
|
38f2fd |
}
|
|
|
38f2fd |
|
|
|
38f2fd |
- if (mlock)
|
|
|
38f2fd |
+ /* In some situations, eg. VFIO passthrough, QEMU might need to lock a
|
|
|
38f2fd |
+ * significant amount of memory, so we need to set the limit accordingly */
|
|
|
38f2fd |
+ if (qemuDomainRequiresMlock(def))
|
|
|
38f2fd |
virCommandSetMaxMemLock(cmd, qemuDomainGetMlockLimitBytes(def));
|
|
|
38f2fd |
|
|
|
38f2fd |
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MSG_TIMESTAMP) &&
|
|
|
38f2fd |
--
|
|
|
38f2fd |
2.6.3
|
|
|
38f2fd |
|