-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Create Net devices during configuration instead of boot-time #1735
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
Conversation
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
sandreim
reviewed
Apr 3, 2020
ioanachirca
reviewed
Apr 8, 2020
src/vmm/src/vmm_config/net.rs
Outdated
// Validate there is no Mac conflict. | ||
// No need to validate host_dev_name conflict. In such a case, | ||
// an error will be thrown during device creation anyway. | ||
if self.if_list.iter().any(no_mac_conflict) { |
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 this would read better if the closure was called mac_conflict
.
ioanachirca
previously approved these changes
Apr 8, 2020
Refactored the 'insert()' function to remove duplicated code between the create and update cases. Also removed a couple of redundant getters. Signed-off-by: Adrian Catangiu <[email protected]>
Signed-off-by: Adrian Catangiu <[email protected]>
Remove 'Result' wrapper over built MmioTransport. Signed-off-by: Adrian Catangiu <[email protected]>
This commit adds a device 'id' field and getters for both 'id' and 'guest_mac'. Signed-off-by: Adrian Catangiu <[email protected]>
Following the more decoupled design we can now create net devices on their configuration path, rather than saving a config and delaying creation to boot-time. This model allows user-errors (like invalid resources or permissions) to be reported as part of the configuration step rather than later at attempted boot. It also removes the time window between configuration and boot where changes to the host system (creating Taps, changing permissions, etc) could cause microVM boot failures. This commit decreases code complexity and should provide better efficiency to the process of configuring and starting a microVM. Signed-off-by: Adrian Catangiu <[email protected]>
ioanachirca
approved these changes
Apr 8, 2020
sandreim
approved these changes
Apr 8, 2020
8 tasks
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.
Reason for This PR
Fixes #1708
Prerequisite for #1713
Description of Changes
Simplify code in NetworkInterfaceConfig
Refactored the
insert()
function to remove duplicated code between the create and update cases. Also removed a couple of redundant getters.Create Net devices during config instead of boot
Following the more decoupled design we can now create net devices on their configuration path, rather than saving a config and delaying creation to boot-time.
Such a model allows user-errors (like invalid resources or permissions) to be reported as part of the configuration step rather than later at attempted boot.
It would also remove the time window between configuration and boot where changes to the host system (creating Taps, changing permissions, etc) would cause microVM boot failures (race condition between validation and commitment of resources).
Such a model should also decrease code complexity and should provide better efficiency to the process of configuring and starting a microVM (no more moving configurations around in memory and validating resources both at config time and boot-time).
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.
PR Checklist
[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
git commit -s
).unsafe
code is properly documented.firecracker/swagger.yaml
.CHANGELOG.md
.