]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: enable memory pressure logic for vmspawn
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Nov 2024 11:35:18 +0000 (12:35 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 19 Nov 2024 09:12:03 +0000 (10:12 +0100)
src/vmspawn/vmspawn.c

index 9d7f943200b79a01b42ae2ae25e986a40816c110..1c49aff4a3b78bc570d7d4b8b8d60e76c07b774f 100644 (file)
@@ -2182,6 +2182,10 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) {
 
         (void) sd_event_add_signal(event, NULL, (SIGRTMIN+18) | SD_EVENT_SIGNAL_PROCMASK, sigrtmin18_handler, NULL);
 
+        r = sd_event_add_memory_pressure(event, NULL, NULL, NULL);
+        if (r < 0)
+                log_debug_errno(r, "Failed allocate memory pressure event source, ignoring: %m");
+
         /* Exit when the child exits */
         (void) event_add_child_pidref(event, NULL, &child_pidref, WEXITED, on_child_exit, NULL);