-
Notifications
You must be signed in to change notification settings - Fork 55
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
Reorganize code into x86_64/{elf, bzimage} and aarch64 modules #24
Conversation
bd6b09e
to
d6f52c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I have only one question. Is start_info.rs
needed ? It doesn't seem to be used inside the crate.
#11 (comment) explains why this crate should export the structs in |
nit: Can we organize the exports as they're organized in vmm-sys-util? You can check src/lib.rs and the mod.rs file from unix. The advantage with that approach is that when you add a new feature you don't have to grow the lib.rs file and have both the attributes for the features & for the platform at the same level. |
I don't understand which structure you have in mind for |
@rbradford / @sameo / @sboeuf Could either of you PTAL too? |
src/loader/mod.rs
Outdated
#[cfg(all(feature = "elf", any(target_arch = "x86", target_arch = "x86_64")))] | ||
pub use x86_64::elf::Elf; | ||
#[cfg(all(feature = "elf", any(target_arch = "x86", target_arch = "x86_64")))] | ||
pub use x86_64::elf::Error as ElfError; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you also need a:
#[cfg(all(feature = "elf", any(target_arch = "x86", target_arch = "x86_64")))]
pub use x86_64::elf::start_info;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think (hope) that both this issue and @andreeaflorescu's nit #24 (comment) are solved in the latest commit. The elf
and bzimage
modules are use
d as-is, simplifying the imports in loader/mod.rs
, at the expense of the user prepending elf::
and bzimage::
to structs and calls.
b597cf9
In preparation for more incoming code that's either elf or bzimage specific, the respective blocks of functionality now sit in separate modules. This makes the code easier to navigate and improves readability. Fixes rust-vmm#22 as well. Signed-off-by: Alexandra Iordache <[email protected]>
@iulianbarbu @serban300 @sameo @andreeaflorescu Lost all approvals, rebased & updated, PTAL 😃 |
Works with Cloud Hypervisor. |
Phase 2 of code reorganization: separate x86_64 from aarch64 functionality in modules. Signed-off-by: Alexandra Iordache <[email protected]>
Signed-off-by: Alexandra Iordache <[email protected]>
Signed-off-by: Alexandra Iordache <[email protected]>
Lost again but I hope this is the last time I ask for re-approvals |
Do you think we could disable this feature? I mean unless we really don't trust the people submitting code, I don't expect someone to shove some bad code on purpose between two iterations of a PR. |
@sboeuf I am a bit on the fence about this one. The thing is that you can make mistakes on rebases so someone should still look at the code to make sure you didn't introduce any bugs. Ideally, you would need to re-approve it only when the PR has changes that were not rebase specific. GitHub helps with that by allowing you to click the How about before taking a decision, we put some metrics in place to see how often it happens that we need re-approvals where they would not be necessary and take a data-driven decision? I personally don't feel comfortable with taking that decision now. I would also move this conversation either in a community issue or on the email so that it doesn't get lost when this PR is merged. |
That's why we put our trust in the CI :)
Of course, there's no rush, but that's something I find a bit heavy in terms of process, and this PR is the perfect example, that's why I wanted to raise the question here.
Sounds good! |
The first 2 commits in this PR split the code that currently bloats
src/loader/mod.rs
into:elf
andbzimage
modules underloader
x86_64/elf
x86_64/bzimage
aarch64
Overall, the purpose of this reorganization is to improve readability and maintainability by keeping
src/loader/mod.rs
simple.