public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Filip Schauer <f.schauer@proxmox.com>
Subject: Re: [pve-devel] [PATCH v3 qemu-server] fix #3963: Skip TPM startup for template VMs
Date: Thu, 10 Aug 2023 10:10:47 +0200	[thread overview]
Message-ID: <3682d1fe-dfd9-3359-ffc7-779f4c65f352@proxmox.com> (raw)
In-Reply-To: <20230809152418.115328-1-f.schauer@proxmox.com>

Am 09.08.23 um 17:24 schrieb Filip Schauer:
> Skip the software TPM startup when starting a template VM for performing
> a backup. This fixes an error that occurs when the TPM state disk is
> write-protected.
> 
> Signed-off-by: Filip Schauer <f.schauer@proxmox.com>

Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>

> ---
> Changes since v2:
> * Do not add the TPM to the command line arguments when VM is a template
> 
>  PVE/QemuServer.pm | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 484bc7f..aa98d5f 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -3823,7 +3823,9 @@ sub config_to_command {
>  	push @$devices, @$audio_devs;
>      }
>  

Adding a short comment here about why would be nice for future readers.

> -    add_tpm_device($vmid, $devices, $conf);
> +    if (!PVE::QemuConfig->is_template($conf)) {
> +	add_tpm_device($vmid, $devices, $conf);
> +    }

Style nit: could be done in one line by using a post-if

Nit: This also modifies the output of qm showcmd. On the one hand, it's
correct, because it is the actual command the template is started with.
On the other hand, people might expect it to be what the command for a
non-template VM with the same settings would be. But I'd say, it's fine.




      reply	other threads:[~2023-08-10  8:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 15:24 Filip Schauer
2023-08-10  8:10 ` Fiona Ebner [this message]

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=3682d1fe-dfd9-3359-ffc7-779f4c65f352@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=f.schauer@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