mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-30 19:36:24 +00:00
update gpu-switch-mode-indicator.tsx
This commit is contained in:
@@ -1270,6 +1270,48 @@ function create_vm() {
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ ${#CONTROLLER_NVME_PCIS[@]} -gt 0 ]]; then
|
||||
# SR-IOV guard: mirror of the synology.sh/vm_creator.sh block —
|
||||
# drop VFs and active-PF devices before staging so Proxmox does
|
||||
# not collapse the VF tree at VM start. Mid-flow, so the notice
|
||||
# goes through whiptail (blocking acknowledgment) and each
|
||||
# skipped BDF is then echoed via msg_warn for the log trail.
|
||||
if declare -F _pci_sriov_filter_array >/dev/null 2>&1; then
|
||||
SRIOV_REMOVED=$(_pci_sriov_filter_array CONTROLLER_NVME_PCIS)
|
||||
if [[ -n "$SRIOV_REMOVED" ]]; then
|
||||
SRIOV_MSG=""
|
||||
SRIOV_BDFS=()
|
||||
SRIOV_NL=$'\n'
|
||||
SRIOV_MSG="$(translate "The following devices were excluded from Controller/NVMe passthrough because they are part of an SR-IOV configuration:")"
|
||||
while IFS= read -r SRIOV_ENTRY; do
|
||||
[[ -z "$SRIOV_ENTRY" ]] && continue
|
||||
SRIOV_BDF="${SRIOV_ENTRY%%|*}"
|
||||
SRIOV_ROLE="${SRIOV_ENTRY#*|}"
|
||||
SRIOV_FIRST="${SRIOV_ROLE%% *}"
|
||||
SRIOV_BDFS+=("$SRIOV_BDF")
|
||||
if [[ "$SRIOV_FIRST" == "vf" ]]; then
|
||||
SRIOV_MSG+="${SRIOV_NL} • ${SRIOV_BDF} — $(translate "Virtual Function")"
|
||||
else
|
||||
SRIOV_MSG+="${SRIOV_NL} • ${SRIOV_BDF} — $(translate "Physical Function with") ${SRIOV_ROLE#pf-active } $(translate "active VFs")"
|
||||
fi
|
||||
done <<< "$SRIOV_REMOVED"
|
||||
SRIOV_MSG+="${SRIOV_NL}${SRIOV_NL}$(translate "To pass SR-IOV Virtual Functions to a VM, edit the VM configuration manually via the Proxmox web interface.")"
|
||||
|
||||
whiptail --backtitle "ProxMenux" \
|
||||
--title "$(translate "SR-IOV Configuration Detected")" \
|
||||
--msgbox "$SRIOV_MSG" 18 82
|
||||
|
||||
for SRIOV_SKIPPED in "${SRIOV_BDFS[@]}"; do
|
||||
msg_warn "$(translate "Skipping SR-IOV device"): ${SRIOV_SKIPPED}"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${#CONTROLLER_NVME_PCIS[@]} -eq 0 ]]; then
|
||||
msg_warn "$(translate "No eligible Controller/NVMe devices remain after SR-IOV filtering. Skipping.")"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${#CONTROLLER_NVME_PCIS[@]} -gt 0 ]]; then
|
||||
local CONTROLLER_CAN_STAGE=true
|
||||
if declare -F _pci_is_iommu_active >/dev/null 2>&1 && ! _pci_is_iommu_active; then
|
||||
|
||||
Reference in New Issue
Block a user