Skip to content

Commit

Permalink
xenopsd: fix Xen version comparison. 4.17 is > 4.2, not lower!
Browse files Browse the repository at this point in the history
Don't use string comparisons for versions, "17" < "2", but 17 > 2!

Signed-off-by: Edwin Török <[email protected]>
  • Loading branch information
edwintorok committed Mar 12, 2024
1 parent 4e0d37c commit 5db8be9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ocaml/xenopsd/xc/xenops_server_xen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5146,12 +5146,13 @@ let look_for_xenctrl () =
let init () =
look_for_forkexec () ;
let major, minor = look_for_xen () in
let major = int_of_string major and minor = int_of_string minor in
look_for_xenctrl () ;
if
major < "4" || ((major = "4" && minor < "2") && !Xenopsd.run_hotplug_scripts)
major < 4 || ((major = 4 && minor < 2) && !Xenopsd.run_hotplug_scripts)
then (
error
"This is xen version %s.%s. On all versions < 4.1 we must use \
"This is xen version %d.%d. On all versions < 4.1 we must use \
hotplug/udev scripts"
major minor ;
error
Expand Down

0 comments on commit 5db8be9

Please sign in to comment.