Am 24.02.23 um 13:09 schrieb Alexandre Derumier: > simple use dimm_list() returned by qemu > > Signed-off-by: Alexandre Derumier <aderum...@odiso.com>
Thanks! Applied with this follow-up: > memory: hotplug: sort by numerical ID rather than slot when unplugging > > While, usually, the slot should match the ID, it's not explicitly > guaranteed and relies on QEMU internals. Using the numerical ID is > more future-proof and more consistent with plugging, where no slot > information (except the maximum limit) is relied upon. > > Signed-off-by: Fiona Ebner <f.eb...@proxmox.com> > --- > PVE/QemuServer/Memory.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/PVE/QemuServer/Memory.pm b/PVE/QemuServer/Memory.pm > index 0f4229c5..0601dd6c 100644 > --- a/PVE/QemuServer/Memory.pm > +++ b/PVE/QemuServer/Memory.pm > @@ -201,7 +201,7 @@ sub qemu_memory_hotplug { > my $dimms = qemu_memdevices_list($vmid, 'dimm'); > > my $current_size = $memory; > - for my $name (sort { $dimms->{$b}->{slot} <=> $dimms->{$a}->{slot} } > keys %$dimms) { > + for my $name (sort { ($b =~ /^dimm(\d+)$/)[0] <=> ($a =~ > /^dimm(\d+)$/)[0] } keys %$dimms) { > > my $dimm_size = $dimms->{$name}->{size} / 1024 / 1024; > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel