Skip to content

xapi_vdi_helpers: actually write raw vdi when possible #6334

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
Mar 6, 2025

Conversation

psafont
Copy link
Member

@psafont psafont commented Feb 28, 2025

An if ... then raise exn;was misread and make the code after impossible to execute, when that was not the intention.

Remove all the ignore_ functions from stdext: a plain ignore with a type annotation can replace these. We should start using those for all ignores (there are too many of them, and can't be easily automated to do it in this PR)

Passes internal tests: 213465 (one failure due to the recent vlan + clustering issue)

@@ -184,7 +184,7 @@ let get_pointer half =
(* Lay out a blank double-buffered redo log on the given block device. *)
(* May raise Unixext.Timeout exception *)
let initialise_redo_log block_dev_fd target_response_time =
ignore_int (Unixext.seek_to block_dev_fd 0) ;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this change make it more efficient, or just come out from code style?

Copy link
Member Author

Choose a reason for hiding this comment

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

It might be more efficient since there's one closure (function) being called. But benefits are marginal, it's more about introducing the style to the codebase so we can stop calling ignore without using types

@lindig
Copy link
Contributor

lindig commented Mar 3, 2025

We are now replacing ignore_int with ignore but (for now) without a type annotation - so this is less secure than before?

@psafont
Copy link
Member Author

psafont commented Mar 3, 2025

We are now replacing ignore_int with ignore but (for now) without a type annotation

Which substitution is missing a type annotation? All of them are meant to be ignore (expr : int)

@lindig
Copy link
Contributor

lindig commented Mar 3, 2025

Sorry, was misreading this - it's now at the end

psafont added 2 commits March 3, 2025 10:52
This way of using ignores doesn't need specialized functions and can be used
with parametrized types (_ list) to avoid partial application.

Signed-off-by: Pau Ruiz Safont <[email protected]>
A regression made the function every single time:
5ac7032

Signed-off-by: Pau Ruiz Safont <[email protected]>
@psafont psafont force-pushed the private/paus/ign branch from 631516e to 4e88aba Compare March 3, 2025 10:56
@psafont psafont added this pull request to the merge queue Mar 6, 2025
Merged via the queue into xapi-project:master with commit 1a09452 Mar 6, 2025
15 checks passed
@psafont psafont deleted the private/paus/ign branch March 7, 2025 09:23
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