all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] qemu-server: pending config: fix hotplug check
@ 2025-10-14 14:43 Hannes Duerr
  2025-10-14 14:55 ` Michael Köppl
  0 siblings, 1 reply; 3+ messages in thread
From: Hannes Duerr @ 2025-10-14 14:43 UTC (permalink / raw)
  To: pve-devel

When checking whether cpu and mem hotplug have already been set, it was
not checked whether there is already a hotplug section in the VM config,
which results in an uninitialized value error.
At the same time, remove unnecessary regex.

Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
---
 src/PVE/QemuServer.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 45daa06c..9b16d057 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -24,6 +24,7 @@ use Storable qw(dclone);
 use Time::HiRes qw(gettimeofday usleep);
 use URI::Escape;
 use UUID;
+use Data::Dumper;
 
 use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file);
 use PVE::CGroup;
@@ -4714,9 +4715,9 @@ sub vmconfig_hotplug_pending {
         eval {
             if ($opt eq 'hotplug') {
                 die "skip\n"
-                    if ($value =~ /memory/) || ($value !~ /memory/ && $conf->{hotplug} =~ /memory/);
+                    if ($value =~ /cpu/) || ($conf->{hotplug} && $conf->{hotplug} =~ /cpu/);
                 die "skip\n"
-                    if ($value =~ /cpu/) || ($value !~ /cpu/ && $conf->{hotplug} =~ /cpu/);
+                    if ($value =~ /memory/) || ($conf->{hotplug} && $conf->{hotplug} =~ /memory/);
             } elsif ($opt eq 'tablet') {
                 die "skip\n" if !$hotplug_features->{usb};
                 if ($value == 1) {
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH qemu-server] qemu-server: pending config: fix hotplug check
  2025-10-14 14:43 [pve-devel] [PATCH qemu-server] qemu-server: pending config: fix hotplug check Hannes Duerr
@ 2025-10-14 14:55 ` Michael Köppl
  2025-10-14 14:59   ` Hannes Duerr
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Köppl @ 2025-10-14 14:55 UTC (permalink / raw)
  To: Proxmox VE development discussion; +Cc: pve-devel

On Tue Oct 14, 2025 at 4:43 PM CEST, Hannes Duerr wrote:
> When checking whether cpu and mem hotplug have already been set, it was
> not checked whether there is already a hotplug section in the VM config,
> which results in an uninitialized value error.
> At the same time, remove unnecessary regex.
>
> Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
> ---
>  src/PVE/QemuServer.pm | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
> index 45daa06c..9b16d057 100644
> --- a/src/PVE/QemuServer.pm
> +++ b/src/PVE/QemuServer.pm
> @@ -24,6 +24,7 @@ use Storable qw(dclone);
>  use Time::HiRes qw(gettimeofday usleep);
>  use URI::Escape;
>  use UUID;
> +use Data::Dumper;

Leftover from debugging ;)

>  
>  use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file);
>  use PVE::CGroup;
> @@ -4714,9 +4715,9 @@ sub vmconfig_hotplug_pending {
>          eval {
>              if ($opt eq 'hotplug') {
>                  die "skip\n"
> -                    if ($value =~ /memory/) || ($value !~ /memory/ && $conf->{hotplug} =~ /memory/);
> +                    if ($value =~ /cpu/) || ($conf->{hotplug} && $conf->{hotplug} =~ /cpu/);
>                  die "skip\n"
> -                    if ($value =~ /cpu/) || ($value !~ /cpu/ && $conf->{hotplug} =~ /cpu/);
> +                    if ($value =~ /memory/) || ($conf->{hotplug} && $conf->{hotplug} =~ /memory/);
>              } elsif ($opt eq 'tablet') {
>                  die "skip\n" if !$hotplug_features->{usb};
>                  if ($value == 1) {



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH qemu-server] qemu-server: pending config: fix hotplug check
  2025-10-14 14:55 ` Michael Köppl
@ 2025-10-14 14:59   ` Hannes Duerr
  0 siblings, 0 replies; 3+ messages in thread
From: Hannes Duerr @ 2025-10-14 14:59 UTC (permalink / raw)
  To: Proxmox VE development discussion; +Cc: pve-devel

On Tue Oct 14, 2025 at 4:55 PM CEST, Michael Köppl wrote:
> On Tue Oct 14, 2025 at 4:43 PM CEST, Hannes Duerr wrote:
>> When checking whether cpu and mem hotplug have already been set, it was
>> not checked whether there is already a hotplug section in the VM config,
>> which results in an uninitialized value error.
>> At the same time, remove unnecessary regex.
>>
>> Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
>> ---
>>  src/PVE/QemuServer.pm | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
>> index 45daa06c..9b16d057 100644
>> --- a/src/PVE/QemuServer.pm
>> +++ b/src/PVE/QemuServer.pm
>> @@ -24,6 +24,7 @@ use Storable qw(dclone);
>>  use Time::HiRes qw(gettimeofday usleep);
>>  use URI::Escape;
>>  use UUID;
>> +use Data::Dumper;
>
> Leftover from debugging ;)

Thanks, send a v2
https://lore.proxmox.com/pve-devel/20251014145858.117349-1-h.duerr@proxmox.com/T/#u

>
>>  
>>  use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file);
>>  use PVE::CGroup;
>> @@ -4714,9 +4715,9 @@ sub vmconfig_hotplug_pending {
>>          eval {
>>              if ($opt eq 'hotplug') {
>>                  die "skip\n"
>> -                    if ($value =~ /memory/) || ($value !~ /memory/ && $conf->{hotplug} =~ /memory/);
>> +                    if ($value =~ /cpu/) || ($conf->{hotplug} && $conf->{hotplug} =~ /cpu/);
>>                  die "skip\n"
>> -                    if ($value =~ /cpu/) || ($value !~ /cpu/ && $conf->{hotplug} =~ /cpu/);
>> +                    if ($value =~ /memory/) || ($conf->{hotplug} && $conf->{hotplug} =~ /memory/);
>>              } elsif ($opt eq 'tablet') {
>>                  die "skip\n" if !$hotplug_features->{usb};
>>                  if ($value == 1) {
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-14 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-14 14:43 [pve-devel] [PATCH qemu-server] qemu-server: pending config: fix hotplug check Hannes Duerr
2025-10-14 14:55 ` Michael Köppl
2025-10-14 14:59   ` Hannes Duerr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal