]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: actually pass UUID down to qemu
authorLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2024 13:47:57 +0000 (14:47 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2024 21:23:45 +0000 (22:23 +0100)
qemu then adds this to SMBIOS product uuid, and we can actually read it
from the payload.

Followup for b0dc766852b2022080f123ac52aa90f2692c12e2

src/vmspawn/vmspawn.c

index ff6b3cdacd839295a61dbf5cdcfb6da0d4011dd2..6197f00a3c10c15dc5ab0f0b59cba3fd8ba33b0c 100644 (file)
@@ -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");