From 7786f1b0b49a9a7c8409538888a917d5a9dd974d Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 25 Jun 2014 07:20:23 +0200 Subject: [PATCH] vncproxy: add check if VM is running To provide better eror message for console task. --- PVE/API2/Qemu.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 5ba2e736..f2c9c780 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1348,6 +1348,8 @@ __PACKAGE__->register_method({ $cmd = ['/bin/nc', '-l', '-p', $port, '-w', $timeout, '-c', "$qmstr 2>/dev/null"]; } + die "VM $vmid not running\n" if !PVE::QemuServer::check_running($vmid); + PVE::Tools::run_command($cmd); return;