From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E7F7A8E102 for ; Thu, 10 Nov 2022 15:36:41 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B9C7228427 for ; Thu, 10 Nov 2022 15:36:11 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 10 Nov 2022 15:36:07 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 05E9D44A9B for ; Thu, 10 Nov 2022 15:36:01 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Thu, 10 Nov 2022 15:35:51 +0100 Message-Id: <20221110143600.258897-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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% 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 qemu-server/pve-manager] use qemu-xhci for new guests 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: , X-List-Received-Date: Thu, 10 Nov 2022 14:36:42 -0000 qemu-xhci is to be preferred to nec-usb-xhci, but for compatibility reasons, only use it for machine types >= 7.1 and ostypes l26 and windows > 7 (older os' don't support it) (depending on that machine version should be ok as long as we don't roll out qemu 7.1 before applying this series) With that controller we can specify how many ports we want (we chose 15, the maximum) and for those guests we now set the usb devices on fixed ports (usb0 gets port 1 and so on) so that we can enable hotplugging too. Lastly, since we set the maximum of 15 ports, we can safely use up to 14 of them (without qemu plugging a usb-hub in between) For hotplugging we check the actual running qemu machine version, but the gui only uses a heuristic based on the config (still good enough since it allows more than the back end) For guests with older machine types or other ostypes, the current behaviour remains Note: patch 1,2 of qemu-server are only cleanups/refactor that could be applied independently (no behaviour change intended) patch 1 of pve-manager could be squashed into 2, but if we decide not to use that heuristic in the gui, can be applied separately qemu-server: Dominik Csapak (7): print_tabletdevice_full: make use of $q35 variable move 'windows_version' to Helpers USB: print_usbdevice_full: error out on invalid configuration USB: use machine_type_is_q35 instead of regex fix #4324: USB: use qemu-xhci for machine versions >= 7.1 USB: increase max usb devices to 14 for newer machine version and ostype fix #3271: USB: allow usb hotplugging for modern guests PVE/API2/Qemu.pm | 2 +- PVE/QemuServer.pm | 134 ++++++++++++++++------------ PVE/QemuServer/Cloudinit.pm | 3 +- PVE/QemuServer/Helpers.pm | 19 ++++ PVE/QemuServer/USB.pm | 94 ++++++++++++++----- test/cfg2cmd/qemu-xhci-7.1.conf | 12 +++ test/cfg2cmd/qemu-xhci-7.1.conf.cmd | 34 +++++++ 7 files changed, 220 insertions(+), 78 deletions(-) create mode 100644 test/cfg2cmd/qemu-xhci-7.1.conf create mode 100644 test/cfg2cmd/qemu-xhci-7.1.conf.cmd pve-manager: Dominik Csapak (2): ui: USBInputPanel: use correct maximum usb index ui: qemu: increase available usb ports depending on machine and ostype www/manager6/Utils.js | 53 ++++++++++++++++++++++++++++++- www/manager6/qemu/HardwareView.js | 7 +++- www/manager6/qemu/USBEdit.js | 7 +++- 3 files changed, 64 insertions(+), 3 deletions(-) -- 2.30.2