Skip to content

Commit

Permalink
Merge pull request #5798 from BengangY/private/bengangy/merge-master-…
Browse files Browse the repository at this point in the history
…to-non-cdn-update

Merge master to feature/non-cdn-update
  • Loading branch information
minglumlu authored Jul 11, 2024
2 parents 2008661 + b0e0bab commit 47a3f7d
Show file tree
Hide file tree
Showing 180 changed files with 4,330 additions and 1,460 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,15 @@ jobs:
# To view the Coveralls results of the PR, click on the "Details" link to the right
# of the Coveralls Logo in the Checks section of the PR.
finish-parallel-coveralls-upload:
name: Finish coverage upload
needs: python-test # run after the python-test has completed uploading coverages
runs-on: ubuntu-latest
steps:
- name: Finish the parallel coverage upload to Coveralls
uses: coverallsapp/github-action@v1
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
continue-on-error: true # Do not fail CI if this step fails

deprecation-test:
name: Deprecation tests
Expand Down
17 changes: 9 additions & 8 deletions configure.ml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ let () =
in
List.iter print_endline lines ;
(* Expand @LIBEXEC@ in udev rules *)
try
let xenopsd_libexecdir = Hashtbl.find config "XENOPSD_LIBEXECDIR" in
expand "@LIBEXEC@" xenopsd_libexecdir "ocaml/xenopsd/scripts/vif.in"
"ocaml/xenopsd/scripts/vif" ;
expand "@LIBEXEC@" xenopsd_libexecdir
"ocaml/xenopsd/scripts/xen-backend.rules.in"
"ocaml/xenopsd/scripts/xen-backend.rules"
with Not_found -> failwith "xenopsd_libexecdir not set"
match Hashtbl.find_opt config "XENOPSD_LIBEXECDIR" with
| Some xenopsd_libexecdir ->
expand "@LIBEXEC@" xenopsd_libexecdir "ocaml/xenopsd/scripts/vif.in"
"ocaml/xenopsd/scripts/vif" ;
expand "@LIBEXEC@" xenopsd_libexecdir
"ocaml/xenopsd/scripts/xen-backend.rules.in"
"ocaml/xenopsd/scripts/xen-backend.rules"
| None ->
failwith "xenopsd_libexecdir not set"
44 changes: 42 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,27 @@

(package
(name xapi-networkd)
(authors "Jon Ludlam")
(synopsis "The XCP networking daemon")
(depends
(alcotest :with-test)
astring
base-threads
(forkexec (= :version))
(http-lib (= :version))
mtime
netlink
re
rpclib
(xapi-idl (= :version))
xapi-inventory
(xapi-stdext-pervasives (= :version))
(xapi-stdext-std (= :version))
(xapi-stdext-threads (= :version))
(xapi-stdext-unix (= :version))
xapi-test-utils
(xen-api-client (= :version))
)
)

(package
Expand All @@ -241,6 +262,14 @@

(package
(name xapi-forkexecd)
(synopsis "Sub-process control service for xapi")
(description "This daemon creates and manages sub-processes on behalf of xapi.")
(depends
astring
(forkexec (= :version))
(uuid (= :version))
(xapi-stdext-unix (= :version))
)
)

(package
Expand Down Expand Up @@ -444,6 +473,19 @@ This package provides an Lwt compatible interface to the library.")

(package
(name forkexec)
(synopsis "Process-spawning library")
(description "Client and server library to spawn processes.")
(depends
base-threads
(fd-send-recv (>= "2.0.0"))
ppx_deriving_rpc
rpclib
(uuid (= :version))
(xapi-log (= :version))
(xapi-stdext-pervasives (= :version))
(xapi-stdext-unix (= :version))
(xapi-tracing (= :version))
)
)

(package
Expand Down Expand Up @@ -513,7 +555,6 @@ This package provides an Lwt compatible interface to the library.")
(synopsis "Xapi's standard library extension, Threads")
(authors "Jonathan Ludlam")
(depends
ocaml
base-threads
base-unix
(odoc :with-doc)
Expand Down Expand Up @@ -541,7 +582,6 @@ This package provides an Lwt compatible interface to the library.")
(synopsis "Xapi's standard library extension, Zerocheck")
(authors "Jonathan Ludlam")
(depends
ocaml
(odoc :with-doc)
)
)
52 changes: 29 additions & 23 deletions forkexec.opam
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
# This file is generated by dune, edit dune-project instead
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
opam-version: "2.0"
maintainer: "[email protected]"
authors: "[email protected]"
homepage: "https://github.com/xapi-project/"
synopsis: "Process-spawning library"
description: "Client and server library to spawn processes."
maintainer: ["Xapi project maintainers"]
authors: ["[email protected]"]
license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"
homepage: "https://xapi-project.github.io/"
bug-reports: "https://github.com/xapi-project/xen-api/issues"
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
tags: [ "org:xapi-project" ]

build: [[ "dune" "build" "-p" name "-j" jobs ]]

depends: [
"ocaml"
"dune"
"dune" {>= "3.0"}
"base-threads"
"fd-send-recv"
"fd-send-recv" {>= "2.0.0"}
"ppx_deriving_rpc"
"rpclib"
"uuid"
"xapi-log"
"xapi-stdext-pervasives"
"xapi-stdext-unix"
"xapi-tracing"
"uuid" {= version}
"xapi-log" {= version}
"xapi-stdext-pervasives" {= version}
"xapi-stdext-unix" {= version}
"xapi-tracing" {= version}
"odoc" {with-doc}
]
synopsis: "Sub-process control service for xapi"
description:
"This daemon creates and manages sub-processes on behalf of xapi."
url {
src: "https://github.com/xapi-project/xen-api/archive/master.tar.gz"
}
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/xapi-project/xen-api.git"
29 changes: 0 additions & 29 deletions forkexec.opam.template

This file was deleted.

5 changes: 1 addition & 4 deletions ocaml/database/db_backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,5 @@ let is_session_registered session =

let get_registered_database session =
with_lock db_registration_mutex (fun () ->
if Hashtbl.mem foreign_databases session then
Some (Hashtbl.find foreign_databases session)
else
None
Hashtbl.find_opt foreign_databases session
)
14 changes: 8 additions & 6 deletions ocaml/database/db_conn_store.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ let read_db_connections () = !db_connections
let with_db_conn_lock db_conn f =
let db_conn_m =
with_lock db_conn_locks_m (fun () ->
try Hashtbl.find db_conn_locks db_conn
with _ ->
(* If we don't have a lock already for this connection then go make one dynamically and use that from then on *)
let new_dbconn_mutex = Mutex.create () in
Hashtbl.replace db_conn_locks db_conn new_dbconn_mutex ;
new_dbconn_mutex
match Hashtbl.find_opt db_conn_locks db_conn with
| Some x ->
x
| None ->
(* If we don't have a lock already for this connection then go make one dynamically and use that from then on *)
let new_dbconn_mutex = Mutex.create () in
Hashtbl.replace db_conn_locks db_conn new_dbconn_mutex ;
new_dbconn_mutex
)
in
with_lock db_conn_m (fun () -> f ())
7 changes: 3 additions & 4 deletions ocaml/database/stats.ml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ let sample (name : string) (x : float) : unit =
let x' = log x in
with_lock timings_m (fun () ->
let p =
if Hashtbl.mem timings name then
Hashtbl.find timings name
else
Normal_population.empty
Option.value
(Hashtbl.find_opt timings name)
~default:Normal_population.empty
in
let p' = Normal_population.sample p x' in
Hashtbl.replace timings name p'
Expand Down
3 changes: 2 additions & 1 deletion ocaml/forkexecd/test/fe_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ let test_internal_failure_error () =
Forkhelpers.safe_close_and_exec None (Some fd) None [] exe args |> ignore ;
fail "Expected an exception"
with
| Fd_send_recv.Unix_error _ ->
| Fd_send_recv.Unix_error _ | Unix.Unix_error (Unix.EBADF, _, _) ->
leak_fd_detect ()
| e ->
Printexc.print_backtrace stderr ;
fail "Failed with unexpected exception: %s" (Printexc.to_string e)

let master fds =
Expand Down
3 changes: 3 additions & 0 deletions ocaml/idl/datamodel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7866,6 +7866,7 @@ let all_system =
; Datamodel_diagnostics.t
; Datamodel_repository.t
; Datamodel_observer.t
; Datamodel_vm_group.t
]

(* If the relation is one-to-many, the "many" nodes (one edge each) must come before the "one" node (many edges) *)
Expand Down Expand Up @@ -7946,6 +7947,7 @@ let all_relations =
; ((_network_sriov, "physical_PIF"), (_pif, "sriov_physical_PIF_of"))
; ((_network_sriov, "logical_PIF"), (_pif, "sriov_logical_PIF_of"))
; ((_certificate, "host"), (_host, "certificates"))
; ((_vm, "groups"), (_vm_group, "VMs"))
]

let update_lifecycles =
Expand Down Expand Up @@ -8077,6 +8079,7 @@ let expose_get_all_messages_for =
; _vmpp
; _vmss
; _vm_appliance
; _vm_group
; _pci
; _pgpu
; _gpu_group
Expand Down
10 changes: 9 additions & 1 deletion ocaml/idl/datamodel_certificate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,16 @@ let t =
; field ~qualifier:StaticRO ~lifecycle ~ty:DateTime "not_after"
~default_value:(Some (VDateTime Date.never))
"Date before which the certificate is valid"
; field ~qualifier:StaticRO ~lifecycle ~ty:String "fingerprint"
; field ~qualifier:StaticRO
~lifecycle:
[(Published, rel_stockholm, ""); (Deprecated, "24.19.0", "")]
~ty:String "fingerprint" ~default_value:(Some (VString ""))
"Use fingerprint_sha256 instead"
; field ~qualifier:StaticRO ~lifecycle ~ty:String "fingerprint_sha256"
~default_value:(Some (VString ""))
"The certificate's SHA256 fingerprint / hash"
; field ~qualifier:StaticRO ~lifecycle ~ty:String "fingerprint_sha1"
~default_value:(Some (VString ""))
"The certificate's SHA1 fingerprint / hash"
]
~messages:[] ()
4 changes: 3 additions & 1 deletion ocaml/idl/datamodel_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ open Datamodel_roles
to leave a gap for potential hotfixes needing to increment the schema version.*)
let schema_major_vsn = 5

let schema_minor_vsn = 778
let schema_minor_vsn = 779

(* Historical schema versions just in case this is useful later *)
let rio_schema_major_vsn = 5
Expand Down Expand Up @@ -205,6 +205,8 @@ let _vm_guest_metrics = "VM_guest_metrics"

let _vm_appliance = "VM_appliance"

let _vm_group = "VM_group"

let _dr_task = "DR_task"

let _vmpp = "VMPP"
Expand Down
7 changes: 6 additions & 1 deletion ocaml/idl/datamodel_errors.ml
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,10 @@ let _ =
error Api_errors.wlb_timeout ["configured_timeout"]
~doc:"The communication with the WLB server timed out." () ;
error Api_errors.wlb_authentication_failed []
~doc:"WLB rejected our configured authentication details." () ;
~doc:
"Failed to authenticate with the WLB server, the provided credentials \
are invalid."
() ;
error Api_errors.wlb_malformed_request []
~doc:"WLB rejected the server's request as malformed." () ;
error Api_errors.wlb_malformed_response
Expand Down Expand Up @@ -1963,6 +1966,8 @@ let _ =
error Api_errors.host_evacuation_is_required ["host"]
~doc:"Host evacuation is required before applying updates." () ;

error Api_errors.too_many_groups [] ~doc:"VM can only belong to one group." () ;

message
(fst Api_messages.ha_pool_overcommitted)
~doc:
Expand Down
3 changes: 2 additions & 1 deletion ocaml/idl/datamodel_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,7 @@ let set_power_on_mode =
[
(Published, rel_cowley, "")
; (Changed, rel_stockholm, "Removed iLO script")
; (Changed, "24.19.0", "Replaced DRAC mode with IPMI")
]
~in_product_since:rel_midnight_ride
~doc:"Set the power-on-mode, host, user and password"
Expand All @@ -1375,7 +1376,7 @@ let set_power_on_mode =
(Ref _host, "self", "The host")
; ( String
, "power_on_mode"
, "power-on-mode can be empty, wake-on-lan, DRAC or other"
, "power-on-mode can be empty, wake-on-lan, IPMI or other"
)
; (Map (String, String), "power_on_config", "Power on config")
]
Expand Down
Loading

0 comments on commit 47a3f7d

Please sign in to comment.