]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: fix --smbios
authorLuca Boccassi <luca.boccassi@gmail.com>
Sun, 17 Aug 2025 23:34:22 +0000 (00:34 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 18 Aug 2025 06:37:43 +0000 (15:37 +0900)
The file used to pass credentials gets created and then immediately deleted:

$ systemd-vmspawn -i image.raw -s "io.systemd.credential.binary:tty.serial.hvc0.agetty.autologin=cm9vdA=="
░ Spawning VM opensuse-2025081621.1 on /tmp/image.raw.
░ Press Ctrl-] three times within 1s to kill VM.
Not overwriting existing state file.
Listening on /run/user/1000/systemd/vmspawn.1c00857c6a3dc2c7/tpm.sock as 3.
qemu-system-x86_64: -smbios type=11,path=/var/tmp/vmspawn-smbios-Hizb4A/.#smbios11e5a842e77d7b4b68: Could not open '/var/tmp/vmspawn-smbios-Hizb4A/.#smbios11e5a842e77d7b4b68': No such file or directory

Follow-up for a79e94aa58a1b112d95ae27e4931bf5a8817ef05

src/vmspawn/vmspawn.c

index f8d9a21b2c537b9550d85d41d2575b0a7d825e9c..544710d31078aa4eeb4dcd8d28e3b99fd6b248f5 100644 (file)
@@ -1128,6 +1128,8 @@ static int cmdline_add_smbios11(char ***cmdline, const char* smbios_dir) {
 
                 if (strv_extendf(cmdline, "type=11,path=%s", p) < 0)
                         return log_oom();
+
+                p = mfree(p);
         }
 
         return 0;