From: "Shannon Sterz" <s.sterz@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu] api: qemu: create: default cpu to x86-64-v2-AES
Date: Wed, 02 Oct 2024 09:50:31 +0200 [thread overview]
Message-ID: <D4L5MR3JJO4T.2AUGVXNCN5HL@proxmox.com> (raw)
In-Reply-To: <20241001140833.330843-1-m.sandoval@proxmox.com>
note that the gui's default is a bit "fake". it pre-sets the field to
`x86-64-v2-AES`, but if you click the little "x" next to it, the field
will be cleared and if you submit the form like that the default ends up
being `kvm64` again. this happens because the final config file does not
specify a cpu type in this case and, hence, the old default is used for
compatability reasons.
so, this effectively removes the ability to set *no* cpu type via the
cli if i'm not mistaken. might be worth considering.
On Tue Oct 1, 2024 at 4:08 PM CEST, Maximiliano Sandoval wrote:
> 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.sandoval@proxmox.com>
> ---
> I am not entirely sure if there is side-effect that I am not taking into account.
>
> 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
next prev parent reply other threads:[~2024-10-02 7:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-01 14:08 Maximiliano Sandoval
2024-10-02 7:50 ` Shannon Sterz [this message]
2024-10-22 11:23 ` Fiona Ebner
2024-10-22 11:35 ` Thomas Lamprecht
2024-10-22 12:15 ` Maximiliano Sandoval
2024-10-22 13:35 ` Thomas Lamprecht
2024-10-23 9:56 ` Fiona Ebner
2024-10-23 11:06 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D4L5MR3JJO4T.2AUGVXNCN5HL@proxmox.com \
--to=s.sterz@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox