mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-04-28 20:53:27 +00:00
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.ebner@proxmox.com>
This commit is contained in:
parent
d1b25a2267
commit
2cf203194b
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user