Skip to content
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

Bring feature/perf up-to-date with master #5582

Merged
merged 80 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
d37b866
CA-388860: set xapi-guard cache capacity to 512
psafont Mar 6, 2024
ec68831
xapi-guard-test: Direct loglines to stdout
psafont Mar 7, 2024
64fdc74
CP-46576: Add standard http attributes
GabrielBuica Mar 26, 2024
364073a
CA-388860: xapi-guard cache now starts in the most efficient mode
psafont Mar 6, 2024
b06b27c
CA-388860: xapi-guard cache: protect against invalid keys
psafont Mar 8, 2024
7f0afec
CP-48385: xapi-guard cache: do not spam logs on errors
psafont Mar 11, 2024
7268e36
CP-48385: xapi-guard: Remove the notion of temporary writes
psafont Mar 11, 2024
add5d2c
Merge pull request #5506 from psafont/private/paus/twins
psafont Mar 27, 2024
66f33ac
CA-384483: Can't export VDI to VHD file with base VDI
minglumlu Mar 28, 2024
8017465
CA-378317 fix EBADF in waitpid_nohang (v3)
Jun 23, 2023
a7087df
Merge pull request #5535 from minglumlu/private/mingl/CA-384483
minglumlu Mar 28, 2024
599a9c6
CP-47660 define anti-affinity feature
LunfanZhang Mar 29, 2024
ec36f8b
Use Magic MIME to determine fileserver's response content type
benjamreis Mar 29, 2024
dcbdbb9
Add minor test to forkexec test_exitcode test
freddy77 Mar 17, 2024
28135b5
Make it easier to run forkexecd tests manually
freddy77 Apr 4, 2024
bf93ab3
Add test for output strings
freddy77 Apr 5, 2024
1ce582a
Add test for input strings
freddy77 Apr 5, 2024
53d5ae8
build: add sdk-build-c Makefile rule to test building C SDK locally
edwintorok Feb 7, 2024
484b098
CA_388624: fix(C SDK): fix build failure with recent GCC
edwintorok Feb 7, 2024
f106b8f
Merge pull request #5547 from danilo-delbusso/dev/port-fedora-fix
kc284 Apr 8, 2024
14052b2
CA-390988: Prevent varstored-guard from shutting down while domains run
psafont Apr 8, 2024
f8f3d61
CP-46851: Allow metadata-exports of snapshots
robhoes Dec 4, 2023
1141b8a
CP-46851: return snapshot refs when importing exclusively snapshots
robhoes Jan 9, 2024
e9431c6
CP-46851: Add metadata_export to VM.allowed_operations
robhoes Jan 16, 2024
f48b878
CP-46851: add parameter to skip device types on get_export_metadata
psafont Mar 19, 2024
e67585c
CP-46851: Add device types excluded to exports in xe-cli
psafont Mar 21, 2024
d772c39
xapi-cli-server: simplify vm-export and helpers
psafont Mar 20, 2024
f237795
datamodel_vm: fix typo
psafont Mar 19, 2024
5013382
.git-blame-ignore-revs: ignore another reformatting commit
psafont Mar 19, 2024
85d5c86
xapi/export: do not miss parameters for export_metadata on logs
psafont Mar 21, 2024
0c6805f
xapi/export: set a date when generating tarballs
psafont Mar 25, 2024
e6f5c5c
Merge pull request #5545 from freddy77/forkexec_minor
psafont Apr 8, 2024
6089fe2
Merge pull request #5550 from psafont/private/paus/later
psafont Apr 9, 2024
6dea56a
Merge pull request #5544 from psafont/private/paus/chelydra
psafont Apr 9, 2024
e2eb7b2
Detect automatically whether we are on cygwin.
kc284 Apr 7, 2024
ade81da
Use templates to generate all the C files. CA-387885 (do not call int…
kc284 Apr 4, 2024
e6afe15
Removed erroneously ported recipe.
kc284 Apr 10, 2024
92276c5
CP-47033: Protocol_{lwt,async}: process requests concurrently (optional)
edwintorok Dec 15, 2023
8b81958
CP-47033: Make message switch concurrent processing optional
Vincent-lau Dec 20, 2023
966b636
CP-47033: Add test for concurrent message switch server
Vincent-lau Jan 29, 2024
790e6fe
Remove mention of `dotnet-packages` in `sdk-gen`'s README
danilo-delbusso Apr 11, 2024
e3d2299
CP-48768: Update Folder Structure section in PS SDK's READMEs
danilo-delbusso Apr 11, 2024
01487ea
Merge pull request #5404 from Vincent-lau/private/shul2/switch-optional
Vincent-lau Apr 11, 2024
cee08ad
CA-391485: Avoid InterpolationSyntaxError by turning off interpolation
snwoods Apr 11, 2024
27f5adc
Merge pull request #5557 from snwoods/private/stevenwo/CA-391485
snwoods Apr 12, 2024
f4aadeb
opam: add xapi-log to message-switch-core dependencies
psafont Apr 12, 2024
e505d89
Remove _t suffix for syslog_stdout_t type
freddy77 Apr 12, 2024
9638038
Merge pull request #5560 from freddy77/underscore_t
psafont Apr 12, 2024
97e8c14
CA-389929: xenopsd: fix Xen version comparison. 4.17 is > 4.2, not lo…
edwintorok Mar 12, 2024
7eab5fe
Merge pull request #5509 from edwintorok/private/edvint/xenver
edwintorok Apr 15, 2024
0d1d992
Add test for lock implementation in message_switch
Vincent-lau Jan 16, 2024
b69f75a
Merge pull request #5539 from LunfanZhang/private/luzhan/CP-47660
robhoes Apr 15, 2024
d26f0b8
Check elapsed time for timeout test
freddy77 Apr 7, 2024
4cdebd7
Merge pull request #5558 from psafont/opamfix
psafont Apr 15, 2024
5b59bc6
Merge pull request #5559 from freddy77/elapsed_test
psafont Apr 15, 2024
eb5d0fe
CP-47991: add CBT fields to the volume struct
MarkSymsCtx Mar 27, 2024
d384dbc
CP-46576: Add standard network attributes
GabrielBuica Mar 26, 2024
9bc4c1f
Merge pull request #5562 from MarkSymsCtx/CP-47991
psafont Apr 16, 2024
7d135a9
Merge pull request #5536 from GabrielBuica/private/dbuica/CP-46576
psafont Apr 17, 2024
74f7437
ocaml/idl: generate enum{_to_string,__all} functions
psafont Apr 17, 2024
c20b11e
test: add tests for allowed VM operations
psafont Apr 16, 2024
723a498
ocaml/xapi: use generated enum list instead of hand-maintained ones
psafont Apr 17, 2024
2d5f9a7
Merge pull request #5362 from Vincent-lau/private/shul2/async-race
psafont Apr 18, 2024
6681b7d
Added github workflow to build and release the C SDK.
kc284 Apr 11, 2024
f753ee2
xenopsd: add mli to cli/xn and remove unused code
psafont Apr 18, 2024
21721ad
Merge pull request #5570 from psafont/xn
psafont Apr 19, 2024
aeee6ce
Merge pull request #5563 from psafont/test_allowed
robhoes Apr 19, 2024
e2b0a40
Merge pull request #5555 from kc284/private/konstantin1/sdk-c
robhoes Apr 19, 2024
577d424
CP-48195: Split tracing library
GabrielBuica Apr 9, 2024
af2f199
CP-48195: Improvements to `tracing_export`
GabrielBuica Apr 15, 2024
d049d43
CP-48195: Add `with_tracing` helper function
GabrielBuica Apr 9, 2024
51205fa
PCI passthrough API
benjamreis Mar 11, 2024
dbfa07b
Merge pull request #5542 from xcp-ng/pci-hide-api
psafont Apr 19, 2024
6a0142f
IH-553: Optimize Sexpr.escape
edwintorok Apr 19, 2024
d989d24
IH-553: Sexpr.escape should be a noop when nothing to escape
edwintorok Apr 19, 2024
6f15c30
IH-553: Optimise SExpr.unescape
edwintorok Apr 19, 2024
f1903aa
Merge pull request #5576 from edwintorok/private/edvint/sexpr
robhoes Apr 22, 2024
f208e2f
Merge pull request #5551 from GabrielBuica/private/dbuica/CP-48195-v2
robhoes Apr 22, 2024
374aa42
Merge remote-tracking branch 'upstream/master' into feature/perf
edwintorok Apr 22, 2024
916b6e0
fixup! scripts/xentrace: detect host CPU spikes and dump xentrace
edwintorok Apr 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ b020cf35a1f2c274f95a4118d4596043cba6113f
ff39018fd6d91985f9c893a56928771dfe9fa48d
cbb9edb17dfd122c591beb14d1275acc39492335
d6ab15362548b8fe270bd14d5153b8d94e1b15c0
b12cf444edea15da6274975e1b2ca6a7fce2a090

# ocp-indent
d018d26d6acd4707a23288b327b49e44f732725e
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/generate-and-build-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
shell: bash
run: opam exec -- make sdk

- name: Store C SDK source
uses: actions/upload-artifact@v4
with:
name: SDK_Source_C
path: _build/install/default/xapi/sdk/c/*

- name: Store C# SDK source
uses: actions/upload-artifact@v4
with:
Expand All @@ -39,6 +45,30 @@ jobs:
- name: Cleanup XenAPI environment
uses: ./.github/workflows/cleanup-xapi-environment

build-c-sdk:
name: Build C SDK
runs-on: ubuntu-latest
needs: generate-sdk-sources
steps:
- name: Install dependencies
run: sudo apt-get install libxml2-dev

- name: Retrieve C SDK source
uses: actions/download-artifact@v4
with:
name: SDK_Source_C
path: source/

- name: Build C SDK
shell: bash
run: make -C source

- name: Store C SDK
uses: actions/upload-artifact@v4
with:
name: SDK_Artifacts_C
path: source/*

build-csharp-sdk:
name: Build C# SDK
runs-on: windows-2022
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
name: XenAPI
path: dist/

- name: Retrieve C SDK distribution binaries
uses: actions/download-artifact@v4
with:
name: SDK_Artifacts_C
path: libxenserver/usr/local/

- name: Retrieve C# SDK distribution artifacts
uses: actions/download-artifact@v4
with:
Expand All @@ -70,10 +76,19 @@ jobs:
name: SDK_Binaries_XenServerPowerShell_NET6
path: sdk_powershell_7x/

- name: Package C SDK artifacts for deployment
shell: bash
run: |
mkdir -p libxenserver/usr/local/lib
mv libxenserver/usr/local/libxenserver.* libxenserver/usr/local/lib/
tar -zcvf libxenserver-prerelease.tar.gz -C ./libxenserver usr/local/lib/ usr/local/include/xen/api
rm -rf libxenserver/usr/local/lib/
tar -zcvf libxenserver-prerelease.src.tar.gz -C ./libxenserver/usr/local .

- name: Zip PowerShell 5.x SDK artifacts for deployment
shell: bash
run: zip PowerShell-SDK-5.x-prerelease-unsigned.zip ./sdk_powershell_5x -r

- name: Zip PowerShell 7.x SDK artifacts for deployment
shell: bash
run: zip PowerShell-SDK-7.x-prerelease-unsigned.zip ./sdk_powershell_7x -r
Expand All @@ -83,7 +98,8 @@ jobs:
run: |
gh release create ${{ github.ref_name }} --repo ${{ github.repository }} --generate-notes dist/* \
PowerShell-SDK-5.x-prerelease-unsigned.zip \
PowerShell-SDK-7.x-prerelease-unsigned.zip
PowerShell-SDK-7.x-prerelease-unsigned.zip \
libxenserver-prerelease.tar.gz libxenserver-prerelease.src.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ sdk:
sh ocaml/sdk-gen/windows-line-endings.sh $(XAPISDK)/csharp
sh ocaml/sdk-gen/windows-line-endings.sh $(XAPISDK)/powershell

.PHONY: sdk-build-c sdk
.PHONY: sdk-build-c

sdk-build-c: sdk
cd _build/install/default/xapi/sdk/c && make -j $(JOBS)
cd _build/install/default/xapi/sdk/c && make clean && make -j $(JOBS)

.PHONY: sdk-build-java

Expand Down
1 change: 1 addition & 0 deletions forkexec.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ depends: [
"xapi-log"
"xapi-stdext-pervasives"
"xapi-stdext-unix"
"xapi-tracing"
]
synopsis: "Sub-process control service for xapi"
description:
Expand Down
1 change: 1 addition & 0 deletions forkexec.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ depends: [
"xapi-log"
"xapi-stdext-pervasives"
"xapi-stdext-unix"
"xapi-tracing"
]
synopsis: "Sub-process control service for xapi"
description:
Expand Down
1 change: 1 addition & 0 deletions message-switch-core.opam
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ depends: [
"ppx_sexp_conv"
"rpclib"
"sexplib"
"xapi-log"
]
synopsis: "A simple store-and-forward message switch"
description: """
Expand Down
1 change: 1 addition & 0 deletions message-switch-core.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ depends: [
"ppx_sexp_conv"
"rpclib"
"sexplib"
"xapi-log"
]
synopsis: "A simple store-and-forward message switch"
description: """
Expand Down
1 change: 1 addition & 0 deletions ocaml/forkexecd/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
xapi-log
xapi-stdext-pervasives
xapi-stdext-unix
xapi-tracing
)
(preprocess
(pps ppx_deriving_rpc)))
4 changes: 2 additions & 2 deletions ocaml/forkexecd/lib/fe.ml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
(* Disable "Warning 39: unused rec flag." caused by rpc *)
[@@@warning "-39"]

type syslog_stdout_t = {enabled: bool; key: string option} [@@deriving rpc]
type syslog_stdout = {enabled: bool; key: string option} [@@deriving rpc]

type setup_cmd = {
cmdargs: string list
; env: string list
; id_to_fd_map: (string * int option) list
; syslog_stdout: syslog_stdout_t
; syslog_stdout: syslog_stdout
; redirect_stderr_to_stdout: bool
}
[@@deriving rpc]
Expand Down
55 changes: 47 additions & 8 deletions ocaml/forkexecd/lib/forkhelpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

(* XXX: this is a work in progress *)

module D = Debug.Make (struct let name = __MODULE__ end)

let default_path = ["/sbin"; "/usr/sbin"; "/bin"; "/usr/bin"]

let default_path_env_pair = [|"PATH=" ^ String.concat ":" default_path|]
Expand All @@ -34,6 +36,10 @@ let test_path =

let runtime_path = Option.value ~default:"/var" test_path

let _with_tracing ?tracing ~name f =
let name = Printf.sprintf "forkhelpers.%s" name in
Tracing.with_tracing ?parent:tracing ~name f

let finally = Xapi_stdext_pervasives.Pervasiveext.finally

type pidty = Unix.file_descr * int
Expand Down Expand Up @@ -72,14 +78,47 @@ let waitpid (sock, pid) =
in
failwith msg

let waitpid_nohang ((sock, _) as x) =
(* [waitpid_nohang] reports the status of a socket to a process. The
intention is to make this non-blocking. If the process is finished,
the socket is closed and not otherwise. *)
let waitpid_nohang (sock, pid) =
let verbose = false in
if verbose then D.debug "%s pid=%d" __FUNCTION__ pid ;
let fail fmt = Printf.kprintf failwith fmt in
Unix.set_nonblock sock ;
let r =
try waitpid x
with Unix.(Unix_error ((EAGAIN | EWOULDBLOCK), _, _)) ->
(0, Unix.WEXITED 0)
in
Unix.clear_nonblock sock ; r
match Fecomms.read_raw_rpc sock with
| Ok Fe.(Finished (WEXITED n)) ->
if verbose then D.debug "%s pid=%d WEXITED" __FUNCTION__ pid ;
Unix.close sock ;
(pid, Unix.WEXITED n)
| Ok Fe.(Finished (WSIGNALED n)) ->
if verbose then D.debug "%s pid=%d WSIGNALED" __FUNCTION__ pid ;
Unix.close sock ;
(pid, Unix.WSIGNALED n)
| Ok Fe.(Finished (WSTOPPED n)) ->
if verbose then D.debug "%s pid=%d WSTOPPED" __FUNCTION__ pid ;
Unix.close sock ;
(pid, Unix.WSTOPPED n)
| Ok status ->
Unix.clear_nonblock sock ;
fail "%s: unexpected status received (%s)" __FUNCTION__
(Fe.ferpc_to_string status)
| Error msg ->
D.debug "%s pid=%d %s" __FUNCTION__ pid msg ;
Unix.clear_nonblock sock ;
fail "%s: error happened when trying to read the status. %s" __FUNCTION__
msg
(* it's a bit crazy that we have Result.t and exceptions from
read_raw_rpc *)
| exception Unix.(Unix_error ((EAGAIN | EWOULDBLOCK), _, _)) ->
if verbose then D.debug "%s pid=%d EAGAIN EWOULDBLOCK" __FUNCTION__ pid ;
Unix.clear_nonblock sock ;
(0, Unix.WEXITED 0) (* this a convention, see MLI *)
| exception exn ->
D.debug "%s pid=%d %s" __FUNCTION__ pid (Printexc.to_string exn) ;
Unix.clear_nonblock sock ;
fail "%s: error happened when trying to read the status. %s" __FUNCTION__
(Printexc.to_string exn)

let dontwaitpid (sock, _pid) =
( try
Expand Down Expand Up @@ -136,7 +175,7 @@ let with_logfile_fd ?(delete = true) prefix f =

exception Spawn_internal_error of string * string * Unix.process_status

type syslog_stdout_t =
type syslog_stdout =
| NoSyslogging
| Syslog_DefaultKey
| Syslog_WithKey of string
Expand Down
14 changes: 8 additions & 6 deletions ocaml/forkexecd/lib/forkhelpers.mli
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

(** {2 High-level interface } *)

type syslog_stdout_t =
type syslog_stdout =
| NoSyslogging
| Syslog_DefaultKey
| Syslog_WithKey of string
Expand All @@ -45,7 +45,7 @@ val default_path_env_pair : string array

val execute_command_get_output :
?env:string array
-> ?syslog_stdout:syslog_stdout_t
-> ?syslog_stdout:syslog_stdout
-> ?redirect_stderr_to_stdout:bool
-> ?timeout:float
-> string
Expand All @@ -57,7 +57,7 @@ val execute_command_get_output :

val execute_command_get_output_send_stdin :
?env:string array
-> ?syslog_stdout:syslog_stdout_t
-> ?syslog_stdout:syslog_stdout
-> ?redirect_stderr_to_stdout:bool
-> ?timeout:float
-> string
Expand Down Expand Up @@ -97,7 +97,7 @@ val safe_close_and_exec :
-> Unix.file_descr option
-> Unix.file_descr option
-> (string * Unix.file_descr) list
-> ?syslog_stdout:syslog_stdout_t
-> ?syslog_stdout:syslog_stdout
-> ?redirect_stderr_to_stdout:bool
-> string
-> string list
Expand All @@ -111,8 +111,10 @@ val waitpid : pidty -> int * Unix.process_status
(** [waitpid p] returns the (pid, Unix.process_status) *)

val waitpid_nohang : pidty -> int * Unix.process_status
(** [waitpid_nohang p] returns the (pid, Unix.process_status) if the process has already
quit or (0, Unix.WEXITTED 0) if the process is still running. *)
(** [waitpid_nohang p] returns the (pid, Unix.process_status) if the
process has already quit or (0, Unix.WEXITTED 0) if the process is
still running. If the process is finished, the socket is closed
and not otherwise. *)

val dontwaitpid : pidty -> unit
(** [dontwaitpid p]: signals the caller's desire to never call waitpid. Note that the final
Expand Down
4 changes: 2 additions & 2 deletions ocaml/forkexecd/src/child.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ let debug (fmt : ('a, unit, string, unit) format4) =

exception Cancelled

type syslog_stdout_t = {enabled: bool; key: string option}
type syslog_stdout = {enabled: bool; key: string option}

type state_t = {
cmdargs: string list
; env: string list
; id_to_fd_map: (string * int option) list
; syslog_stdout: syslog_stdout_t
; syslog_stdout: syslog_stdout
; redirect_stderr_to_stdout: bool
; ids_received: (string * Unix.file_descr) list
; fd_sock2: Unix.file_descr option
Expand Down
Loading
Loading