Skip to content

Conversation

@psafont
Copy link
Member

@psafont psafont commented Mar 6, 2025

These functions have a more relevant name than the previous ones, especially with the advent of OCaml 5.0 the runtime lock becomes more important and programmers must be aware of it.

These functions were introduced in OCaml 3.12.

These functions have a more relevant name than the previous ones, especially
with the advent of OCaml 5.0 the runtime lock becomes more important and
programmers must be aware of it.

These functions were introduced in OCaml 3.12.

Signed-off-by: Pau Ruiz Safont <[email protected]>
Copy link
Contributor

@last-genius last-genius left a comment

Choose a reason for hiding this comment

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

Does not introduce any new problems so all good, but might just as well clean things up. I think @edwintorok has a pending PR doing this and more, but it hit some issues in testing, though.

Comment on lines 106 to 107
const char* const hashed =
crypt_r(String_val(key), String_val(setting), &cd);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not the fault of this (totally correct) commit, but these accesses to OCaml values should be brought out of this section.

} else {
flags |= O_RDONLY;
}
fd = open(filename_c, flags, Int_val(perm));
Copy link
Contributor

Choose a reason for hiding this comment

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

Here and above with Bool_val too

int pirq = Int_val(irq);
caml_enter_blocking_section();
caml_release_runtime_system();
int retval = xc_physdev_map_pirq(xch, Int_val(domid), pirq, &pirq);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

xc_interface *xch = xch_of_val(xch_val);
caml_enter_blocking_section();
caml_release_runtime_system();
int retval = xc_assign_device(xch, Int_val(domid), Int_val(machine_sbdf), Int_val(flag));
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

xc_interface *xc = xch_of_val(xch_val);
caml_enter_blocking_section();
caml_release_runtime_system();
int retval = xc_deassign_device(xc, Int_val(domid), Int_val(machine_sbdf));
Copy link
Contributor

Choose a reason for hiding this comment

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

Same

xc_interface *xc = xch_of_val(xch_val);
caml_enter_blocking_section();
caml_release_runtime_system();
int retval = xc_domain_soft_reset(xc, Int_val(domid));
Copy link
Contributor

Choose a reason for hiding this comment

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

Same and below

@psafont
Copy link
Member Author

psafont commented Mar 6, 2025

a pending PR doing this and more, but it hit some issues in testing, though.

Then I think it's worth leaving the changes to that PR

@psafont psafont added this pull request to the merge queue Mar 6, 2025
Merged via the queue into xapi-project:master with commit 8ca8328 Mar 6, 2025
17 checks passed
@psafont psafont deleted the release-acquire branch March 6, 2025 11:58
@andyhhp
Copy link
Collaborator

andyhhp commented Mar 6, 2025

The Ocaml libraries in upstream Xen look like they need the same treatment. (We're going to need to take the plunge on Ocaml-5-ing them at some point)

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.

4 participants