Skip to content

Clean up xapi_xenops and more #6543

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
merged 3 commits into from
Jun 19, 2025

Conversation

last-genius
Copy link
Contributor

Best reviewed by commit, and also best viewed locally with a git client that distinguishes between moved and new lines, with a config like:

[diff]
    colormoved = "default"
    colormovedws = "allow-indentation-change"

No functional changes intended.


This is split out from a larger series, but I figured these cleanups are easier to review on their own and it would be better to get them in early to avoid annoying rebases of a thousand lines of code ....

Copy link
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite easy to review with the github interface when hiding whitespace (is there a way to set it as default in this repo?)

@@ -25,7 +25,7 @@ functor
struct
(* Map of thing -> last update counter *)
module M = Map.Make (struct
type t = Ord.t
type t = Interface.Dynamic.id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand here. It seems that the functor Ord becomes meaningless. If UpdateRecorder needn't be generic, then we should compress module UpdateRecorder and module U at L136 into one. It's quite odd now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right and I'm not entirely sure of the original intentions of this change (it's been a few months)... I'll drop this part

Dynamic.t is not used currently, just drop it.

Signed-off-by: Andrii Sultanov <[email protected]>
There's already a 'localhost' in scope.

Signed-off-by: Andrii Sultanov <[email protected]>
No functional change, this just removes several indentation levels from the
500+ lines of the function, making it easier to refactor in the future.

This also clears up the logic of the function, now that two arms of if-else and
try-with clauses are not 500+ lines apart, and avoids splitting some
expressions and strings over several lines given that they reach the line
character limit more often inside of several levels of indentation.

Signed-off-by: Andrii Sultanov <[email protected]>
@last-genius last-genius force-pushed the asv/xenopsd-cleanup branch from ca74cf9 to fa28105 Compare June 19, 2025 07:19
@last-genius last-genius added this pull request to the merge queue Jun 19, 2025
Merged via the queue into xapi-project:master with commit fa3488f Jun 19, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants