-
Notifications
You must be signed in to change notification settings - Fork 653
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
Add network bridges #3195
Add network bridges #3195
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3195 +/- ##
==========================================
+ Coverage 83.92% 84.05% +0.13%
==========================================
Files 251 251
Lines 13678 13793 +115
==========================================
+ Hits 11479 11594 +115
Misses 2199 2199 ☔ View full report in Codecov by Sentry. |
4a943ee
to
eb421ee
Compare
c722db6
to
3c0ab54
Compare
6f3b12d
to
9d23fef
Compare
008aa0f
to
da8fc75
Compare
50cfcfc
to
b47e35d
Compare
75cb878
to
e9f1c2d
Compare
4e4fdfe
to
74f81e2
Compare
74f81e2
to
15875b5
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.
Hey @luis4a0, thank you for your work on this. This is a light review only and I did not try the feature myself. I have a few requests that shouldn't be very difficult to implement.
src/daemon/daemon.cpp
Outdated
} | ||
catch (const mp::NotImplementedOnThisBackendException&) | ||
{ | ||
run_at_boot.erase(name); |
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.
Shouldn't this rethrow? And actually, couldn't this be structured such that we only add run_at_booy[name]
after (if) everything else succeeds?
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.
Rethrowing would mean to abort the execution of the start
command. The problem with adding commands to the vector if everything succeeds would be possible, but the daemon would have to carry a lot of information about interfaces. Rolling back this way is much simpler.
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.
Oh I didn't realize this was called at start. We should instead detect that bridging isn't implemented when the user tries to set bridged=true and refuse it at that point. What happens now in that case?
For adding only after success, I was probably not very clear. What I mean is that this should compose the commands
var but only add them to run_at_boot
at the end, when we know everything succeeded. That would avoid having to catch and erase, or leaving lingering commands behind if other exceptions are thrown.
d5411be
to
0f495b4
Compare
Hey @ricab and @georgeliao! I addressed your comments, thanks for taking the time to review! This is ready for another review pass. Thanks! |
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.
Hey @luis4a0, there are a couple of things that I think still need to be addressed (one tiny the other more important).
src/daemon/daemon.cpp
Outdated
} | ||
catch (const mp::NotImplementedOnThisBackendException&) | ||
{ | ||
run_at_boot.erase(name); |
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.
Oh I didn't realize this was called at start. We should instead detect that bridging isn't implemented when the user tries to set bridged=true and refuse it at that point. What happens now in that case?
For adding only after success, I was probably not very clear. What I mean is that this should compose the commands
var but only add them to run_at_boot
at the end, when we know everything succeeded. That would avoid having to catch and erase, or leaving lingering commands behind if other exceptions are thrown.
Hey @ricab! I implemented, as you proposed, refusing adding the bridged interface just in the moment the user issues the |
2ffe7ca
to
cebe251
Compare
Hey @georgeliao @ricab! Done the changes. I also added some tweaks for this to look like what I imagined :) And I finally rebased upong the latest Note: the private side will not yet compile, I still need to do the rebase on the private branch, but I'll do it after this gets merged. Thanks! |
If the execution of the commands to configure the new interfaces through SSH fails, an annoying message is shown. This commit makes that message appear only when the execution failed; as opposed to show it in case of any failure.
Message only on SSH execution error
…aces Add bridged interfaces in macOS QEMU
This assures persistence in the data structure. This means that commands to be run at boot will be executed even if the daemon is restarted.
Fixes issue 2 of #3195 (review)
5b0665d
to
89f1b78
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.
Alright, LGTM now (modulo issues we agreed to deal with separately).
Thank you for all your work @luis4a0!
No description provided.