]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: add a bunch of func param assert()s
authorLennart Poettering <lennart@amutable.com>
Thu, 2 Apr 2026 21:02:40 +0000 (23:02 +0200)
committerLennart Poettering <lennart@amutable.com>
Thu, 2 Apr 2026 21:28:33 +0000 (23:28 +0200)
src/vmspawn/vmspawn.c

index 85165e1af7a98ef707ba2c5d2baddacb7b45d9a1..85104f9ea9e1e5ab252b544f5edfb91e0662731f 100644 (file)
@@ -1142,6 +1142,8 @@ static int vmspawn_dispatch_vsock_connections(sd_event_source *source, int fd, u
         sd_event *event;
         int r;
 
+        assert(source);
+        assert(fd >= 0);
         assert(userdata);
 
         if (revents != EPOLLIN) {
@@ -1328,6 +1330,7 @@ fallback:
 }
 
 static int on_child_exit(sd_event_source *s, const siginfo_t *si, void *userdata) {
+        assert(s);
         assert(si);
 
         /* Let's first do some logging about the exit status of the child. */
@@ -1364,6 +1367,9 @@ static int on_child_exit(sd_event_source *s, const siginfo_t *si, void *userdata
 static int cmdline_add_vsock(char ***cmdline, int vsock_fd) {
         int r;
 
+        assert(cmdline);
+        assert(vsock_fd >= 0);
+
         r = strv_extend(cmdline, "-smbios");
         if (r < 0)
                 return r;
@@ -1387,6 +1393,7 @@ static int cmdline_add_kernel_cmdline(char ***cmdline, const char *kernel, const
         int r;
 
         assert(cmdline);
+        assert(smbios_dir);
 
         if (strv_isempty(arg_kernel_cmdline_extra))
                 return 0;
@@ -1491,6 +1498,7 @@ static int start_tpm(
         assert(scope);
         assert(swtpm);
         assert(runtime_dir);
+        assert(sd_socket_activate);
 
         _cleanup_free_ char *scope_prefix = NULL;
         r = unit_name_to_prefix(scope, &scope_prefix);
@@ -1558,6 +1566,7 @@ static int start_systemd_journal_remote(
         int r;
 
         assert(scope);
+        assert(sd_socket_activate);
 
         _cleanup_free_ char *scope_prefix = NULL;
         r = unit_name_to_prefix(scope, &scope_prefix);