Repository navigation
OPTE port cleanup and refactor. - #2856
Conversation
|
|
||
| /// Remove the OPTE ports on this zone from the port manager. | ||
| /// | ||
| /// Returns the last error, if any. |
There was a problem hiding this comment.
This is how it was before, so I don't think a change here is in scope for this PR, but why only return the last error? Won't an error in the middle be dropped if we just return the last result?
There was a problem hiding this comment.
Yes, it's not ideal but I think the original idea was we also don't want to release some of the ports and not do the rest if we encounter a failure. Maybe worth returning all the errors encountered instead?
There was a problem hiding this comment.
Yeah, I agree that we should try to delete all the ports, even if some fail. I was just worried that a failure in
the middle would be ignored and not reported. Now, is anyone listening to that failure on the other side and
what possibly could they do if a port release failed, I don't know, but I would think it nicer to at least give
the caller the option of doing something about it.
There was a problem hiding this comment.
Ok looking at the code again I realized we could just make this infallible by having PortTicket::release take self by-value. There's always a single PortTicket per-port and the error condition as it was written before was if you somehow tried to release and already release Port. By just consuming the PortTicket instead we shouldn't be able to run into that scenario altogether.
f3c673b to
7d7a6de
Compare
7d7a6de to
cb52630
Compare
Some refactoring and cleanup primarily to support OPTE ports for services. Each commit is relatively self-contained but the higlights are:
PortManagerto handle service vs guest ports.RunningZone.