Skip to content

Remove orphaned source files which are never used #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

mtjhrc
Copy link
Collaborator

@mtjhrc mtjhrc commented May 29, 2025

I found 2 source code files which are never compiled, so we should remove them.

I found out about the mmio.rs file when working on #335 and realized I'm editing a file that isn't being compiled 😅
I looked for other files, and found one other file, but I haven't looked too much if there are more. I don't know of a tool to automatically determine this fully automatically.

To search for orphaned modules the cargo-modules package (specifically the command cargo modules orphans) can be used. Because we have multiple target/feature combinations and even conditions like #[cfg(not(feature = "tee"))], this currently requires manually changing the target/features and comparing output to determine if something is orphan. So if we wanted to integrate it into CI, it would require more post processing (and possibly a PR to the tool to give more machine readable output).

Remove vmm_config/console.rs file whis is never used (there is no corresponding
`mod console`) and device_manager/mmio.rs which has been split into 2 versions:
device_manager/kvm/mmio.rs and device_manager/hvf/mmio.rs

Signed-off-by: Matej Hrica <mhrica@redhat.com>
@mtjhrc mtjhrc force-pushed the remove-orphaned branch from c0c95c6 to c0aab57 Compare May 29, 2025 12:00
@mtjhrc mtjhrc marked this pull request as ready for review May 29, 2025 12:05
Copy link
Collaborator

@slp slp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@slp slp merged commit 22d7b61 into containers:main Jun 3, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants