From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id EABC11FF15C for ; Fri, 17 Oct 2025 15:17:31 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AA048364A; Fri, 17 Oct 2025 15:17:51 +0200 (CEST) Mime-Version: 1.0 Date: Fri, 17 Oct 2025 15:17:18 +0200 Message-Id: Cc: "pve-devel" From: "Daniel Kral" To: "Proxmox VE development discussion" X-Mailer: aerc 0.20.0 References: <20251014143946.160679-1-f.ebner@proxmox.com> In-Reply-To: <20251014143946.160679-1-f.ebner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1760707034732 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH-SERIES qemu/swtpm/storage/qemu-server 00/16] fix #4693: drive: allow non-raw image formats for TPM state drive X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" On Tue Oct 14, 2025 at 4:39 PM CEST, Fiona Ebner wrote: > Add infrastructure for doing FUSE exports via QEMU storage daemon. > This makes it possible to use non-raw formatted volumes for the TPM > state, by exposing it to swtpm as raw via FUSE. A QEMU storage daemon > instance is associated to a given VM. > > The swtpm_setup code tries to unlink files rather than just clear the > header like it does for block devices. FUSE exports cannot be > unlinked, align the behavior to also just remove the header for files. > > To have FUSE exports available, it's necessary to enable via QEMU > build flags. > > A new standard option for VM image formats is introduced and in the > end used for the TPM state drive. The need for that also came up > already in the past for setting a format override when restoring and > it's cleaner to use what the storage layer actually supports. > > Then there's two independent improvements for qemu-server. > > For the QMP client and wrappers, the QMP peer is better abstracted and > the QEMU storage daemon is added as a possible peer. > > Blockdev code is updated to also support attaching a drive to the QEMU > storage daemon rather than just the main QEMU instance for a VM. > > Then the QSD module is introduced and handling for TPM is added. > > Finally, non-raw formats are allowed in the schema for the TPM state > drive. I have tested this for a few pre-existing and new VMs and it works like a charm, nice work! I've tested the following: - creating a VM with tpmstate0 as a raw image - creating a VM with tpmstate0 as a subvol - creating a VM with tpmstate0 as a qcow2 image - cloning a VM with tpmstate0 as a raw image - cloning a VM with tpmstate0 as a qcow2 image - templating a VM with tpmstate0 + cloning - moving qcow2 tmpstate0s between storages - converting existing raw tpmstate0 to qcow2 - converting qcow2 tpmstate0 back to raw image I installed Debian on the new VMs and used existing Debian and Windows VMs to test the templating / moving / converting ops and all of those worked as expected. As pointed out in the cover letter / swtpm patch, not applying that one will result in a failed VM start as it will try to unlink the FUSE export fs (which is exposed as a regular file). The qsd run files in /run/qemu-server/ were always cleaned up correctly (besides when sending SIGKILL to the VM's qsd process directly) and I didn't ran into qsd hanging when stopping the VM normally otherwise. I've tried my best to study the surrounding code that I didn't have much knowledge about yet (mainly setting up swtpm and the qmp cmd infrastructure), but didn't find any serious issues besides a few nits and the SIGKILL handling, so with the latter addressed consider this as: Reviewed-by: Daniel Kral Tested-by: Daniel Kral _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel