Am 01.10.24 um 16:08 schrieb Maximiliano Sandoval:
> This makes it so newly created VMs, e.g. with `qm create` will have the
> same default value as VMs created via the web UI.
> 
> Signed-off-by: Maximiliano Sandoval <m.sando...@proxmox.com>
> ---
> I am not entirely sure if there is side-effect that I am not taking into 
> account.
> 

This is a breaking change, because existing API callers now suddenly get
a new default. Even if it were just CLI and not API, it would be
breaking for the same reason (there are scripts using the CLI tools out
there).

If we do this, then in a major release and prominently communicate it to
all users in the release notes. And it should also be documented it in
the API schema, that creation uses another default than the schema default.

>  PVE/API2/Qemu.pm | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
> index d25a79fe..383218fd 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -1152,6 +1152,10 @@ __PACKAGE__->register_method({
>                       $conf->{vmgenid} = PVE::QemuServer::generate_uuid();
>                   }
>  
> +                 if (!defined($param->{cpu})) {
> +                     $conf->{cpu} = 'x86-64-v2-AES';
> +                 }
> +
>                   my $machine_conf = 
> PVE::QemuServer::Machine::parse_machine($conf->{machine});
>                   my $machine = $machine_conf->{type};
>                   if (!$machine || $machine =~ m/^(?:pc|q35|virt)$/) {



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

Reply via email to