]> git.proxmox.com Git - qemu-server.git/commitdiff
swtpm: use start time as prefix for logging
authorFiona Ebner <f.ebner@proxmox.com>
Wed, 18 Jan 2023 12:21:09 +0000 (13:21 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 23 Feb 2023 11:53:25 +0000 (12:53 +0100)
to be able to distinguish different invocations.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
PVE/QemuServer.pm

index 5560168801d55213283506bec897fb94b082cd80..6bb95ee479bc8d10b4805a3e831e48d56e38d077 100644 (file)
@@ -3264,6 +3264,9 @@ sub start_swtpm {
        });
     }
 
+    # Used to distinguish different invocations in the log.
+    my $log_prefix = "[id=" . int(time()) . "] ";
+
     my $emulator_cmd = [
        "swtpm",
        "socket",
@@ -3276,7 +3279,7 @@ sub start_swtpm {
        "--terminate", # terminate on QEMU disconnect
        "--daemon",
        "--log",
-       "file=/run/qemu-server/$vmid-swtpm.log,level=1",
+       "file=/run/qemu-server/$vmid-swtpm.log,level=1,prefix=$log_prefix",
     ];
     push @$emulator_cmd, "--tpm2" if $tpm->{version} eq 'v2.0';
     run_command($emulator_cmd, outfunc => sub { print $1; });