From: Lennart Poettering Date: Fri, 1 Mar 2024 13:47:57 +0000 (+0100) Subject: vmspawn: actually pass UUID down to qemu X-Git-Tag: v256-rc1~680 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c046d93fee55590e7f73c2d4f5398b5ac7a32a1;p=thirdparty%2Fsystemd.git vmspawn: actually pass UUID down to qemu qemu then adds this to SMBIOS product uuid, and we can actually read it from the payload. Followup for b0dc766852b2022080f123ac52aa90f2692c12e2 --- diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index ff6b3cdacd8..6197f00a3c1 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -1190,6 +1190,10 @@ static int run_virtual_machine(int kvm_device_fd, int vhost_device_fd) { if (!cmdline) return log_oom(); + if (!sd_id128_is_null(arg_uuid)) + if (strv_extend_many(&cmdline, "-uuid", SD_ID128_TO_UUID_STRING(arg_uuid)) < 0) + return log_oom(); + /* if we are going to be starting any units with state then create our runtime dir */ if (arg_tpm != 0 || arg_directory || arg_runtime_mounts.n_mounts != 0) { r = runtime_directory(&arg_runtime_directory, arg_privileged ? RUNTIME_SCOPE_SYSTEM : RUNTIME_SCOPE_USER, "systemd/vmspawn");