summary refs log tree commit diff stats
path: root/migration/postcopy-ram.c
diff options
context:
space:
mode:
authorDaniil Tatianin <d-tatianin@yandex-team.ru>2025-02-12 17:39:17 +0300
committerPeter Xu <peterx@redhat.com>2025-02-12 11:36:01 -0500
commite76fadf93e4d64492206b34fd3d434b515450d2c (patch)
tree94f81ba80646b20415d05b311901eb91b7f8e979 /migration/postcopy-ram.c
parent30943e496f2b0a49357581af480bdcd74fb338f5 (diff)
downloadfocaccia-qemu-e76fadf93e4d64492206b34fd3d434b515450d2c.tar.gz
focaccia-qemu-e76fadf93e4d64492206b34fd3d434b515450d2c.zip
os: add an ability to lock memory on_fault
This will be used in the following commits to make it possible to only
lock memory on fault instead of right away.

Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Link: https://lore.kernel.org/r/20250212143920.1269754-2-d-tatianin@yandex-team.ru
[peterx: fail os_mlock(on_fault=1) when not supported]
[peterx: use G_GNUC_UNUSED instead of "(void)on_fault", per Dan]
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/postcopy-ram.c')
-rw-r--r--migration/postcopy-ram.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 6a6da6ba7f..fc4d8a10df 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -652,7 +652,7 @@ int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
     }
 
     if (enable_mlock) {
-        if (os_mlock() < 0) {
+        if (os_mlock(false) < 0) {
             error_report("mlock: %s", strerror(errno));
             /*
              * It doesn't feel right to fail at this point, we have a valid