From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 24D68925F3 for ; Mon, 13 Feb 2023 13:01:01 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 04F2D2241A for ; Mon, 13 Feb 2023 13:00:31 +0100 (CET) Received: from bastionodiso.odiso.net (bastionodiso.odiso.net [185.151.191.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 13 Feb 2023 13:00:29 +0100 (CET) Received: from kvmformation3.odiso.net (formationkvm3.odiso.net [10.3.94.12]) by bastionodiso.odiso.net (Postfix) with ESMTP id 4604C80E2; Mon, 13 Feb 2023 13:00:23 +0100 (CET) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id 38A3217A00B; Mon, 13 Feb 2023 13:00:23 +0100 (CET) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Mon, 13 Feb 2023 13:00:09 +0100 Message-Id: <20230213120021.3783742-5-aderumier@odiso.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230213120021.3783742-1-aderumier@odiso.com> References: <20230213120021.3783742-1-aderumier@odiso.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.080 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% HEADER_FROM_DIFFERENT_DOMAINS 0.25 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods NO_DNS_FOR_FROM 0.001 Envelope sender has no MX or A DNS records SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH v4 qemu-server 04/16] memory: remove calls to parse_hotplug_features X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2023 12:01:01 -0000 Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm | 6 ++++-- PVE/QemuServer/Memory.pm | 13 ++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index a0e16dc..97185e1 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3869,7 +3869,7 @@ sub config_to_command { push @$cmd, get_cpu_options($conf, $arch, $kvm, $kvm_off, $machine_version, $winversion, $gpu_passthrough); } - PVE::QemuServer::Memory::config($conf, $vmid, $sockets, $cores, $defaults, $hotplug_features, $cmd); + PVE::QemuServer::Memory::config($conf, $vmid, $sockets, $cores, $defaults, $hotplug_features->{memory}, $cmd); push @$cmd, '-S' if $conf->{freeze}; @@ -5902,7 +5902,9 @@ sub vm_start_nolock { if ($conf->{hugepages}) { my $code = sub { - my $hugepages_topology = PVE::QemuServer::Memory::hugepages_topology($conf); + my $hotplug_features = parse_hotplug_features(defined($conf->{hotplug}) ? $conf->{hotplug} : '1'); + my $hugepages_topology = PVE::QemuServer::Memory::hugepages_topology($conf, $hotplug_features->{memory}); + my $hugepages_host_topology = PVE::QemuServer::Memory::hugepages_host_topology(); PVE::QemuServer::Memory::hugepages_mount(); diff --git a/PVE/QemuServer/Memory.pm b/PVE/QemuServer/Memory.pm index 3899917..4812a9e 100644 --- a/PVE/QemuServer/Memory.pm +++ b/PVE/QemuServer/Memory.pm @@ -273,12 +273,12 @@ sub qemu_dimm_list { } sub config { - my ($conf, $vmid, $sockets, $cores, $defaults, $hotplug_features, $cmd) = @_; + my ($conf, $vmid, $sockets, $cores, $defaults, $hotplug, $cmd) = @_; my $memory = $conf->{memory} || $defaults->{memory}; my $static_memory = 0; - if ($hotplug_features->{memory}) { + if ($hotplug) { die "NUMA needs to be enabled for memory hotplug\n" if !$conf->{numa}; my $MAX_MEM = get_max_mem($conf); die "Total memory is bigger than ${MAX_MEM}MB\n" if $memory > $MAX_MEM; @@ -365,7 +365,7 @@ sub config { } } - if ($hotplug_features->{memory}) { + if ($hotplug) { foreach_dimm($conf, $vmid, $memory, $sockets, sub { my ($conf, $vmid, $name, $dimm_size, $numanode, $current_size, $memory) = @_; @@ -488,7 +488,7 @@ sub hugepages_size { } sub hugepages_topology { - my ($conf) = @_; + my ($conf, $hotplug) = @_; my $hugepages_topology = {}; @@ -499,9 +499,8 @@ sub hugepages_topology { my $static_memory = 0; my $sockets = $conf->{sockets} || 1; my $numa_custom_topology = undef; - my $hotplug_features = PVE::QemuServer::parse_hotplug_features(defined($conf->{hotplug}) ? $conf->{hotplug} : '1'); - if ($hotplug_features->{memory}) { + if ($hotplug) { $static_memory = $STATICMEM; $static_memory = $static_memory * $sockets if ($conf->{hugepages} && $conf->{hugepages} == 1024); } else { @@ -537,7 +536,7 @@ sub hugepages_topology { } } - if ($hotplug_features->{memory}) { + if ($hotplug) { my $numa_hostmap = get_numa_guest_to_host_map($conf); foreach_dimm($conf, undef, $memory, $sockets, sub { -- 2.30.2