Detect host machine type instead of hardcoding pc-i440fx-rhel7.6.0 - #18
Open
eliorerz wants to merge 1 commit into
Open
Detect host machine type instead of hardcoding pc-i440fx-rhel7.6.0#18eliorerz wants to merge 1 commit into
eliorerz wants to merge 1 commit into
Conversation
The VM XML template hardcoded machine type 'pc-i440fx-rhel7.6.0' which doesn't exist on RHEL 10 / Fedora hosts (only pc-i440fx-rhel10.0.0 is available). This causes 'virsh define' to fail with "unsupported configuration: Emulator does not support machine type". Query 'qemu-kvm -machine help' at boot time to detect the host's default i440fx machine type. Falls back to 'pc' (the generic alias) if detection fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The VM XML template hardcodes
machine='pc-i440fx-rhel7.6.0'which doesn't exist on RHEL 10 / Fedora hosts. These hosts only havepc-i440fx-rhel10.0.0, causingvirsh defineto fail:Fix
Query
qemu-kvm -machine helpat boot time to detect the host's default i440fx machine type and use it in the VM XML. Falls back topc(the generic alias that works everywhere) if detection fails.Testing
Verified on RHEL 10 host (
osac-ci-1) whereqemu-kvm -machine helpreturns:Boot succeeds with the detected machine type.