public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] create_disks: forbid adding of non-raw tpmstate0 volumes
@ 2024-12-12  9:54 Fabian Grünbichler
  2024-12-12 10:16 ` Fiona Ebner
  0 siblings, 1 reply; 3+ messages in thread
From: Fabian Grünbichler @ 2024-12-12  9:54 UTC (permalink / raw)
  To: pve-devel

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>
---
 PVE/API2/Qemu.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index c00f60d7..fd2d0747 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 && $volume_format ne 'raw') {
+		    die "tpmstate0: volume format is '$volume_format', only 'raw' is supported!\n"
 		}
 	    }
 
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

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

* Re: [pve-devel] [PATCH qemu-server] create_disks: forbid adding of non-raw tpmstate0 volumes
  2024-12-12  9:54 [pve-devel] [PATCH qemu-server] create_disks: forbid adding of non-raw tpmstate0 volumes Fabian Grünbichler
@ 2024-12-12 10:16 ` Fiona Ebner
  2024-12-12 10:29   ` [pve-devel] superseded: " Fabian Grünbichler
  0 siblings, 1 reply; 3+ messages in thread
From: Fiona Ebner @ 2024-12-12 10:16 UTC (permalink / raw)
  To: Fabian Grünbichler, pve-devel

Am 12.12.24 um 10:54 schrieb Fabian Grünbichler:
> 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>
> ---
>  PVE/API2/Qemu.pm | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index c00f60d7..fd2d0747 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 && $volume_format ne 'raw') {
> +		    die "tpmstate0: volume format is '$volume_format', only 'raw' is supported!\n"

Nit: missing semicolon

checked_parse_volname() always returns a format (valid for QEMU even
:)), so no need for checking whether it is set

>  		}
>  	    }
>  



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

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

* [pve-devel] superseded: [PATCH qemu-server] create_disks: forbid adding of non-raw tpmstate0 volumes
  2024-12-12 10:16 ` Fiona Ebner
@ 2024-12-12 10:29   ` Fabian Grünbichler
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2024-12-12 10:29 UTC (permalink / raw)
  To: Fiona Ebner, pve-devel

> Fiona Ebner <f.ebner@proxmox.com> hat am 12.12.2024 11:16 CET geschrieben:
>  
> Am 12.12.24 um 10:54 schrieb Fabian Grünbichler:
> > 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>
> > ---
> >  PVE/API2/Qemu.pm | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> > index c00f60d7..fd2d0747 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 && $volume_format ne 'raw') {
> > +		    die "tpmstate0: volume format is '$volume_format', only 'raw' is supported!\n"
> 
> Nit: missing semicolon
> 
> checked_parse_volname() always returns a format (valid for QEMU even
> :)), so no need for checking whether it is set
>

thanks, sent a v2!


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

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

end of thread, other threads:[~2024-12-12 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-12  9:54 [pve-devel] [PATCH qemu-server] create_disks: forbid adding of non-raw tpmstate0 volumes Fabian Grünbichler
2024-12-12 10:16 ` Fiona Ebner
2024-12-12 10:29   ` [pve-devel] superseded: " Fabian Grünbichler

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