From: Luca Boccassi Date: Sun, 17 Aug 2025 23:34:22 +0000 (+0100) Subject: vmspawn: fix --smbios X-Git-Tag: v258-rc3~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9c23bcfc498bc6b8dcc50b7fc64db3082dcc8d7;p=thirdparty%2Fsystemd.git vmspawn: fix --smbios 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 --- diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index f8d9a21b2c5..544710d3107 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -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;