Conversation
There was a problem hiding this comment.
Pull request overview
Adds architecture-aware discovery of the QEMU configuration file so run_qemu can prefer per-arch config filenames when available.
Changes:
- Switch default config-path selection to a helper (
find_qemu_config) when--qemu-configis not provided. - Add
find_qemu_configthat searches forqemu-<arch>.toml/.qemu-<arch>.tomlbefore falling back to genericqemu.toml/.qemu.toml.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// Find QEMU configuration file with architecture-specific priority. | ||
| /// | ||
| /// Search order: | ||
| /// 1. qemu-<arch>.toml | ||
| /// 2. .qemu-<arch>.toml | ||
| /// 3. qemu.toml | ||
| /// 4. .qemu.toml | ||
| fn find_qemu_config(ctx: &AppContext) -> anyhow::Result<PathBuf> { |
| let candidates = [ | ||
| manifest_dir.join(format!("qemu-{}.toml", arch)), | ||
| manifest_dir.join(format!(".qemu-{}.toml", arch)), | ||
| ]; | ||
| for path in &candidates { | ||
| if path.exists() { | ||
| return Ok(path.clone()); | ||
| } |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5e9476a41
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| manifest_dir.join("qemu.toml"), | ||
| manifest_dir.join(".qemu.toml"), |
There was a problem hiding this comment.
Preserve
.qemu.toml precedence over qemu.toml
This reverses the existing default config path: run_qemu used to read and auto-generate .qemu.toml, QemuArgs still documents .qemu.toml as the default (ostool/src/main.rs:55-57), and handle_qemu_config still edits that file (ostool/src/menuconfig.rs:71-90). If a project contains both files after this change, ostool run qemu will silently ignore the documented/default config and use qemu.toml instead, so menuconfig edits and previously working .qemu.toml settings stop taking effect.
Useful? React with 👍 / 👎.
| manifest_dir.join(format!("qemu-{}.toml", arch)), | ||
| manifest_dir.join(format!(".qemu-{}.toml", arch)), |
There was a problem hiding this comment.
Keep menuconfig aligned with the new arch-specific lookup
The new arch-priority search means run_qemu now prefers qemu-<arch>.toml or .qemu-<arch>.toml, but MenuConfigHandler::handle_qemu_config still only loads and saves .qemu.toml (ostool/src/menuconfig.rs:71-90). In any multi-arch project that adds one of these per-arch files, interactive QEMU config changes no longer affect the file that is actually used for that architecture, which is a user-visible regression introduced by this lookup order.
Useful? React with 👍 / 👎.
No description provided.