]> git.proxmox.com Git - pve-manager.git/commitdiff
api: bulk suspension: increase log severity to warn when guest is not a VM
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 13 Nov 2023 13:04:25 +0000 (14:04 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 13 Nov 2023 13:14:08 +0000 (14:14 +0100)
That way it shows up in the task-log that something was requested that
cannot work currently.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Nodes.pm

index 0956eb0a1fbc25b886e6d5a477f646afd94d0c26..e1e2c16b54fa9076fed4054cce8e627ecc512389 100644 (file)
@@ -28,6 +28,7 @@ use PVE::LXC;
 use PVE::ProcFSTools;
 use PVE::QemuConfig;
 use PVE::QemuServer;
+use PVE::RESTEnvironment qw(log_warn);
 use PVE::RESTHandler;
 use PVE::RPCEnvironment;
 use PVE::RRD;
@@ -2091,8 +2092,8 @@ __PACKAGE__->register_method ({
 
                for my $vmid (sort {$b <=> $a} keys %$vmlist) {
                    my $d = $vmlist->{$vmid};
-                   if ($d->{type} eq 'lxc') {
-                       print STDERR "Skipping $vmid, only VMs can be suspended\n";
+                   if ($d->{type} ne 'qemu') {
+                       log_warn("skipping $vmid, only VMs can be suspended");
                        next;
                    }
                    my $upid = eval {