public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] clone disk: force raw format for TPM state
@ 2022-02-16 10:47 Fabian Ebner
  2022-02-17 13:33 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 3+ messages in thread
From: Fabian Ebner @ 2022-02-16 10:47 UTC (permalink / raw)
  To: pve-devel

The format can't be qcow2 for TPM state, because swtpm reads the file
directly expecting raw data.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

The DiskStorageSelector in the UI hides the format for TPM state, but
still sends along format=qcow2 triggering this bug. Still, the fix
should be in the backend.

 PVE/QemuServer.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index a99f1a5..9cefcc0 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -7593,6 +7593,7 @@ sub clone_disk {
 	} elsif ($drivename eq 'efidisk0') {
 	    $size = get_efivars_size($conf);
 	} elsif ($drivename eq 'tpmstate0') {
+	    $dst_format = 'raw';
 	    $size = PVE::QemuServer::Drive::TPMSTATE_DISK_SIZE;
 	} else {
 	    ($size) = PVE::Storage::volume_size_info($storecfg, $drive->{file}, 10);
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] applied: [PATCH qemu-server] clone disk: force raw format for TPM state
  2022-02-16 10:47 [pve-devel] [PATCH qemu-server] clone disk: force raw format for TPM state Fabian Ebner
@ 2022-02-17 13:33 ` Thomas Lamprecht
  2022-02-17 13:55   ` Fabian Ebner
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Lamprecht @ 2022-02-17 13:33 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Ebner

On 16.02.22 11:47, Fabian Ebner wrote:
> The format can't be qcow2 for TPM state, because swtpm reads the file
> directly expecting raw data.
> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> 
> The DiskStorageSelector in the UI hides the format for TPM state, but
> still sends along format=qcow2 triggering this bug. Still, the fix
> should be in the backend.
> 

IMO the frontend shouldn't send that though and in a next major version the backend
should bail on that, as it can be confusing to do such things "magically".

>  PVE/QemuServer.pm | 1 +
>  1 file changed, 1 insertion(+)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] applied: [PATCH qemu-server] clone disk: force raw format for TPM state
  2022-02-17 13:33 ` [pve-devel] applied: " Thomas Lamprecht
@ 2022-02-17 13:55   ` Fabian Ebner
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Ebner @ 2022-02-17 13:55 UTC (permalink / raw)
  To: Thomas Lamprecht, Proxmox VE development discussion

Am 17.02.22 um 14:33 schrieb Thomas Lamprecht:
> On 16.02.22 11:47, Fabian Ebner wrote:
>> The format can't be qcow2 for TPM state, because swtpm reads the file
>> directly expecting raw data.
>>
>> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
>> ---
>>
>> The DiskStorageSelector in the UI hides the format for TPM state, but
>> still sends along format=qcow2 triggering this bug. Still, the fix
>> should be in the backend.
>>
> 
> IMO the frontend shouldn't send that though and in a next major version the backend
> should bail on that, as it can be confusing to do such things "magically".
> 

AFAICT the format parameter for disks is mostly (always?) treated as a
suggestion and quietly ignored if the storage doesn't support it. It
happens for clone (not limited to tpmstate0), allocation via pvesm
alloc, allocation via special <storeid>:0 syntax, importdisk.

Of course fixing the frontend for tpmstate0 still makes sense, but I
wonder if all of the above should be changed then?

>>  PVE/QemuServer.pm | 1 +
>>  1 file changed, 1 insertion(+)
>>
>>
> 
> applied, thanks!




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-17 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-16 10:47 [pve-devel] [PATCH qemu-server] clone disk: force raw format for TPM state Fabian Ebner
2022-02-17 13:33 ` [pve-devel] applied: " Thomas Lamprecht
2022-02-17 13:55   ` Fabian Ebner

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