[pve-devel] applied: [PATCH v5 qemu-server 02/12] memory: don't use foreach_reversedimm for unplug
DERUMIER, Alexandre
alexandre.derumier at groupe-cyllene.com
Fri Mar 17 17:23:14 CET 2023
Hi Fiona,
I don't have checked yet, but does I need to rebase the other virtio-
mem patches ?
Le vendredi 17 mars 2023 à 14:39 +0100, Fiona Ebner a écrit :
> Am 24.02.23 um 13:09 schrieb Alexandre Derumier:
> > simple use dimm_list() returned by qemu
> >
> > Signed-off-by: Alexandre Derumier <aderumier at 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.ebner at 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;
> >
>
More information about the pve-devel
mailing list