From 6a073b92e90c55a252d21c3ec36fefb841561103 Mon Sep 17 00:00:00 2001 From: Stefan Reiter Date: Mon, 19 Oct 2020 14:18:42 +0200 Subject: [PATCH] ui: qemu: set correct disabled state for start button If a guest's QEMU process is 'running', but QMP says 'shutdown' or 'prelaunch', the VM is ready to be booted anew, so we can show the button. The 'shutdown' button is intentionally not touched, as we always want to give the user the ability to 'stop' a VM (and thus kill any potentially leftover processes). Signed-off-by: Stefan Reiter --- www/manager6/qemu/Config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js index a13bf0c5..346c71a7 100644 --- a/www/manager6/qemu/Config.js +++ b/www/manager6/qemu/Config.js @@ -411,7 +411,10 @@ Ext.define('PVE.qemu.Config', { statusTxt.update({ lock: lock }); - startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'running' || template); + let guest_running = status === 'running' && + !(qmpstatus === "shutdown" || qmpstatus === "prelaunch"); + startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || template || guest_running); + shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running'); me.down('#removeBtn').setDisabled(!caps.vms['VM.Allocate'] || status !== 'stopped'); consoleBtn.setDisabled(template);