[pve-devel] [PATCH qemu-server v2] create_disks: disallow adding of non-raw tpmstate0 volumes
    Fabian Grünbichler 
    f.gruenbichler at proxmox.com
       
    Thu Dec 12 11:28:48 CET 2024
    
    
  
when creating new ones, we already force raw as format, but adding existing
volumes as tpmstate0 had no such checks.
Suggested-by: Fiona Ebner <f.ebner at proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
Notes:
    v2: addressed nits by Fiona, thanks!
 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";
 		}
 	    }
 
-- 
2.39.5
    
    
More information about the pve-devel
mailing list