-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Refactor vmm
builder code to simplify logic that creates the microVM to boot
#4547
Comments
Hi, may I take this task to practice? |
Hi @bchalios
I don’t see any Vmm object returned in the vmm/lib.rs file. Please let me know if I’ve misunderstood.
Could you point me to an example of this? Or are you referring to event_manager = EventManager::new() as the so-called dummy version? Could you share your thoughts on how you would approach avoiding the need to pass event_manager, as you mentioned? After all, may I ask why the create_vmm_and_vcpus function is specified only for aarch64? It seems to be used in several places, even with x86_64. Otherwise, I completely agree with your points and will work on addressing them. thanks. |
I just found this #4411 |
Description
Currently, the logic to create a
Vmm
object is scattered acrossvmm/lib.rs
andvmm.builder.rs
files and it is quite convoluted and some times difficult to follow. Moreover, there is a lot of architecture specific code inserted in arbitrary places which further increases the un-readability.Apart from the aesthetics and readability aspect, the state of the code makes it quite difficult to unit test. There are functions that take 7 arguments just to pass them (way) down the stack. That makes unit-testing very hard, since we often need to construct dummy versions of objects (like
EventManager
) even though they are not used in the part of the code we are trying to test.Solution
Re-work the
vmm
construction code to simplify code paths and isolate architecture-specific code.The text was updated successfully, but these errors were encountered: