From d9c23bcfc498bc6b8dcc50b7fc64db3082dcc8d7 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 18 Aug 2025 00:34:22 +0100 Subject: [PATCH] vmspawn: fix --smbios MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.47.3