[pve-devel] applied: [PATCH v5 qemu-server 01/12] memory: rename qemu_dimm_list to qemu_memdevices_list

Fiona Ebner f.ebner at proxmox.com
Fri Mar 17 14:38:56 CET 2023


Am 24.02.23 um 13:09 schrieb Alexandre Derumier:
> current qemu_dimm_list can return any kind of memory devices.
> 
> make it more generic, with an optionnal type device
> 
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
>  PVE/QemuServer/Memory.pm | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/PVE/QemuServer/Memory.pm b/PVE/QemuServer/Memory.pm
> index 8984821..7ad8fcb 100644
> --- a/PVE/QemuServer/Memory.pm
> +++ b/PVE/QemuServer/Memory.pm
> @@ -240,7 +240,7 @@ sub qemu_memory_hotplug {
>  		while (1) {
>  		    eval { PVE::QemuServer::qemu_devicedel($vmid, $name) };
>  		    sleep 3;
> -		    my $dimm_list = qemu_dimm_list($vmid);
> +		    my $dimm_list = qemu_memdevices_list($vmid, 'dimm');
>  		    last if !$dimm_list->{$name};
>  		    raise_param_exc({ $name => "error unplug memory module" }) if $retry > 5;
>  		    $retry++;
> @@ -255,14 +255,14 @@ sub qemu_memory_hotplug {
>      }
>  }
>  
> -sub qemu_dimm_list {
> -    my ($vmid) = @_;
> +sub qemu_memdevices_list {
> +    my ($vmid, $type) = @_;
>  
>      my $dimmarray = mon_cmd($vmid, "query-memory-devices");
>      my $dimms = {};
>  
>      foreach my $dimm (@$dimmarray) {
> -
> +        next if $type && $dimm->{data}->{id} !~ /^$type(\d+)$/;
>          $dimms->{$dimm->{data}->{id}}->{id} = $dimm->{data}->{id};
>          $dimms->{$dimm->{data}->{id}}->{node} = $dimm->{data}->{node};
>          $dimms->{$dimm->{data}->{id}}->{addr} = $dimm->{data}->{addr};

applied, thanks!





More information about the pve-devel mailing list