From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 899131FF38D for ; Fri, 3 May 2024 13:20:43 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 115FA36895; Fri, 3 May 2024 13:20:34 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Fri, 3 May 2024 13:19:56 +0200 Message-Id: <20240503111956.46543-8-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503111956.46543-1-f.ebner@proxmox.com> References: <20240503111956.46543-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.065 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager 2/2] ui: qemu: hardware: use asynchronous remove API call for disk hot-unplug X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" The backend uses a 10 minute timeout for disk hot-unplug, so avoid using the synchronous call which only has a 30 second timeout. Commit 3b2e557f ("close #584: ui qemu: changed remove unused disk to asynchron call") introduced the necessary functionality when removing unused disks. Signed-off-by: Fiona Ebner --- www/manager6/qemu/HardwareView.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js index 6dcba071..e1902695 100644 --- a/www/manager6/qemu/HardwareView.js +++ b/www/manager6/qemu/HardwareView.js @@ -608,6 +608,7 @@ Ext.define('PVE.qemu.HardwareView', { const deleted = !!rec.data.delete; const pending = deleted || me.hasPendingChanges(key); + const isRunning = me.pveSelNode.data.running; const isCloudInit = isCloudInitKey(value); const isCDRom = value && !!value.toString().match(/media=cdrom/); @@ -616,7 +617,7 @@ Ext.define('PVE.qemu.HardwareView', { const isUsedDisk = !isUnusedDisk && row.isOnStorageBus && !isCDRom; const isDisk = isUnusedDisk || isUsedDisk; const isEfi = key === 'efidisk0'; - const tpmMoveable = key === 'tpmstate0' && !me.pveSelNode.data.running; + const tpmMoveable = key === 'tpmstate0' && !isRunning; let cannotDelete = deleted || row.never_delete; cannotDelete ||= isCDRom && !cdromCap; @@ -625,7 +626,7 @@ Ext.define('PVE.qemu.HardwareView', { remove_btn.setDisabled(cannotDelete); remove_btn.setText(isUsedDisk && !isCloudInit ? remove_btn.altText : remove_btn.defaultText); - remove_btn.RESTMethod = isUnusedDisk ? 'POST':'PUT'; + remove_btn.RESTMethod = isUnusedDisk || (isDisk && isRunning) ? 'POST' : 'PUT'; edit_btn.setDisabled( deleted || !row.editor || isCloudInit || (isCDRom && !cdromCap) || (isDisk && !diskCap)); -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel