create_disks: disallow adding of non-raw tpmstate0 volumes

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@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2024-12-12 11:28:48 +01:00 committed by Fiona Ebner
parent 4182c3da78
commit 9ed5a3371b

View File

@ -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";
}
}