Skip to content

Commit 6a3e8c0

Browse files
authored
sync master to configure ssh (xapi-project#6282)
Resolved onflicts: ocaml/idl/datamodel_errors.ml ocaml/xapi-consts/api_errors.ml
2 parents 90e9602 + 28b6d33 commit 6a3e8c0

File tree

434 files changed

+8139
-2687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

434 files changed

+8139
-2687
lines changed

.github/workflows/generate-and-build-sdks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ jobs:
168168
run: |
169169
dotnet test source/XenServerTest `
170170
--disable-build-servers `
171+
-p:DefineConstants=BUILD_FOR_TEST `
171172
--verbosity=normal
172173
173174
- name: Build C# SDK

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: Build and test
22

33
on:
4+
# When only Hugo docs change, this workflow is not required:
45
push:
6+
paths-ignore:
7+
- 'doc/**'
8+
- '.github/workflows/hugo.yml'
59
pull_request:
610
schedule:
711
# run daily, this refreshes the cache

.github/workflows/other.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: Build and test (other)
22

33
on:
4+
# When only Hugo docs change, this workflow is not required:
45
push:
6+
paths-ignore:
7+
- 'doc/**'
8+
- '.github/workflows/hugo.yml'
59
pull_request:
610
schedule:
711
# run daily, this refreshes the cache

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ jobs:
2020
python-version: "3.x"
2121

2222
- name: Install build dependencies
23-
run: |
24-
pip install build
25-
sudo apt-get install ocaml dune libfindlib-ocaml-dev libdune-ocaml-dev libcmdliner-ocaml-dev
23+
run: pip install build
2624

2725
- name: Generate python package for XenAPI
2826
run: |
29-
./configure --xapi_version=${{ github.ref_name }}
27+
echo "export XAPI_VERSION=${{ github.ref_name }}" > config.mk
3028
make python
3129
3230
- name: Store python distribution artifacts

doc/README.md

Lines changed: 98 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,104 @@
1-
Quick start guide:
1+
# Quick start guide
2+
3+
- Visit <https://xapi-project.github.io/new-docs/> to view the current documentation.
4+
5+
## Required software
6+
7+
The docs use Hugo and the [Hugo Relearn theme](https://mcshelby.github.io/hugo-theme-relearn),
8+
an enhanced fork of the popular Hugo Learn theme.
9+
10+
### Supported versions of Hugo and the Hugo Relearn theme
11+
12+
Hugo Relearn 7.3.2 is currently used (defined by a git tag in `doc/go.mod`).
13+
14+
- The minimum Hugo version required by the Relearn theme is 0.126.0.
15+
- The current Ubuntu `snap` (which provides 0.142.0) also works.
16+
17+
## Installation
18+
19+
- Install Hugo 0.126 or newer (required by the Hugo Relearn theme)
20+
follow the guidance on <https://gohugo.io/installing>.
21+
You'll need to install Go as well: see <https://go.dev/>
22+
- On Ubuntu, use the `snap` package:
23+
- `sudo snap install hugo` installs the current version
24+
`apt-get install hugo` would install a version that is too old,
25+
(this applies up to Ubuntu 24.04)
26+
27+
- To install Hugo from source, you need a recent `golang-1.2x` compiler:
28+
- On Ubuntu 22.04, this can be done with:
29+
30+
```bash
31+
sudo apt install golang-1.23-go
32+
# Add it to your path, assuming your .local/bin/ is early in your PATH:
33+
ln -s /usr/lib/go-1.23/bin/go ~/.local/bin/go
34+
go version
35+
go install github.com/gohugoio/[email protected]
36+
```
37+
38+
## Development
239

3-
- Visit https://xapi-project.github.io/new-docs/ to view the current documentation.
4-
- Install Hugo; follow the guidance on https://gohugo.io/getting-started/installing.
5-
You'll need Go as well: see https://go.dev/
6-
- On Ubuntu 22.04 and older, use `sudo snap install hugo` to get the needed newer version of `hugo`.
740
- Run a local server: `hugo server`
8-
- Open a browser at http://127.0.0.1:1313/new-docs/
41+
- Open a browser at <http://127.0.0.1:1313/new-docs/>
942
- Add content to `doc/content/`:
1043
- Documents are written in Markdown.
11-
- Please wrap lines in paragraphs to make review and diffs easier to read.
12-
- The menu hierarchy comes mostly from the directory structure in `content/`.
44+
- Please wrap lines in paragraphs to make reviews more manageable.
45+
- The menu hierarchy comes mainly from the directory structure in `content/`.
1346
- A file called `_index.md` is needed in a directory to define a new level in the menu.
14-
- To set the page title which is also used for the main menu,
47+
- To set the page title,
1548
[use the front matter](https://gohugo.io/content-management/front-matter/).
16-
- For a page that has images or other stuff included, it is best to create a new directory. Put the contents in a `index.md` file (no `_`) and the related files next to it. See https://gohugo.io/content-management/organization/ for more information.
17-
- Look at https://mcshelby.github.io/hugo-theme-relearn/ for more information about what the Relearn theme offers, including some handy "shortcodes".
49+
- For a page that has images or other stuff included, it is best to create a new directory:
50+
Put the contents in an `index.md` file (no `_`) and the related files next to it.
51+
See <https://gohugo.io/content-management/organization/> for more information.
52+
53+
See <https://mcshelby.github.io/hugo-theme-relearn/> for more information about
54+
the features of the Relearn theme, including handy "shortcodes".
55+
56+
Note: When switching versions, before re-generating the documentation using
57+
`hugo server`, delete the previously generated static site using `rm -r docs/public`.
58+
59+
### Notes for supporting current versions of Hugo and the Relearn theme
60+
61+
Backported fixes to support newer Hugo versions:
62+
63+
- `layouts/partials/header.html`, it fixes:
64+
```js
65+
ERROR deprecated: .Sites.First was deprecated in Hugo v0.127.0 and will be removed in Hugo 0.143.0. Use .Sites.Default instead.
66+
```
67+
- `layouts/partials/menu.html`, it fixes:
68+
```js
69+
ERROR deprecated: .Site.IsMultiLingual was deprecated in Hugo v0.124.0 and will be removed in Hugo 0.143.0. Use hugo.IsMultilingual instead.
70+
```
71+
72+
The fixes for those issues were backported from the Hugo Relearn v7.x.x theme.
73+
When updating to Hugo Relearn 7.x.x, please remove them (if possible).
74+
75+
#### Tips when upgradubg to newer Hugo Relearn versions
76+
77+
Check the release notes of the Hugo Relearn theme for breaking changes:
78+
https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes
79+
80+
These pages might need review when making changes as their content is
81+
generated by layouts/partials/content.html:
82+
83+
- XenAPI Reference: <https://xapi-project.github.io/new-docs/xen-api/classes>
84+
- XenAPI Releases: <https://xapi-project.github.io/new-docs/xen-api/releases>
85+
86+
For a summary of the partials supported by the Hugo Relearn theme, see:
87+
https://mcshelby.github.io/hugo-theme-relearn/configuration/customization/partials
88+
89+
Hint: For upgrading the Hugo Relearn theme, you can use:
90+
91+
```bash
92+
cd doc; hugo mod get -u github.com/McShelby/[email protected]
93+
```
94+
95+
#### Summary
96+
97+
Hugo >= 0.126 and the Hugo Relearn >= 7.3.2 are supported to render the docs.
98+
99+
#### References
100+
101+
- Changes with Relearn 6.x:
102+
<https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/6/#6-0-0>
103+
- Breaking changes with Relearn 7.x:
104+
<https://mcshelby.github.io/hugo-theme-relearn/introduction/releasenotes/7/#7-0-0>

doc/content/design/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
22
title = "Design Documents"
3-
menuTitle = "Designs"
3+
linkTitle = "Designs"
44
+++
55

66
{{< design_docs_list >}}

doc/content/design/coverage/index.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ revision: 2
88

99
We would like to add optional coverage profiling to existing [OCaml]
1010
projects in the context of [XenServer] and [XenAPI]. This article
11-
presents how we do it.
11+
presents how we do it.
1212

1313
Binaries instrumented for coverage profiling in the XenServer project
1414
need to run in an environment where several services act together as
@@ -21,7 +21,7 @@ isolation.
2121
To build binaries with coverage profiling, do:
2222

2323
./configure --enable-coverage
24-
make
24+
make
2525

2626
Binaries will log coverage data to `/tmp/bisect*.out` from which a
2727
coverage report can be generated in `coverage/`:
@@ -38,7 +38,7 @@ and logs during execution data to in-memory data structures. Before an
3838
instrumented binary terminates, it writes the logged data to a file.
3939
This data can then be analysed with the `bisect-ppx-report` tool, to
4040
produce a summary of annotated code that highlights what part of a
41-
codebase was executed.
41+
codebase was executed.
4242

4343
[BisectPPX] has several desirable properties:
4444

@@ -65,13 +65,13 @@ abstracted by OCamlfind (OCaml's library manager) and OCamlbuild
6565

6666
# build it with instrumentation from bisect_ppx
6767
ocamlbuild -use-ocamlfind -pkg bisect_ppx -pkg unix example.native
68-
68+
6969
# execute it - generates files ./bisect*.out
7070
./example.native
71-
71+
7272
# generate report
7373
bisect-ppx-report -I _build -html coverage bisect000*
74-
74+
7575
# view coverage/index.html
7676

7777
Summary:
@@ -86,7 +86,7 @@ will be instrumented during compilation. Behind the scenes `ocamlfind`
8686
makes sure that the compiler uses a preprocessing step that instruments
8787
the code.
8888

89-
## Signal Handling
89+
## Signal Handling
9090

9191
During execution the code instrumentation leads to the collection of
9292
data. This code registers a function with `at_exit` that writes the data
@@ -98,7 +98,7 @@ terminated by receiving the `TERM` signal, a signal handler must be
9898
installed:
9999

100100
let stop signal =
101-
printf "caught signal %d\n" signal;
101+
printf "caught signal %a\n" Debug.Pp.signal signal;
102102
exit 0
103103

104104
Sys.set_signal Sys.sigterm (Sys.Signal_handle stop)
@@ -149,8 +149,8 @@ environment variable. This can happen on the command line:
149149

150150
BISECT_FILE=/tmp/example ./example.native
151151

152-
In the context of XenServer we could do this in startup scripts.
153-
However, we added a bit of code
152+
In the context of XenServer we could do this in startup scripts.
153+
However, we added a bit of code
154154

155155
val Coverage.init: string -> unit
156156

@@ -176,12 +176,12 @@ Goals for instrumentation are:
176176

177177
* what files are instrumented should be obvious and easy to manage
178178
* instrumentation must be optional, yet easy to activate
179-
* avoid methods that require to keep several files in sync like multiple
179+
* avoid methods that require to keep several files in sync like multiple
180180
`_oasis` files
181181
* avoid separate Git branches for instrumented and non-instrumented
182182
code
183183

184-
In the ideal case, we could introduce a configuration switch
184+
In the ideal case, we could introduce a configuration switch
185185
`./configure --enable-coverage` that would prepare compilation for
186186
coverage instrumentation. While [Oasis] supports the creation of such
187187
switches, they cannot be used to control build dependencies like
@@ -196,7 +196,7 @@ rules in file `_tags.coverage` that cause files to be instrumented:
196196

197197
leads to the execution of this code during preparation:
198198

199-
coverage: _tags _tags.coverage
199+
coverage: _tags _tags.coverage
200200
test ! -f _tags.orig && mv _tags _tags.orig || true
201201
cat _tags.coverage _tags.orig > _tags
202202

@@ -207,7 +207,7 @@ could be tweaked to instrument only some files:
207207
<**/*.native>: pkg_bisect_ppx
208208

209209
When `make coverage` is not called, these rules are not active and
210-
hence, code is not instrumented for coverage. We believe that this
210+
hence, code is not instrumented for coverage. We believe that this
211211
solution to control instrumentation meets the goals from above. In
212212
particular, what files are instrumented and when is controlled by very
213213
few lines of declarative code that lives in the main repository of a
@@ -226,14 +226,14 @@ coverage analysis are:
226226
The `_oasis` file bundles the files under `profiling/` into an internal
227227
library which executables then depend on:
228228

229-
# Support files for profiling
229+
# Support files for profiling
230230
Library profiling
231231
CompiledObject: best
232232
Path: profiling
233233
Install: false
234234
Findlibname: profiling
235235
Modules: Coverage
236-
BuildDepends:
236+
BuildDepends:
237237

238238
Executable set_domain_uuid
239239
CompiledObject: best
@@ -243,16 +243,16 @@ library which executables then depend on:
243243
MainIs: set_domain_uuid.ml
244244
Install: false
245245
BuildDepends:
246-
xenctrl,
247-
uuidm,
246+
xenctrl,
247+
uuidm,
248248
cmdliner,
249249
profiling # <-- here
250250

251251
The `Makefile` target `coverage` primes the project for a profiling build:
252252

253253
# make coverage - prepares for building with coverage analysis
254254

255-
coverage: _tags _tags.coverage
255+
coverage: _tags _tags.coverage
256256
test ! -f _tags.orig && mv _tags _tags.orig || true
257257
cat _tags.coverage _tags.orig > _tags
258258

doc/content/design/cpu-levelling-v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The old XS 5.6-style Heterogeneous Pool feature that is based around hardware-le
2929
History
3030
=======
3131

32-
- Original XS 5.6 design: [heterogeneous-pools](../heterogeneous-pools)
32+
- Original XS 5.6 design: [heterogeneous-pools](heterogeneous-pools)
3333
- Changes made in XS 5.6 FP1 for the DR feature (added CPUID checks upon migration)
3434
- XS 6.1: migration checks extended for cross-pool scenario
3535

doc/content/design/emulated-pci-spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ status: proposed
1111
At present (early March 2015) the datamodel defines a VM as having a "platform" string-string map, in which two keys are interpreted as specifying a PCI device which should be emulated for the VM. Those keys are "device_id" and "revision" (with int values represented as decimal strings).
1212

1313
Limitations:
14-
* Hardcoded defaults are used for the the vendor ID and all other parameters except device_id and revision.
14+
* Hardcoded defaults are used for the vendor ID and all other parameters except device_id and revision.
1515
* Only one emulated PCI device can be specified.
1616

1717
When instructing qemu to emulate PCI devices, qemu accepts twelve parameters for each device.

doc/content/design/integrated-gpu-passthrough/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Introduction
1111
------------
1212

1313
Passthrough of discrete GPUs has been
14-
[available since XenServer 6.0]({{site.baseurl}}/xapi/design/gpu-passthrough.html).
14+
[available since XenServer 6.0](../gpu-passthrough.md).
1515
With some extensions, we will also be able to support passthrough of integrated
1616
GPUs.
1717

0 commit comments

Comments
 (0)