From 9ed5a3371bd04ebc314547a0bbfee351cf601ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 12 Dec 2024 11:28:48 +0100 Subject: [PATCH] create_disks: disallow adding of non-raw tpmstate0 volumes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit when creating new ones, we already force raw as format, but adding existing volumes as tpmstate0 had no such checks. Suggested-by: Fiona Ebner Signed-off-by: Fabian Grünbichler --- PVE/API2/Qemu.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index c00f60d7..c7f45051 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -589,6 +589,8 @@ my sub create_disks : prototype($$$$$$$$$$$) { ) { die "$ds - cloud-init drive is already attached at '$ci_key'\n"; } + } elsif ($ds eq 'tpmstate0' && $volume_format ne 'raw') { + die "tpmstate0: volume format is '$volume_format', only 'raw' is supported!\n"; } }