Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pve/vm-core.func
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,8 @@ vm_choose_settings_mode() {
# cannot print "Host" while CPU_TYPE says otherwise.
# ------------------------------------------------------------------------------
vm_echo_default_settings() {
local cpu_label="KVM64"
[[ "${CPU_TYPE:-}" == *host* ]] && cpu_label="Host"
local cpu_label
cpu_label="$(vm_cpu_model_label)"

local cache_label="None"
[[ -n "${DISK_CACHE:-}" ]] && cache_label="Write Through"
Expand Down Expand Up @@ -1040,6 +1040,12 @@ vm_apply_machine_type() {
fi
}

vm_cpu_model_label() {
local model="${CPU_TYPE:-}"
model="${model# -cpu }"
echo "${model:-KVM64}"
}

vm_machine_type_label() {
case "${1:-i440fx}" in
q35)
Expand Down Expand Up @@ -1329,7 +1335,7 @@ vm_prompt_cpu_model() {
4) CPU_TYPE=" -cpu x86-64-v4" ;;
*) CPU_TYPE="" ;;
esac
echo -e "${OS}${BOLD}${DGN}CPU Model: ${BGN}${CPU_TYPE:+${CPU_TYPE# -cpu }}${CPU_TYPE:-KVM64}${CL}"
echo -e "${OS}${BOLD}${DGN}CPU Model: ${BGN}$(vm_cpu_model_label)${CL}"
else
exit_script
fi
Expand Down
Loading