public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 1/2] swtpm: enable logging
Date: Wed, 18 Jan 2023 13:21:08 +0100	[thread overview]
Message-ID: <20230118122109.304270-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20230118122109.304270-1-f.ebner@proxmox.com>

AFAICT, previously, errors from swtpm would not show up in any logs,
because they were just printed to the stderr of the daemonized
invocation here.

The 'truncate' option is not used, so that the log is not immediately
lost when a new instance is started. This increases the chance that
the relevant errors are still present when requesting the log from a
user.

Log level 1 contains the most relevant errors and seems to be quiet
for working-as-expected invocations. Log level 2 already includes
logging full TPM commands, some of which are 1024 bytes long. Thus,
log level 1 was chosen.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index c2f5726e..97d60e2d 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3263,6 +3263,8 @@ sub start_swtpm {
 	"file=$paths->{pid}",
 	"--terminate", # terminate on QEMU disconnect
 	"--daemon",
+	"--log",
+	"file=/run/qemu-server/$vmid-swtpm.log,level=1",
     ];
     push @$emulator_cmd, "--tpm2" if $tpm->{version} eq 'v2.0';
     run_command($emulator_cmd, outfunc => sub { print $1; });
-- 
2.30.2





  parent reply	other threads:[~2023-01-18 12:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 12:21 [pve-devel] [PATCH-SERIES swtpm/qemu-server] Improve swtpm logging Fiona Ebner
2023-01-18 12:21 ` [pve-devel] [PATCH swtpm 1/1] control channel: add error logs upon receiving short input Fiona Ebner
2023-01-18 12:21 ` Fiona Ebner [this message]
2023-01-18 12:21 ` [pve-devel] [PATCH qemu-server 2/2] swtpm: use start time as prefix for logging Fiona Ebner
2023-02-23 15:19 ` [pve-devel] applied-series: [PATCH-SERIES swtpm/qemu-server] Improve swtpm logging Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230118122109.304270-3-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal