Skip to content

Commit 6b0576f

Browse files
author
Alexandra Iordache
authored
Merge branch 'master' into support_aarch64
2 parents 3db98cc + 0dcda0d commit 6b0576f

15 files changed

+51
-394
lines changed

.buildkite/hooks/post-checkout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22

3-
DEB_NAME="linux-image-4.9.0-11-amd64_4.9.189-3_amd64.deb"
3+
DEB_NAME="linux-image-4.9.0-12-amd64_4.9.210-1_amd64.deb"
44
DEB_URL="http://ftp.debian.org/debian/pool/main/l/linux/${DEB_NAME}"
55

66
REPO_PATH="${BUILDKITE_BUILD_CHECKOUT_PATH}"
77
DEB_PATH="${REPO_PATH}/${DEB_NAME}"
88
EXTRACT_PATH="${REPO_PATH}/src/bzimage-archive"
9-
BZIMAGE_PATH="${EXTRACT_PATH}/boot/vmlinuz-4.9.0-11-amd64"
9+
BZIMAGE_PATH="${EXTRACT_PATH}/boot/vmlinuz-4.9.0-12-amd64"
1010

1111
mkdir -p ${EXTRACT_PATH}
1212

.buildkite/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ steps:
1010
platform: x86_64.metal
1111
plugins:
1212
- docker#v3.0.1:
13-
image: "rustvmm/dev:v2"
13+
image: "rustvmm/dev:v5"
1414
always-pull: true
1515

1616
- label: "build-musl-x86-bzimage"
@@ -22,5 +22,5 @@ steps:
2222
platform: x86_64.metal
2323
plugins:
2424
- docker#v3.0.1:
25-
image: "rustvmm/dev:v2"
25+
image: "rustvmm/dev:v5"
2626
always-pull: true

.buildkite/rust-vmm-ci-pipeline.yml

Lines changed: 0 additions & 176 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/target
22
**/*.rs.bk
33
Cargo.lock
4+
.idea/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "rust-vmm-ci"]
2+
path = rust-vmm-ci
3+
url = https://github.com/rust-vmm/rust-vmm-ci.git

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ elf = []
1111
bzimage = []
1212
arm64_pe = []
1313

14-
[dependencies.vm-memory]
15-
git = "https://github.com/rust-vmm/vm-memory"
16-
features = ["backend-mmap"]
14+
[dependencies]
15+
vm-memory = {version = "0.1.0", features = ["backend-mmap"]}

README.md

Lines changed: 17 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -18,88 +18,40 @@ cargo build
1818
Our Continuous Integration (CI) pipeline is implemented on top of
1919
[Buildkite](https://buildkite.com/).
2020
For the complete list of tests, check our
21-
[CI pipeline](https://buildkite.com/rust-vmm/vm-virtio-ci).
21+
[CI pipeline](https://buildkite.com/rust-vmm/rust-vmm-ci).
2222

2323
Each individual test runs in a container. To reproduce a test locally, you can
2424
use the dev-container on both x86 and arm64.
2525

2626
```bash
27+
container_version=5
2728
docker run -it \
2829
--security-opt seccomp=unconfined \
2930
--volume $(pwd):/linux-loader \
30-
rustvmm/dev:v2
31+
rustvmm/dev:v${container_version}
3132
cd linux-loader/
3233
cargo test
3334
```
3435

35-
### Test Profiles
36-
37-
The integration tests support two test profiles:
38-
- **devel**: this is the recommended profile for running the integration tests
39-
on a local development machine.
40-
- **ci** (default option): this is the profile used when running the
41-
integration tests as part of the the Continuous Integration (CI).
42-
43-
The test profiles are applicable to tests that run using pytest. Currently only
44-
the [coverage test](tests/test_coverage.py) follows this model as all the other
45-
integration tests are run using the
46-
[Buildkite pipeline](https://buildkite.com/rust-vmm/vm-virtio-ci).
47-
48-
The difference between is declaring tests as passed or failed:
49-
- with the **devel** profile the coverage test passes if the current coverage
50-
is equal or higher than the upstream coverage value. In case the current
51-
coverage is higher, the coverage file is updated to the new coverage value.
52-
- with the **ci** profile the coverage test passes only if the current coverage
53-
is equal to the upstream coverage value.
54-
55-
Further details about the coverage test can be found in the
56-
[Adaptive Coverage](#adaptive-coverage) section.
57-
58-
### Adaptive Coverage
36+
### bzImage test
5937

60-
The line coverage is saved in [tests/coverage](tests/coverage). To update the
61-
coverage before submitting a PR, run the coverage test:
38+
As we don't want to distribute an entire kernel bzImage, the `load_bzImage`
39+
test is ignored by default. In order to test the bzImage support, one needs to
40+
locally build a bzImage, copy it to the `src/loader` directory and run
41+
`cargo test`:
6242

6343
```bash
44+
# Assuming your linux-loader and linux-stable are both under ${LINUX_LOADER}:
45+
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ${LINUX_LOADER}/linux-stable
46+
cd linux-stable
47+
make bzImage
48+
cp linux-stable/arch/x86/boot/bzImage ${LINUX_LOADER}/linux-loader/src/loader/
49+
cd ${LINUX_LOADER}/linux-loader
50+
container_version=5
6451
docker run -it \
6552
--security-opt seccomp=unconfined \
6653
--volume $(pwd):/linux-loader \
67-
rustvmm/dev:v2
54+
rustvmm/dev:v${container_version}
6855
cd linux-loader/
69-
pytest --profile=devel tests/test_coverage.py
70-
```
71-
72-
If the PR coverage is higher than the upstream coverage, the coverage file
73-
needs to be manually added to the commit before submitting the PR:
74-
75-
```bash
76-
git add tests/coverage
77-
```
78-
79-
Failing to do so will generate a fail on the CI pipeline when publishing the
80-
PR.
81-
82-
**NOTE:** The coverage file is only updated in the `devel` test profile. In
83-
the `ci` profile the coverage test will fail if the current coverage is higher
84-
than the coverage reported in [tests/coverage](tests/coverage).
85-
86-
### bzImage test
87-
88-
As we don't want to distribute an entire kernel bzImage, the `load_bzImage` test is ignored by
89-
default. In order to test the bzImage support, one needs to locally build a bzImage, copy it
90-
to the `src/loader` directory and run cargo test:
91-
92-
```shell
93-
# Assuming your linux-loader and linux-stable are both under $LINUX_LOADER
94-
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git $LINUX_LOADER/linux-stable
95-
$ cd linux-stable
96-
$ make bzImage
97-
$ cp linux-stable/arch/x86/boot/bzImage $LINUX_LOADER/linux-loader/src/loader/
98-
$ cd $LINUX_LOADER/linux-loader
99-
$ docker run -it \
100-
--security-opt seccomp=unconfined \
101-
--volume $(pwd):/linux-loader \
102-
rustvmm/dev:v2
103-
$ cd linux-loader/
104-
$ cargo test
56+
cargo test
10557
```

coverage_config_aarch64.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"coverage_score": 71,
3+
"exclude_path": "",
4+
"crate_features": ""
5+
}

coverage_config_x86_64.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"coverage_score": 75.9,
3+
"exclude_path": "",
4+
"crate_features": ""
5+
}

rust-vmm-ci

Submodule rust-vmm-ci added at cd7096e

src/loader/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ pub fn load_cmdline<M: GuestMemory>(
526526
let end = guest_addr
527527
.checked_add(len as u64 + 1)
528528
.ok_or(Error::CommandLineOverflow)?; // Extra for null termination.
529-
if end > guest_mem.end_addr() {
530-
return Err(Error::CommandLineOverflow)?;
529+
if end > guest_mem.last_addr() {
530+
return Err(Error::CommandLineOverflow);
531531
}
532532

533533
guest_mem
@@ -546,7 +546,7 @@ mod test {
546546
const MEM_SIZE: u64 = 0x1000000;
547547

548548
fn create_guest_mem() -> GuestMemoryMmap {
549-
GuestMemoryMmap::new(&[(GuestAddress(0x0), (MEM_SIZE as usize))]).unwrap()
549+
GuestMemoryMmap::from_ranges(&[(GuestAddress(0x0), (MEM_SIZE as usize))]).unwrap()
550550
}
551551

552552
#[cfg(feature = "bzimage")]

0 commit comments

Comments
 (0)