]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
fix #1794: VM resource: catch qmp command exceptions
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jan 2019 12:50:14 +0000 (13:50 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 25 Jan 2019 08:27:28 +0000 (09:27 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/HA/Resources/PVEVM.pm

index c5276dcee4f0f8f842f306930752f53644882401..d07d5c98933ee7323decd7befc3db22a1c2a67c4 100644 (file)
@@ -124,8 +124,12 @@ sub check_running {
        # do not count VMs which are suspended for a backup job as running
        my $conf = PVE::QemuConfig->load_config($vmid, $nodename);
        if (defined($conf->{lock}) && $conf->{lock} eq 'backup') {
-           my $qmpstatus = PVE::QemuServer::vm_qmp_command($vmid, {execute => 'query-status'});
-           return 0 if $qmpstatus->{status} eq 'prelaunch';
+           my $qmpstatus = eval {
+               PVE::QemuServer::vm_qmp_command($vmid, { execute => 'query-status' })
+           };
+           warn "$@\n" if $@;
+
+           return 0 if defined($qmpstatus) && $qmpstatus->{status} eq 'prelaunch';
        }
 
        return 1;