From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 0CA9E1FF0C2 for ; Thu, 03 Dec 2026 15:04:09 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B6EEF21760; Thu, 03 Dec 2026 15:04:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dualfroz.com; s=dkim; t=1796306633; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding; bh=xHXdJeLluFKAWHzoji5d9ttw+gdMfyvzxx/3KLB/XiI=; b=n6syRyP4b+hcwksgYiYV3ng2Z6XRTLfxMJlfQvaV4mZxx1NcRAJ37gczpAGoP49OtlsZ/u lb+o5f2vlCgIWMU/F2eVERqx+eQW0yTxNZo6dZ3hSeC0XaBuONAg/fNdGoOzRnhZgoG0Cv gfNUSuUuQJeK8wg+n7iSxteuReFmfaSlRpL9CRirdmk7/XNtdkKp8sH2I00UGd2YlizsaF 1mh48I/X0pjrRwEzCS2KKV7P+bBQOnSQc3zgcLdhoyVXue3SutZwoa8OSARSemp33n87oD +QdMoRdvmcyPBHxLsV3v/JxAvR610CSlpWyRtVAWHVsh5Zz3WT/zrHAULo6okA== From: Michal Fox To: pve-devel@lists.proxmox.com Subject: [PATCH manager] fix #8349: ui: qemu: hardware: allow removing socket serial and spice usb ports Date: Thu, 3 Dec 2026 14:03:41 +0000 Message-ID: <20261203140341.7-1-me@dualfroz.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.114 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: OXE4UB2IQL3CCIBCHEUPBFJ5J2JJKXWX X-Message-ID-Hash: OXE4UB2IQL3CCIBCHEUPBFJ5J2JJKXWX X-MailFrom: me@dualfroz.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The remove button for serial and USB ports was only enabled with Sys.Console (or Mapping.Use for USB), while the backend only requires VM.Config.HWType for removing a serial port of type socket or a SPICE USB port. Decide based on the configured value, so that users who can add such ports can also remove them again. Signed-off-by: Michal Fox --- checked with node --check and by running the changed button logic in node for socket, device, spice and mapped ports, not clicked through in the gui www/manager6/qemu/HardwareView.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js index fdb1802..b771e65 100644 --- a/www/manager6/qemu/HardwareView.js +++ b/www/manager6/qemu/HardwareView.js @@ -776,7 +776,16 @@ Ext.define('PVE.qemu.HardwareView', { const isEfi = key === 'efidisk0'; const tpmMoveable = key === 'tpmstate0' && !isRunning; - let cannotDelete = deleted || row.never_delete; + // socket serial ports and SPICE USB ports are not host devices, the backend only + // requires VM.Config.HWType for removing them + const isSocketSerial = /^serial\d+$/.test(key) && value === 'socket'; + const isSpiceUsb = + /^usb\d+$/.test(key) && + /^spice$/i.test(PVE.Parser.parsePropertyString(value, 'host')?.host); + const neverDelete = + isSocketSerial || isSpiceUsb ? noVMConfigHWTypePerm : row.never_delete; + + let cannotDelete = deleted || neverDelete; cannotDelete ||= isCDRom && !cdromCap; cannotDelete ||= isDisk && !diskCap; cannotDelete ||= isCloudInit && noVMConfigCloudinitPerm; -- 2.43.0