mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d412ac2182 | ||
|
|
628bb74cce | ||
|
|
5dc1668927 | ||
|
|
8d8791c95d | ||
|
|
ade49a9fd2 | ||
|
|
87d765a168 | ||
|
|
98b28d5866 | ||
|
|
c2664e6a8d | ||
|
|
88087c18b0 | ||
|
|
22867232e1 | ||
|
|
3f489286c5 | ||
|
|
13772c5a65 | ||
|
|
fde74c57ad | ||
|
|
b665aa19f4 | ||
|
|
3d3693699b | ||
|
|
1ed31abb5d | ||
|
|
1446873b28 | ||
|
|
5f04c9b6fe | ||
|
|
46d59f0bc4 | ||
|
|
9add5263f7 | ||
|
|
dfaa151dfc | ||
|
|
2cd5b0b5e0 | ||
|
|
d08365a131 | ||
|
|
496d4c204b | ||
|
|
e0b863ecfe | ||
|
|
beb353eab2 | ||
|
|
1cfe096fb1 | ||
|
|
c8c68f3f77 | ||
|
|
77634a3c05 | ||
|
|
ab18a923f1 | ||
|
|
9f316b2e50 | ||
|
|
a03f17a275 | ||
|
|
c14f9ee2f4 | ||
|
|
ec56f07316 | ||
|
|
574d86dd4d | ||
|
|
a633b009ed | ||
|
|
b475965632 | ||
|
|
11b1ab40a5 | ||
|
|
10e77ebd1e | ||
|
|
167ae5a78a | ||
|
|
8736256564 | ||
|
|
55e08edd7f | ||
|
|
54f66aaadc | ||
|
|
d656058c21 | ||
|
|
3227372fe0 | ||
|
|
ac3f51002d | ||
|
|
0d2e2cd4c3 | ||
|
|
1fc969d37a | ||
|
|
27f5016ad3 | ||
|
|
a0ddcc68d7 | ||
|
|
df5aecd144 | ||
|
|
862d267302 | ||
|
|
44d9c7fd42 | ||
|
|
12abe2dd2b | ||
|
|
39a81c596f | ||
|
|
3b0d2e796b | ||
|
|
42357c01f3 | ||
|
|
b7b5b9d7e6 | ||
|
|
a63e064004 | ||
|
|
62c1f39ea2 | ||
|
|
460ba718d4 | ||
|
|
c91a8e1324 | ||
|
|
1adfb7e9f8 | ||
|
|
8dd4d42053 | ||
|
|
3834b43878 | ||
|
|
52605cc0e4 | ||
|
|
92beda1e32 | ||
|
|
167fef382a | ||
|
|
5126e9b26e | ||
|
|
59bd682b1f | ||
|
|
8e3b351038 | ||
|
|
3f8d06b47e |
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
- stable
|
- stable
|
||||||
- beta
|
- beta
|
||||||
- nightly
|
- nightly
|
||||||
- "1.60"
|
- "1.65"
|
||||||
target:
|
target:
|
||||||
- x86_64-unknown-linux-gnu
|
- x86_64-unknown-linux-gnu
|
||||||
- x86_64-unknown-linux-musl
|
- x86_64-unknown-linux-musl
|
||||||
|
|||||||
90
.github/workflows/release.yaml
vendored
90
.github/workflows/release.yaml
vendored
@@ -1,62 +1,48 @@
|
|||||||
name: Cloud Hypervisor Release
|
name: Cloud Hypervisor Release
|
||||||
on: [create]
|
on: [pull_request, create]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
if: (github.event_name == 'create' && github.event.ref_type == 'tag') || github.event_name == 'pull_request'
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Code checkout
|
- name: Code checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Install musl-gcc
|
- name: Install musl-gcc
|
||||||
run: sudo apt install -y musl-tools
|
run: sudo apt install -y musl-tools
|
||||||
- name: Create release directory
|
- name: Create release directory
|
||||||
run: rsync -rv --exclude=.git . ../cloud-hypervisor-${{ github.event.ref }}
|
run: rsync -rv --exclude=.git . ../cloud-hypervisor-${{ github.event.ref }}
|
||||||
- name: Install Rust toolchain (x86_64-unknown-linux-gnu)
|
- name: Install Rust toolchain (x86_64-unknown-linux-gnu)
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: "1.62"
|
toolchain: "1.65"
|
||||||
target: x86_64-unknown-linux-gnu
|
target: x86_64-unknown-linux-gnu
|
||||||
- name: Install Rust toolchain (x86_64-unknown-linux-musl)
|
- name: Install Rust toolchain (x86_64-unknown-linux-musl)
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: "1.62"
|
toolchain: "1.65"
|
||||||
target: x86_64-unknown-linux-musl
|
target: x86_64-unknown-linux-musl
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
toolchain: "1.62"
|
toolchain: "1.65"
|
||||||
command: build
|
command: build
|
||||||
args: --all --release --target=x86_64-unknown-linux-gnu
|
args: --all --release --target=x86_64-unknown-linux-gnu
|
||||||
- name: Static Build
|
- name: Static Build
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
toolchain: "1.62"
|
toolchain: "1.65"
|
||||||
command: build
|
command: build
|
||||||
args: --all --release --target=x86_64-unknown-linux-musl
|
args: --all --release --target=x86_64-unknown-linux-musl
|
||||||
- name: Strip cloud-hypervisor binaries
|
|
||||||
run: strip target/*/release/cloud-hypervisor
|
|
||||||
- name: Install Rust toolchain (aarch64-unknown-linux-musl)
|
- name: Install Rust toolchain (aarch64-unknown-linux-musl)
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
toolchain: "1.62"
|
toolchain: "1.65"
|
||||||
target: aarch64-unknown-linux-musl
|
target: aarch64-unknown-linux-musl
|
||||||
override: true
|
override: true
|
||||||
- name: Static Build (AArch64)
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
use-cross: true
|
|
||||||
command: build
|
|
||||||
args: --all --release --target=aarch64-unknown-linux-musl
|
|
||||||
- name: Vendor
|
|
||||||
working-directory: ../cloud-hypervisor-${{ github.event.ref }}
|
|
||||||
run: |
|
|
||||||
mkdir ../vendor-cargo-home
|
|
||||||
export CARGO_HOME=$(realpath ../vendor-cargo-home)
|
|
||||||
mkdir .cargo
|
|
||||||
cargo vendor > .cargo/config.toml
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
|
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
env:
|
env:
|
||||||
@@ -66,20 +52,8 @@ jobs:
|
|||||||
release_name: ${{ github.ref }}
|
release_name: ${{ github.ref }}
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
- name: Create vendored source archive
|
|
||||||
working-directory: ../
|
|
||||||
run: tar cJf cloud-hypervisor-${{ github.event.ref }}.tar.xz cloud-hypervisor-${{ github.event.ref }}
|
|
||||||
- name: Upload cloud-hypervisor vendored source archive
|
|
||||||
id: upload-release-cloud-hypervisor-vendored-sources
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: ../cloud-hypervisor-${{ github.event.ref }}.tar.xz
|
|
||||||
asset_name: cloud-hypervisor-${{ github.event.ref }}.tar.xz
|
|
||||||
asset_content_type: application/x-xz
|
|
||||||
- name: Upload cloud-hypervisor
|
- name: Upload cloud-hypervisor
|
||||||
|
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||||
id: upload-release-cloud-hypervisor
|
id: upload-release-cloud-hypervisor
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
@@ -90,6 +64,7 @@ jobs:
|
|||||||
asset_name: cloud-hypervisor
|
asset_name: cloud-hypervisor
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
- name: Upload static cloud-hypervisor
|
- name: Upload static cloud-hypervisor
|
||||||
|
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||||
id: upload-release-static-cloud-hypervisor
|
id: upload-release-static-cloud-hypervisor
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
@@ -100,6 +75,7 @@ jobs:
|
|||||||
asset_name: cloud-hypervisor-static
|
asset_name: cloud-hypervisor-static
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
- name: Upload ch-remote
|
- name: Upload ch-remote
|
||||||
|
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||||
id: upload-release-ch-remote
|
id: upload-release-ch-remote
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
@@ -110,6 +86,7 @@ jobs:
|
|||||||
asset_name: ch-remote
|
asset_name: ch-remote
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
- name: Upload static-ch-remote
|
- name: Upload static-ch-remote
|
||||||
|
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||||
id: upload-release-static-ch-remote
|
id: upload-release-static-ch-remote
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
@@ -119,7 +96,18 @@ jobs:
|
|||||||
asset_path: target/x86_64-unknown-linux-musl/release/ch-remote
|
asset_path: target/x86_64-unknown-linux-musl/release/ch-remote
|
||||||
asset_name: ch-remote-static
|
asset_name: ch-remote-static
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
- name: Clean build tree ahead of cross build
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: clean
|
||||||
|
- name: Static Build (AArch64)
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
use-cross: true
|
||||||
|
command: build
|
||||||
|
args: --all --release --target=aarch64-unknown-linux-musl
|
||||||
- name: Upload static AArch64 cloud-hypervisor
|
- name: Upload static AArch64 cloud-hypervisor
|
||||||
|
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||||
id: upload-release-static-aarch64-cloud-hypervisor
|
id: upload-release-static-aarch64-cloud-hypervisor
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
@@ -130,6 +118,7 @@ jobs:
|
|||||||
asset_name: cloud-hypervisor-static-aarch64
|
asset_name: cloud-hypervisor-static-aarch64
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
- name: Upload static AArch64 ch-remote
|
- name: Upload static AArch64 ch-remote
|
||||||
|
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||||
id: upload-release-static-aarch64-ch-remote
|
id: upload-release-static-aarch64-ch-remote
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
@@ -139,3 +128,24 @@ jobs:
|
|||||||
asset_path: target/aarch64-unknown-linux-musl/release/ch-remote
|
asset_path: target/aarch64-unknown-linux-musl/release/ch-remote
|
||||||
asset_name: ch-remote-static-aarch64
|
asset_name: ch-remote-static-aarch64
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
- name: Vendor
|
||||||
|
working-directory: ../cloud-hypervisor-${{ github.event.ref }}
|
||||||
|
run: |
|
||||||
|
mkdir ../vendor-cargo-home
|
||||||
|
export CARGO_HOME=$(realpath ../vendor-cargo-home)
|
||||||
|
mkdir .cargo
|
||||||
|
cargo vendor > .cargo/config.toml
|
||||||
|
- name: Create vendored source archive
|
||||||
|
working-directory: ../
|
||||||
|
run: tar cJf cloud-hypervisor-${{ github.event.ref }}.tar.xz cloud-hypervisor-${{ github.event.ref }}
|
||||||
|
- name: Upload cloud-hypervisor vendored source archive
|
||||||
|
if: github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||||
|
id: upload-release-cloud-hypervisor-vendored-sources
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ../cloud-hypervisor-${{ github.event.ref }}.tar.xz
|
||||||
|
asset_name: cloud-hypervisor-${{ github.event.ref }}.tar.xz
|
||||||
|
asset_content_type: application/x-xz
|
||||||
|
|||||||
372
Cargo.lock
generated
372
Cargo.lock
generated
@@ -11,9 +11,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
version = "0.7.19"
|
version = "1.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e"
|
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
@@ -59,17 +59,6 @@ dependencies = [
|
|||||||
"vmm-sys-util",
|
"vmm-sys-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "atty"
|
|
||||||
version = "0.2.14"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
|
||||||
dependencies = [
|
|
||||||
"hermit-abi",
|
|
||||||
"libc",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
@@ -91,6 +80,12 @@ version = "1.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitflags"
|
||||||
|
version = "2.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block_util"
|
name = "block_util"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -118,9 +113,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.73"
|
version = "1.0.77"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
|
checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
@@ -130,13 +125,13 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.0.18"
|
version = "4.0.29"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b"
|
checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"bitflags 1.3.2",
|
||||||
"bitflags",
|
|
||||||
"clap_lex",
|
"clap_lex",
|
||||||
|
"is-terminal",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"strsim",
|
"strsim",
|
||||||
"termcolor",
|
"termcolor",
|
||||||
@@ -154,7 +149,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cloud-hypervisor"
|
name = "cloud-hypervisor"
|
||||||
version = "28.0.0"
|
version = "28.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"api_client",
|
"api_client",
|
||||||
@@ -217,7 +212,7 @@ dependencies = [
|
|||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"strsim",
|
"strsim",
|
||||||
"syn",
|
"syn 1.0.105",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -228,7 +223,7 @@ checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"darling_core",
|
"darling_core",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn 1.0.105",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -238,7 +233,7 @@ dependencies = [
|
|||||||
"acpi_tables",
|
"acpi_tables",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arch",
|
"arch",
|
||||||
"bitflags",
|
"bitflags 2.4.1",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"hypervisor",
|
"hypervisor",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -276,12 +271,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "env_logger"
|
name = "env_logger"
|
||||||
version = "0.9.3"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7"
|
checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
|
||||||
"humantime",
|
"humantime",
|
||||||
|
"is-terminal",
|
||||||
"log",
|
"log",
|
||||||
"regex",
|
"regex",
|
||||||
"termcolor",
|
"termcolor",
|
||||||
@@ -293,7 +288,7 @@ version = "4.3.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "20df693c700404f7e19d4d6fae6b15215d2913c27955d2b9d6f2c0f537511cd0"
|
checksum = "20df693c700404f7e19d4d6fae6b15215d2913c27955d2b9d6f2c0f537511cd0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -323,6 +318,7 @@ name = "event_monitor"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
|
"once_cell",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
@@ -345,7 +341,7 @@ version = "0.6.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "32c95766e0414f8bfc1d07055574c621b67739466d6ba516c4fef8e99d30d2e6"
|
checksum = "32c95766e0414f8bfc1d07055574c621b67739466d6ba516c4fef8e99d30d2e6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"log",
|
"log",
|
||||||
"managed",
|
"managed",
|
||||||
@@ -365,9 +361,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.2.7"
|
version = "0.2.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
|
checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -376,15 +372,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glob"
|
name = "glob"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
|
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "hermit-abi"
|
||||||
version = "0.1.20"
|
version = "0.2.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c7a30908dbce072eca83216eab939d2290080e00ca71611b96a09e5cdce5f3fa"
|
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
@@ -444,29 +440,45 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "io-lifetimes"
|
name = "io-lifetimes"
|
||||||
version = "0.7.4"
|
version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e6e481ccbe3dea62107216d0d1138bb8ad8e5e5c43009a098bd1990272c497b0"
|
checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "io-uring"
|
name = "io-uring"
|
||||||
version = "0.5.8"
|
version = "0.5.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "00d78c9f2db2a9800dfd15c69543896dae2135112dde0d1944442e83da8ce23a"
|
checksum = "7ba34abb5175052fc1a2227a10d2275b7386c9990167de9786c0b88d8b062330"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ipnetwork"
|
name = "ipnetwork"
|
||||||
version = "0.19.0"
|
version = "0.20.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1f84f1612606f3753f205a4e9a2efd6fe5b4c573a6269b2cc6c3003d44a0d127"
|
checksum = "bf466541e9d546596ee94f9f69590f89473455f88372423e0008fc1a7daf100e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "is-terminal"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi",
|
||||||
|
"io-lifetimes",
|
||||||
|
"rustix",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
@@ -475,8 +487,8 @@ checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kvm-bindings"
|
name = "kvm-bindings"
|
||||||
version = "0.5.0"
|
version = "0.6.0"
|
||||||
source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.5.0-tdx#52e56d0e8ef0f6ea32fc0492e6a175b73617a49f"
|
source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.6.0-tdx#7d9ffb47e5b9b1989577258800a0f57c93f1445f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
@@ -485,8 +497,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kvm-ioctls"
|
name = "kvm-ioctls"
|
||||||
version = "0.11.0"
|
version = "0.13.0"
|
||||||
source = "git+https://github.com/rust-vmm/kvm-ioctls?branch=main#e6739aeebcc56dfea62216b2cc4cddd13d0a1182"
|
source = "git+https://github.com/rust-vmm/kvm-ioctls?branch=main#23a3bb045a467e60bb00328a0b13cea13b5815d0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kvm-bindings",
|
"kvm-bindings",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -501,9 +513,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.137"
|
version = "0.2.152"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"
|
checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libssh2-sys"
|
name = "libssh2-sys"
|
||||||
@@ -533,18 +545,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-loader"
|
name = "linux-loader"
|
||||||
version = "0.7.0"
|
version = "0.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f8242360c7d79a7713a28043c994b815e9820b0e97e44b228ec9bd913c16bdfe"
|
checksum = "b9259ddbfbb52cc918f6bbc60390004ddd0228cf1d85f402009ff2b3d95de83f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"vm-memory",
|
"vm-memory",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-raw-sys"
|
name = "linux-raw-sys"
|
||||||
version = "0.0.46"
|
version = "0.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d"
|
checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lock_api"
|
name = "lock_api"
|
||||||
@@ -573,14 +585,14 @@ checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.5.0"
|
version = "2.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "micro_http"
|
name = "micro_http"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/firecracker-microvm/micro-http?branch=main#863b0370ba7e57f7df5b908ada9e5b44809ccae9"
|
source = "git+https://github.com/firecracker-microvm/micro-http?branch=main#4b18a043e997da5b5f679e3defc279fec908753e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"vmm-sys-util",
|
"vmm-sys-util",
|
||||||
@@ -589,7 +601,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "mshv-bindings"
|
name = "mshv-bindings"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
source = "git+https://github.com/rust-vmm/mshv?branch=main#1a9ca01801e78f8ddc2630660cbab3bc3300e39e"
|
source = "git+https://github.com/rust-vmm/mshv?branch=main#10d0c5208cc41a3958e0fd31fabf2c88b18a97b5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -601,7 +613,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "mshv-ioctls"
|
name = "mshv-ioctls"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
source = "git+https://github.com/rust-vmm/mshv?branch=main#1a9ca01801e78f8ddc2630660cbab3bc3300e39e"
|
source = "git+https://github.com/rust-vmm/mshv?branch=main#10d0c5208cc41a3958e0fd31fabf2c88b18a97b5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"mshv-bindings",
|
"mshv-bindings",
|
||||||
@@ -672,9 +684,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openssl-sys"
|
name = "openssl-sys"
|
||||||
version = "0.9.77"
|
version = "0.9.79"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a"
|
checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"cc",
|
"cc",
|
||||||
@@ -690,9 +702,9 @@ version = "0.1.0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "os_str_bytes"
|
name = "os_str_bytes"
|
||||||
version = "6.3.0"
|
version = "6.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff"
|
checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot"
|
name = "parking_lot"
|
||||||
@@ -707,9 +719,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot_core"
|
name = "parking_lot_core"
|
||||||
version = "0.8.5"
|
version = "0.8.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
|
checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"instant",
|
"instant",
|
||||||
@@ -721,9 +733,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "paste"
|
name = "paste"
|
||||||
version = "1.0.9"
|
version = "1.0.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1"
|
checksum = "cf1c2c742266c2f1041c914ba65355a83ae8747b05f208319784083583494b4b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pci"
|
name = "pci"
|
||||||
@@ -791,7 +803,7 @@ dependencies = [
|
|||||||
"phf_shared",
|
"phf_shared",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn 1.0.105",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -811,30 +823,32 @@ checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pnet"
|
name = "pnet"
|
||||||
version = "0.31.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0caaf5b11fd907ff15cf14a4477bfabca4b37ab9e447a4f8dead969a59cdafad"
|
checksum = "130c5b738eeda2dc5796fe2671e49027e6935e817ab51b930a36ec9e6a206a64"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"ipnetwork",
|
||||||
"pnet_base",
|
"pnet_base",
|
||||||
"pnet_datalink",
|
"pnet_datalink",
|
||||||
"pnet_packet",
|
"pnet_packet",
|
||||||
|
"pnet_sys",
|
||||||
"pnet_transport",
|
"pnet_transport",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pnet_base"
|
name = "pnet_base"
|
||||||
version = "0.31.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f9d3a993d49e5fd5d4d854d6999d4addca1f72d86c65adf224a36757161c02b6"
|
checksum = "fe4cf6fb3ab38b68d01ab2aea03ed3d1132b4868fa4e06285f29f16da01c5f4c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"no-std-net",
|
"no-std-net",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pnet_datalink"
|
name = "pnet_datalink"
|
||||||
version = "0.31.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e466faf03a98ad27f6e15cd27a2b7cc89e73e640a43527742977bc503c37f8aa"
|
checksum = "ad5854abf0067ebbd3967f7d45ebc8976ff577ff0c7bd101c4973ae3c70f98fe"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ipnetwork",
|
"ipnetwork",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -845,30 +859,30 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pnet_macros"
|
name = "pnet_macros"
|
||||||
version = "0.31.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "48dd52a5211fac27e7acb14cfc9f30ae16ae0e956b7b779c8214c74559cef4c3"
|
checksum = "688b17499eee04a0408aca0aa5cba5fc86401d7216de8a63fdf7a4c227871804"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"regex",
|
"regex",
|
||||||
"syn",
|
"syn 2.0.48",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pnet_macros_support"
|
name = "pnet_macros_support"
|
||||||
version = "0.31.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "89de095dc7739349559913aed1ef6a11e73ceade4897dadc77c5e09de6740750"
|
checksum = "eea925b72f4bd37f8eab0f221bbe4c78b63498350c983ffa9dd4bcde7e030f56"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pnet_base",
|
"pnet_base",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pnet_packet"
|
name = "pnet_packet"
|
||||||
version = "0.31.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bc3b5111e697c39c8b9795b9fdccbc301ab696699e88b9ea5a4e4628978f495f"
|
checksum = "a9a005825396b7fe7a38a8e288dbc342d5034dac80c15212436424fef8ea90ba"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glob",
|
"glob",
|
||||||
"pnet_base",
|
"pnet_base",
|
||||||
@@ -878,9 +892,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pnet_sys"
|
name = "pnet_sys"
|
||||||
version = "0.31.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "328e231f0add6d247d82421bf3790b4b33b39c8930637f428eef24c4c6a90805"
|
checksum = "417c0becd1b573f6d544f73671070b039051e5ad819cc64aa96377b536128d00"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"winapi",
|
"winapi",
|
||||||
@@ -888,9 +902,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pnet_transport"
|
name = "pnet_transport"
|
||||||
version = "0.31.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ff597185e6f1f5671b3122e4dba892a1c73e17c17e723d7669bd9299cbe7f124"
|
checksum = "2637e14d7de974ee2f74393afccbc8704f3e54e6eb31488715e72481d1662cc3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"pnet_base",
|
"pnet_base",
|
||||||
@@ -900,9 +914,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.47"
|
version = "1.0.76"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
|
checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
@@ -920,9 +934,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.21"
|
version = "1.0.35"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
|
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
@@ -957,7 +971,7 @@ version = "0.2.16"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
|
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -973,9 +987,21 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.6.0"
|
version = "1.10.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b"
|
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick",
|
||||||
|
"memchr",
|
||||||
|
"regex-automata",
|
||||||
|
"regex-syntax",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-automata"
|
||||||
|
version = "0.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -984,9 +1010,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.6.27"
|
version = "0.8.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
|
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "remain"
|
name = "remain"
|
||||||
@@ -996,7 +1022,7 @@ checksum = "1a81bc6a3aaeb180f767bd2bda8c03bac5b93b3b69a783c66f35d16a4df276cf"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn 1.0.105",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1010,16 +1036,16 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "0.35.12"
|
version = "0.36.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "985947f9b6423159c4726323f373be0a21bdb514c5af06a849cb3d2dce2d01e8"
|
checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"errno",
|
"errno",
|
||||||
"io-lifetimes",
|
"io-lifetimes",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys",
|
"linux-raw-sys",
|
||||||
"windows-sys 0.36.1",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1051,29 +1077,29 @@ checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.147"
|
version = "1.0.150"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
|
checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.147"
|
version = "1.0.150"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
|
checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn 1.0.105",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.87"
|
version = "1.0.89"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45"
|
checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
@@ -1082,9 +1108,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_with"
|
name = "serde_with"
|
||||||
version = "2.0.1"
|
version = "2.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "368f2d60d049ea019a84dcd6687b0d1e0030fe663ae105039bdf967ed5e6a9a7"
|
checksum = "25bf4a5a814902cd1014dbccfa4d4560fb8432c779471e96e035602519f82eef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_with_macros",
|
"serde_with_macros",
|
||||||
@@ -1092,14 +1118,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_with_macros"
|
name = "serde_with_macros"
|
||||||
version = "2.0.1"
|
version = "2.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1ccadfacf6cf10faad22bbadf55986bdd0856edfb5d9210aa1dcf1f516e84e93"
|
checksum = "e3452b4c0f6c1e357f73fdb87cd1efabaa12acf328c7a528e252893baeb3f4aa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn 1.0.105",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1143,7 +1169,7 @@ version = "0.9.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "269343e64430067a14937ae0e3c4ec604c178fb896dde0964b1acd22b3e2eeb1"
|
checksum = "269343e64430067a14937ae0e3c4ec604c178fb896dde0964b1acd22b3e2eeb1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"libc",
|
"libc",
|
||||||
"libssh2-sys",
|
"libssh2-sys",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
@@ -1163,9 +1189,20 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.103"
|
version = "1.0.105"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d"
|
checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "2.0.48"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -1183,12 +1220,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "terminal_size"
|
name = "terminal_size"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "40ca90c434fd12083d1a6bdcbe9f92a14f96c8a1ba600ba451734ac334521f7a"
|
checksum = "cb20089a8ba2b69debd491f8d2d023761cbf196e999218c591fa1e7e15a21907"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustix",
|
"rustix",
|
||||||
"windows-sys 0.42.0",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1223,7 +1260,7 @@ checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn 1.0.105",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1257,9 +1294,9 @@ checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "1.2.1"
|
version = "1.2.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83"
|
checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom",
|
"getrandom",
|
||||||
]
|
]
|
||||||
@@ -1272,9 +1309,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "versionize"
|
name = "versionize"
|
||||||
version = "0.1.6"
|
version = "0.1.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7429cf68de8f091b667d27323ed323afd39584a56d533995b12ddd748e5e6ca9"
|
checksum = "d6e2495726cf917e7ba7ec8bf0f0fceab543dd38d0a4195ed6bef331e38a290f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"crc64",
|
"crc64",
|
||||||
@@ -1282,7 +1319,7 @@ dependencies = [
|
|||||||
"quote",
|
"quote",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"syn",
|
"syn 1.0.105",
|
||||||
"versionize_derive",
|
"versionize_derive",
|
||||||
"vmm-sys-util",
|
"vmm-sys-util",
|
||||||
]
|
]
|
||||||
@@ -1294,22 +1331,21 @@ source = "git+https://github.com/cloud-hypervisor/versionize_derive?branch=ch#ae
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn 1.0.105",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vfio-bindings"
|
name = "vfio-bindings"
|
||||||
version = "0.3.1"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/rust-vmm/vfio?branch=main#43439e056ddfa84a4f7906ee7f2f58be70505c08"
|
||||||
checksum = "43449b404c488f70507dca193debd4bea361fe8089869b947adc19720e464bce"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"vmm-sys-util",
|
"vmm-sys-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vfio-ioctls"
|
name = "vfio-ioctls"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
source = "git+https://github.com/rust-vmm/vfio?branch=main#ad86d843a22fbf98efa9c02a5689fe2bf17ed54a"
|
source = "git+https://github.com/rust-vmm/vfio?branch=main#43439e056ddfa84a4f7906ee7f2f58be70505c08"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"kvm-bindings",
|
"kvm-bindings",
|
||||||
@@ -1354,10 +1390,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vhost"
|
name = "vhost"
|
||||||
version = "0.5.0"
|
version = "0.6.0"
|
||||||
source = "git+https://github.com/rust-vmm/vhost?branch=main#f87156b77662af63b9fc9f116a213dd69e16007b"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c9b791c5b0717a0558888a4cf7240cea836f39a99cb342e12ce633dcaa078072"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"libc",
|
"libc",
|
||||||
"vm-memory",
|
"vm-memory",
|
||||||
"vmm-sys-util",
|
"vmm-sys-util",
|
||||||
@@ -1365,9 +1402,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vhost-user-backend"
|
name = "vhost-user-backend"
|
||||||
version = "0.7.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6a0fc7d5f8e2943cd9f2ecd58be3f2078add863a49573d14dd9d64e1ab26544c"
|
checksum = "9f237b91db4ac339d639fb43398b52d785fa51e3c7760ac9425148863c1f4303"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
@@ -1459,9 +1496,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "virtio-queue"
|
name = "virtio-queue"
|
||||||
version = "0.6.1"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "435dd49c7b38419729afd43675850c7b5dc4728f2fabd70c7a9079a331e4f8c6"
|
checksum = "19e927d93d54c365034fd7f31a5f458a1f540de4a37c52e892670dad9692173c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"virtio-bindings",
|
"virtio-bindings",
|
||||||
@@ -1494,13 +1531,13 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "vm-fdt"
|
name = "vm-fdt"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
source = "git+https://github.com/rust-vmm/vm-fdt?branch=main#d9425907389e1fbbfb803017d01824a4bb16e6a8"
|
source = "git+https://github.com/rust-vmm/vm-fdt?branch=main#c5a99ab71b130435927d19b50c85fcd5ce904a8c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vm-memory"
|
name = "vm-memory"
|
||||||
version = "0.9.0"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "583f213899e8a5eea23d9c507252d4bed5bc88f0ecbe0783262f80034630744b"
|
checksum = "688a70366615b45575a424d9c665561c1b5ab2224d494f706b6a6812911a827c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -1537,7 +1574,7 @@ dependencies = [
|
|||||||
"anyhow",
|
"anyhow",
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"arch",
|
"arch",
|
||||||
"bitflags",
|
"bitflags 2.4.1",
|
||||||
"block_util",
|
"block_util",
|
||||||
"clap",
|
"clap",
|
||||||
"devices",
|
"devices",
|
||||||
@@ -1580,11 +1617,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vmm-sys-util"
|
name = "vmm-sys-util"
|
||||||
version = "0.10.0"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "08604d7be03eb26e33b3cee3ed4aef2bf550b305d1cca60e84da5d28d3790b62"
|
checksum = "cc06a16ee8ebf0d9269aed304030b0d20a866b8b3dd3d4ce532596ac567a0d24"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"libc",
|
"libc",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
@@ -1636,19 +1673,6 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows-sys"
|
|
||||||
version = "0.36.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
|
|
||||||
dependencies = [
|
|
||||||
"windows_aarch64_msvc 0.36.1",
|
|
||||||
"windows_i686_gnu 0.36.1",
|
|
||||||
"windows_i686_msvc 0.36.1",
|
|
||||||
"windows_x86_64_gnu 0.36.1",
|
|
||||||
"windows_x86_64_msvc 0.36.1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-sys"
|
name = "windows-sys"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
@@ -1656,12 +1680,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
|
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows_aarch64_gnullvm",
|
"windows_aarch64_gnullvm",
|
||||||
"windows_aarch64_msvc 0.42.0",
|
"windows_aarch64_msvc",
|
||||||
"windows_i686_gnu 0.42.0",
|
"windows_i686_gnu",
|
||||||
"windows_i686_msvc 0.42.0",
|
"windows_i686_msvc",
|
||||||
"windows_x86_64_gnu 0.42.0",
|
"windows_x86_64_gnu",
|
||||||
"windows_x86_64_gnullvm",
|
"windows_x86_64_gnullvm",
|
||||||
"windows_x86_64_msvc 0.42.0",
|
"windows_x86_64_msvc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1670,48 +1694,24 @@ version = "0.42.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
|
checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_aarch64_msvc"
|
|
||||||
version = "0.36.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
|
checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_gnu"
|
|
||||||
version = "0.36.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
|
checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_msvc"
|
|
||||||
version = "0.36.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
|
checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_gnu"
|
|
||||||
version = "0.36.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
@@ -1724,12 +1724,6 @@ version = "0.42.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
|
checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_msvc"
|
|
||||||
version = "0.36.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
@@ -1754,5 +1748,5 @@ checksum = "6505e6815af7de1746a08f69c69606bb45695a17149517680f3b2149713b19a3"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn 1.0.105",
|
||||||
]
|
]
|
||||||
|
|||||||
27
Cargo.toml
27
Cargo.toml
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cloud-hypervisor"
|
name = "cloud-hypervisor"
|
||||||
version = "28.0.0"
|
version = "28.4.0"
|
||||||
authors = ["The Cloud Hypervisor Authors"]
|
authors = ["The Cloud Hypervisor Authors"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
default-run = "cloud-hypervisor"
|
default-run = "cloud-hypervisor"
|
||||||
@@ -10,48 +10,53 @@ description = "Open source Virtual Machine Monitor (VMM) that runs on top of KVM
|
|||||||
homepage = "https://github.com/cloud-hypervisor/cloud-hypervisor"
|
homepage = "https://github.com/cloud-hypervisor/cloud-hypervisor"
|
||||||
# Minimum buildable version:
|
# Minimum buildable version:
|
||||||
# Keep in sync with version in .github/workflows/build.yaml
|
# Keep in sync with version in .github/workflows/build.yaml
|
||||||
rust-version = "1.60"
|
# Policy on MSRV (see #4318):
|
||||||
|
# Can only be bumped by:
|
||||||
|
# a.) A dependency requires it,
|
||||||
|
# b.) If we want to use a new feature and that MSRV is at least 6 months old,
|
||||||
|
# c.) There is a security issue that is addressed by the toolchain update.
|
||||||
|
rust-version = "1.65"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
|
strip = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.66"
|
anyhow = "1.0.66"
|
||||||
api_client = { path = "api_client" }
|
api_client = { path = "api_client" }
|
||||||
clap = { version = "4.0.18", features = ["wrap_help","cargo","string"] }
|
clap = { version = "4.0.29", features = ["wrap_help","cargo","string"] }
|
||||||
epoll = "4.3.1"
|
epoll = "4.3.1"
|
||||||
event_monitor = { path = "event_monitor" }
|
event_monitor = { path = "event_monitor" }
|
||||||
hypervisor = { path = "hypervisor" }
|
hypervisor = { path = "hypervisor" }
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = { version = "0.4.17", features = ["std"] }
|
log = { version = "0.4.17", features = ["std"] }
|
||||||
option_parser = { path = "option_parser" }
|
option_parser = { path = "option_parser" }
|
||||||
seccompiler = "0.3.0"
|
seccompiler = "0.3.0"
|
||||||
serde_json = "1.0.87"
|
serde_json = "1.0.89"
|
||||||
signal-hook = "0.3.14"
|
signal-hook = "0.3.14"
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
tpm = { path = "tpm"}
|
tpm = { path = "tpm"}
|
||||||
tracer = { path = "tracer" }
|
tracer = { path = "tracer" }
|
||||||
vmm = { path = "vmm" }
|
vmm = { path = "vmm" }
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
vm-memory = "0.9.0"
|
vm-memory = "0.10.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
clap = { version = "4.0.18", features = ["cargo"] }
|
clap = { version = "4.0.29", features = ["cargo"] }
|
||||||
|
|
||||||
# List of patched crates
|
# List of patched crates
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.5.0-tdx" }
|
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.6.0-tdx" }
|
||||||
kvm-ioctls = { git = "https://github.com/rust-vmm/kvm-ioctls", branch = "main" }
|
kvm-ioctls = { git = "https://github.com/rust-vmm/kvm-ioctls", branch = "main" }
|
||||||
versionize_derive = { git = "https://github.com/cloud-hypervisor/versionize_derive", branch = "ch" }
|
versionize_derive = { git = "https://github.com/cloud-hypervisor/versionize_derive", branch = "ch" }
|
||||||
vhost = { git = "https://github.com/rust-vmm/vhost", branch = "main" }
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
net_util = { path = "net_util" }
|
net_util = { path = "net_util" }
|
||||||
once_cell = "1.16.0"
|
once_cell = "1.16.0"
|
||||||
serde_json = "1.0.87"
|
serde_json = "1.0.89"
|
||||||
test_infra = { path = "test_infra" }
|
test_infra = { path = "test_infra" }
|
||||||
wait-timeout = "0.2.0"
|
wait-timeout = "0.2.0"
|
||||||
|
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ $ ./cloud-hypervisor \
|
|||||||
|
|
||||||
If earlier kernel messages are required the serial console should be used instead of `virtio-console`.
|
If earlier kernel messages are required the serial console should be used instead of `virtio-console`.
|
||||||
|
|
||||||
```cloud-hypervisor \
|
```./cloud-hypervisor \
|
||||||
--kernel ./linux-cloud-hypervisor/arch/x86/boot/compressed/vmlinux.bin \
|
--kernel ./linux-cloud-hypervisor/arch/x86/boot/compressed/vmlinux.bin \
|
||||||
--console off \
|
--console off \
|
||||||
--serial tty \
|
--serial tty \
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ authors = ["The Cloud Hypervisor Authors"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
vm-memory = "0.9.0"
|
vm-memory = "0.10.0"
|
||||||
|
|||||||
@@ -1083,7 +1083,7 @@ impl<'a, T> CreateField<'a, T> {
|
|||||||
buffer,
|
buffer,
|
||||||
offset,
|
offset,
|
||||||
field,
|
field,
|
||||||
phantom: PhantomData::default(),
|
phantom: PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ authors = ["The Cloud Hypervisor Authors"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|||||||
@@ -22,16 +22,16 @@ impl fmt::Display for Error {
|
|||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
use Error::*;
|
use Error::*;
|
||||||
match self {
|
match self {
|
||||||
Socket(e) => write!(f, "Error writing to or reading from HTTP socket: {}", e),
|
Socket(e) => write!(f, "Error writing to or reading from HTTP socket: {e}"),
|
||||||
SocketSendFds(e) => write!(f, "Error writing to or reading from HTTP socket: {}", e),
|
SocketSendFds(e) => write!(f, "Error writing to or reading from HTTP socket: {e}"),
|
||||||
StatusCodeParsing(e) => write!(f, "Error parsing HTTP status code: {}", e),
|
StatusCodeParsing(e) => write!(f, "Error parsing HTTP status code: {e}"),
|
||||||
MissingProtocol => write!(f, "HTTP output is missing protocol statement"),
|
MissingProtocol => write!(f, "HTTP output is missing protocol statement"),
|
||||||
ContentLengthParsing(e) => write!(f, "Error parsing HTTP Content-Length field: {}", e),
|
ContentLengthParsing(e) => write!(f, "Error parsing HTTP Content-Length field: {e}"),
|
||||||
ServerResponse(s, o) => {
|
ServerResponse(s, o) => {
|
||||||
if let Some(o) = o {
|
if let Some(o) = o {
|
||||||
write!(f, "Server responded with an error: {:?}: {}", s, o)
|
write!(f, "Server responded with an error: {s:?}: {o}")
|
||||||
} else {
|
} else {
|
||||||
write!(f, "Server responded with an error: {:?}", s)
|
write!(f, "Server responded with an error: {s:?}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ impl StatusCode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_header<'a>(res: &'a str, header: &'a str) -> Option<&'a str> {
|
fn get_header<'a>(res: &'a str, header: &'a str) -> Option<&'a str> {
|
||||||
let header_str = format!("{}: ", header);
|
let header_str = format!("{header}: ");
|
||||||
res.find(&header_str)
|
res.find(&header_str)
|
||||||
.map(|o| &res[o + header_str.len()..o + res[o..].find('\r').unwrap()])
|
.map(|o| &res[o + header_str.len()..o + res[o..].find('\r').unwrap()])
|
||||||
}
|
}
|
||||||
@@ -153,8 +153,7 @@ pub fn simple_api_full_command_with_fds_and_response<T: Read + Write + ScmSocket
|
|||||||
socket
|
socket
|
||||||
.send_with_fds(
|
.send_with_fds(
|
||||||
&[format!(
|
&[format!(
|
||||||
"{} /api/v1/{} HTTP/1.1\r\nHost: localhost\r\nAccept: */*\r\n",
|
"{method} /api/v1/{full_command} HTTP/1.1\r\nHost: localhost\r\nAccept: */*\r\n"
|
||||||
method, full_command
|
|
||||||
)
|
)
|
||||||
.as_bytes()],
|
.as_bytes()],
|
||||||
&request_fds,
|
&request_fds,
|
||||||
@@ -235,7 +234,7 @@ pub fn simple_api_command_with_fds<T: Read + Write + ScmSocket>(
|
|||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
// Create the full VM command. For VMM commands, use
|
// Create the full VM command. For VMM commands, use
|
||||||
// simple_api_full_command().
|
// simple_api_full_command().
|
||||||
let full_command = format!("vm.{}", c);
|
let full_command = format!("vm.{c}");
|
||||||
|
|
||||||
simple_api_full_command_with_fds(socket, method, &full_command, request_body, request_fds)
|
simple_api_full_command_with_fds(socket, method, &full_command, request_body, request_fds)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,17 +12,17 @@ tdx = []
|
|||||||
anyhow = "1.0.66"
|
anyhow = "1.0.66"
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
hypervisor = { path = "../hypervisor" }
|
hypervisor = { path = "../hypervisor" }
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
linux-loader = { version = "0.7.0", features = ["elf", "bzimage", "pe"] }
|
linux-loader = { version = "0.8.1", features = ["elf", "bzimage", "pe"] }
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
serde = { version = "1.0.147", features = ["rc", "derive"] }
|
serde = { version = "1.0.150", features = ["rc", "derive"] }
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
uuid = "1.2.1"
|
uuid = "1.2.2"
|
||||||
versionize = "0.1.6"
|
versionize = "0.1.9"
|
||||||
versionize_derive = "0.1.4"
|
versionize_derive = "0.1.4"
|
||||||
vm-memory = { version = "0.9.0", features = ["backend-mmap", "backend-bitmap"] }
|
vm-memory = { version = "0.10.0", features = ["backend-mmap", "backend-bitmap"] }
|
||||||
vm-migration = { path = "../vm-migration" }
|
vm-migration = { path = "../vm-migration" }
|
||||||
vmm-sys-util = { version = "0.10.0", features = ["with-serde"] }
|
vmm-sys-util = { version = "0.11.0", features = ["with-serde"] }
|
||||||
|
|
||||||
[target.'cfg(target_arch = "aarch64")'.dependencies]
|
[target.'cfg(target_arch = "aarch64")'.dependencies]
|
||||||
fdt_parser = { version = "0.1.4", package = "fdt" }
|
fdt_parser = { version = "0.1.4", package = "fdt" }
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ fn create_cpu_nodes(
|
|||||||
let num_cpus = vcpu_mpidr.len();
|
let num_cpus = vcpu_mpidr.len();
|
||||||
|
|
||||||
for (cpu_id, mpidr) in vcpu_mpidr.iter().enumerate().take(num_cpus) {
|
for (cpu_id, mpidr) in vcpu_mpidr.iter().enumerate().take(num_cpus) {
|
||||||
let cpu_name = format!("cpu@{:x}", cpu_id);
|
let cpu_name = format!("cpu@{cpu_id:x}");
|
||||||
let cpu_node = fdt.begin_node(&cpu_name)?;
|
let cpu_node = fdt.begin_node(&cpu_name)?;
|
||||||
fdt.property_string("device_type", "cpu")?;
|
fdt.property_string("device_type", "cpu")?;
|
||||||
fdt.property_string("compatible", "arm,arm-v8")?;
|
fdt.property_string("compatible", "arm,arm-v8")?;
|
||||||
@@ -192,15 +192,15 @@ fn create_cpu_nodes(
|
|||||||
|
|
||||||
// Create device tree nodes with regard of above mapping.
|
// Create device tree nodes with regard of above mapping.
|
||||||
for cluster_idx in 0..packages {
|
for cluster_idx in 0..packages {
|
||||||
let cluster_name = format!("cluster{:x}", cluster_idx);
|
let cluster_name = format!("cluster{cluster_idx:x}");
|
||||||
let cluster_node = fdt.begin_node(&cluster_name)?;
|
let cluster_node = fdt.begin_node(&cluster_name)?;
|
||||||
|
|
||||||
for core_idx in 0..cores_per_package {
|
for core_idx in 0..cores_per_package {
|
||||||
let core_name = format!("core{:x}", core_idx);
|
let core_name = format!("core{core_idx:x}");
|
||||||
let core_node = fdt.begin_node(&core_name)?;
|
let core_node = fdt.begin_node(&core_name)?;
|
||||||
|
|
||||||
for thread_idx in 0..threads_per_core {
|
for thread_idx in 0..threads_per_core {
|
||||||
let thread_name = format!("thread{:x}", thread_idx);
|
let thread_name = format!("thread{thread_idx:x}");
|
||||||
let thread_node = fdt.begin_node(&thread_name)?;
|
let thread_node = fdt.begin_node(&thread_name)?;
|
||||||
let cpu_idx = threads_per_core * cores_per_package * cluster_idx
|
let cpu_idx = threads_per_core * cores_per_package * cluster_idx
|
||||||
+ threads_per_core * core_idx
|
+ threads_per_core * core_idx
|
||||||
@@ -247,7 +247,7 @@ fn create_memory_node(
|
|||||||
node_memory_addr = memory_region_start_addr;
|
node_memory_addr = memory_region_start_addr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let memory_node_name = format!("memory@{:x}", node_memory_addr);
|
let memory_node_name = format!("memory@{node_memory_addr:x}");
|
||||||
let memory_node = fdt.begin_node(&memory_node_name)?;
|
let memory_node = fdt.begin_node(&memory_node_name)?;
|
||||||
fdt.property_string("device_type", "memory")?;
|
fdt.property_string("device_type", "memory")?;
|
||||||
fdt.property_array_u64("reg", &mem_reg_prop)?;
|
fdt.property_array_u64("reg", &mem_reg_prop)?;
|
||||||
@@ -670,7 +670,7 @@ fn create_pci_nodes(
|
|||||||
|
|
||||||
// See kernel document Documentation/devicetree/bindings/virtio/iommu.txt
|
// See kernel document Documentation/devicetree/bindings/virtio/iommu.txt
|
||||||
// for virtio-iommu node settings.
|
// for virtio-iommu node settings.
|
||||||
let virtio_iommu_node_name = format!("virtio_iommu@{:x}", virtio_iommu_bdf);
|
let virtio_iommu_node_name = format!("virtio_iommu@{virtio_iommu_bdf:x}");
|
||||||
let virtio_iommu_node = fdt.begin_node(&virtio_iommu_node_name)?;
|
let virtio_iommu_node = fdt.begin_node(&virtio_iommu_node_name)?;
|
||||||
fdt.property_u32("#iommu-cells", 1)?;
|
fdt.property_u32("#iommu-cells", 1)?;
|
||||||
fdt.property_string("compatible", "virtio,pci-iommu")?;
|
fdt.property_string("compatible", "virtio,pci-iommu")?;
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ where
|
|||||||
if uefi_size > 0x300000 {
|
if uefi_size > 0x300000 {
|
||||||
return Err(Error::UefiTooBig);
|
return Err(Error::UefiTooBig);
|
||||||
}
|
}
|
||||||
uefi_image
|
uefi_image.rewind().map_err(|_| Error::SeekUefiStart)?;
|
||||||
.seek(SeekFrom::Start(0))
|
|
||||||
.map_err(|_| Error::SeekUefiStart)?;
|
|
||||||
guest_mem
|
guest_mem
|
||||||
.read_exact_from(guest_addr, uefi_image, uefi_size)
|
.read_exact_from(guest_addr, uefi_image, uefi_size)
|
||||||
.map_err(|_| Error::ReadUefiImage)
|
.map_err(|_| Error::ReadUefiImage)
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ pub const PAGE_SIZE: usize = 4096;
|
|||||||
|
|
||||||
impl fmt::Display for DeviceType {
|
impl fmt::Display for DeviceType {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "{:?}", self)
|
write!(f, "{self:?}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ use crate::GuestMemoryMmap;
|
|||||||
use crate::InitramfsConfig;
|
use crate::InitramfsConfig;
|
||||||
use crate::RegionType;
|
use crate::RegionType;
|
||||||
use hypervisor::arch::x86::{CpuIdEntry, CPUID_FLAG_VALID_INDEX};
|
use hypervisor::arch::x86::{CpuIdEntry, CPUID_FLAG_VALID_INDEX};
|
||||||
use hypervisor::HypervisorError;
|
use hypervisor::{HypervisorCpuError, HypervisorError};
|
||||||
use linux_loader::loader::bootparam::boot_params;
|
use linux_loader::loader::bootparam::boot_params;
|
||||||
use linux_loader::loader::elf::start_info::{
|
use linux_loader::loader::elf::start_info::{
|
||||||
hvm_memmap_table_entry, hvm_modlist_entry, hvm_start_info,
|
hvm_memmap_table_entry, hvm_modlist_entry, hvm_start_info,
|
||||||
@@ -36,6 +36,7 @@ pub mod tdx;
|
|||||||
const TSC_DEADLINE_TIMER_ECX_BIT: u8 = 24; // tsc deadline timer ecx bit.
|
const TSC_DEADLINE_TIMER_ECX_BIT: u8 = 24; // tsc deadline timer ecx bit.
|
||||||
const HYPERVISOR_ECX_BIT: u8 = 31; // Hypervisor ecx bit.
|
const HYPERVISOR_ECX_BIT: u8 = 31; // Hypervisor ecx bit.
|
||||||
const MTRR_EDX_BIT: u8 = 12; // Hypervisor ecx bit.
|
const MTRR_EDX_BIT: u8 = 12; // Hypervisor ecx bit.
|
||||||
|
const INVARIANT_TSC_EDX_BIT: u8 = 8; // Invariant TSC bit on 0x8000_0007 EDX
|
||||||
|
|
||||||
// KVM feature bits
|
// KVM feature bits
|
||||||
const KVM_FEATURE_ASYNC_PF_INT_BIT: u8 = 14;
|
const KVM_FEATURE_ASYNC_PF_INT_BIT: u8 = 14;
|
||||||
@@ -191,6 +192,9 @@ pub enum Error {
|
|||||||
// Error writing EBDA address
|
// Error writing EBDA address
|
||||||
EbdaSetup(vm_memory::GuestMemoryError),
|
EbdaSetup(vm_memory::GuestMemoryError),
|
||||||
|
|
||||||
|
// Error getting CPU TSC frequency
|
||||||
|
GetTscFrequency(HypervisorCpuError),
|
||||||
|
|
||||||
/// Error retrieving TDX capabilities through the hypervisor (kvm/mshv) API
|
/// Error retrieving TDX capabilities through the hypervisor (kvm/mshv) API
|
||||||
#[cfg(feature = "tdx")]
|
#[cfg(feature = "tdx")]
|
||||||
TdxCapabilities(HypervisorError),
|
TdxCapabilities(HypervisorError),
|
||||||
@@ -631,6 +635,20 @@ pub fn generate_common_cpuid(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Copy host L2 cache details if not populated by KVM
|
||||||
|
0x8000_0006 => {
|
||||||
|
if entry.eax == 0 && entry.ebx == 0 && entry.ecx == 0 && entry.edx == 0 {
|
||||||
|
// SAFETY: cpuid called with valid leaves
|
||||||
|
if unsafe { std::arch::x86_64::__cpuid(0x8000_0000).eax } >= 0x8000_0006 {
|
||||||
|
// SAFETY: cpuid called with valid leaves
|
||||||
|
let leaf = unsafe { std::arch::x86_64::__cpuid(0x8000_0006) };
|
||||||
|
entry.eax = leaf.eax;
|
||||||
|
entry.ebx = leaf.ebx;
|
||||||
|
entry.ecx = leaf.ecx;
|
||||||
|
entry.edx = leaf.edx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Set CPU physical bits
|
// Set CPU physical bits
|
||||||
0x8000_0008 => {
|
0x8000_0008 => {
|
||||||
entry.eax = (entry.eax & 0xffff_ff00) | (phys_bits as u32 & 0xff);
|
entry.eax = (entry.eax & 0xffff_ff00) | (phys_bits as u32 & 0xff);
|
||||||
@@ -735,6 +753,41 @@ pub fn configure_vcpu(
|
|||||||
CpuidPatch::set_cpuid_reg(&mut cpuid, 0xb, None, CpuidReg::EDX, u32::from(id));
|
CpuidPatch::set_cpuid_reg(&mut cpuid, 0xb, None, CpuidReg::EDX, u32::from(id));
|
||||||
CpuidPatch::set_cpuid_reg(&mut cpuid, 0x1f, None, CpuidReg::EDX, u32::from(id));
|
CpuidPatch::set_cpuid_reg(&mut cpuid, 0x1f, None, CpuidReg::EDX, u32::from(id));
|
||||||
|
|
||||||
|
// Set ApicId in cpuid for each vcpu
|
||||||
|
// SAFETY: get host cpuid when eax=1
|
||||||
|
let mut cpu_ebx = unsafe { core::arch::x86_64::__cpuid(1) }.ebx;
|
||||||
|
cpu_ebx &= 0xffffff;
|
||||||
|
cpu_ebx |= (id as u32) << 24;
|
||||||
|
CpuidPatch::set_cpuid_reg(&mut cpuid, 0x1, None, CpuidReg::EBX, cpu_ebx);
|
||||||
|
|
||||||
|
// The TSC frequency CPUID leaf should not be included when running with HyperV emulation
|
||||||
|
if !kvm_hyperv {
|
||||||
|
if let Some(tsc_khz) = vcpu.tsc_khz().map_err(Error::GetTscFrequency)? {
|
||||||
|
// Need to check that the TSC doesn't vary with dynamic frequency
|
||||||
|
// SAFETY: cpuid called with valid leaves
|
||||||
|
if unsafe { std::arch::x86_64::__cpuid(0x8000_0007) }.edx
|
||||||
|
& (1u32 << INVARIANT_TSC_EDX_BIT)
|
||||||
|
> 0
|
||||||
|
{
|
||||||
|
CpuidPatch::set_cpuid_reg(
|
||||||
|
&mut cpuid,
|
||||||
|
0x4000_0000,
|
||||||
|
None,
|
||||||
|
CpuidReg::EAX,
|
||||||
|
0x4000_0010,
|
||||||
|
);
|
||||||
|
cpuid.retain(|c| c.function != 0x4000_0010);
|
||||||
|
cpuid.push(CpuIdEntry {
|
||||||
|
function: 0x4000_0010,
|
||||||
|
eax: tsc_khz,
|
||||||
|
ebx: 1000000, /* LAPIC resolution of 1ns (freq: 1GHz) is hardcoded in KVM's
|
||||||
|
* APIC_BUS_CYCLE_NS */
|
||||||
|
..Default::default()
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vcpu.set_cpuid2(&cpuid)
|
vcpu.set_cpuid2(&cpuid)
|
||||||
.map_err(|e| Error::SetSupportedCpusFailed(e.into()))?;
|
.map_err(|e| Error::SetSupportedCpusFailed(e.into()))?;
|
||||||
|
|
||||||
@@ -1302,6 +1355,6 @@ mod tests {
|
|||||||
add_memmap_entry(&mut memmap, 0, 0x1000, E820_RAM);
|
add_memmap_entry(&mut memmap, 0, 0x1000, E820_RAM);
|
||||||
add_memmap_entry(&mut memmap, 0x10000, 0xa000, E820_RESERVED);
|
add_memmap_entry(&mut memmap, 0x10000, 0xa000, E820_RESERVED);
|
||||||
|
|
||||||
assert_eq!(format!("{:?}", memmap), format!("{:?}", expected_memmap));
|
assert_eq!(format!("{memmap:?}"), format!("{expected_memmap:?}"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ mod tests {
|
|||||||
mpspec::MP_IOAPIC => mem::size_of::<MpcIoapicWrapper>(),
|
mpspec::MP_IOAPIC => mem::size_of::<MpcIoapicWrapper>(),
|
||||||
mpspec::MP_INTSRC => mem::size_of::<MpcIntsrcWrapper>(),
|
mpspec::MP_INTSRC => mem::size_of::<MpcIntsrcWrapper>(),
|
||||||
mpspec::MP_LINTSRC => mem::size_of::<MpcLintsrcWrapper>(),
|
mpspec::MP_LINTSRC => mem::size_of::<MpcLintsrcWrapper>(),
|
||||||
_ => panic!("unrecognized mpc table entry type: {}", type_),
|
_ => panic!("unrecognized mpc table entry type: {type_}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,10 +48,10 @@ impl Display for Error {
|
|||||||
Clear => "Failure while zeroing out the memory for the SMBIOS table".to_string(),
|
Clear => "Failure while zeroing out the memory for the SMBIOS table".to_string(),
|
||||||
WriteSmbiosEp => "Failure to write SMBIOS entrypoint structure".to_string(),
|
WriteSmbiosEp => "Failure to write SMBIOS entrypoint structure".to_string(),
|
||||||
WriteData => "Failure to write additional data to memory".to_string(),
|
WriteData => "Failure to write additional data to memory".to_string(),
|
||||||
ParseUuid(e) => format!("Failure to parse uuid: {}", e),
|
ParseUuid(e) => format!("Failure to parse uuid: {e}"),
|
||||||
};
|
};
|
||||||
|
|
||||||
write!(f, "SMBIOS error: {}", description)
|
write!(f, "SMBIOS error: {description}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ pub struct TdvfSection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug, Default)]
|
||||||
pub enum TdvfSectionType {
|
pub enum TdvfSectionType {
|
||||||
Bfv,
|
Bfv,
|
||||||
Cfv,
|
Cfv,
|
||||||
@@ -55,15 +55,10 @@ pub enum TdvfSectionType {
|
|||||||
PermMem,
|
PermMem,
|
||||||
Payload,
|
Payload,
|
||||||
PayloadParam,
|
PayloadParam,
|
||||||
|
#[default]
|
||||||
Reserved = 0xffffffff,
|
Reserved = 0xffffffff,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for TdvfSectionType {
|
|
||||||
fn default() -> Self {
|
|
||||||
TdvfSectionType::Reserved
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn parse_tdvf_sections(file: &mut File) -> Result<Vec<TdvfSection>, TdvfError> {
|
pub fn parse_tdvf_sections(file: &mut File) -> Result<Vec<TdvfSection>, TdvfError> {
|
||||||
// The 32-bit offset to the TDVF metadata is located 32 bytes from
|
// The 32-bit offset to the TDVF metadata is located 32 bytes from
|
||||||
// the end of the file.
|
// the end of the file.
|
||||||
@@ -120,21 +115,16 @@ pub fn parse_tdvf_sections(file: &mut File) -> Result<Vec<TdvfSection>, TdvfErro
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[repr(u16)]
|
#[repr(u16)]
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
enum HobType {
|
enum HobType {
|
||||||
Handoff = 0x1,
|
Handoff = 0x1,
|
||||||
ResourceDescriptor = 0x3,
|
ResourceDescriptor = 0x3,
|
||||||
GuidExtension = 0x4,
|
GuidExtension = 0x4,
|
||||||
|
#[default]
|
||||||
Unused = 0xfffe,
|
Unused = 0xfffe,
|
||||||
EndOfHobList = 0xffff,
|
EndOfHobList = 0xffff,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for HobType {
|
|
||||||
fn default() -> Self {
|
|
||||||
HobType::Unused
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy, Clone, Default, Debug)]
|
#[derive(Copy, Clone, Default, Debug)]
|
||||||
struct HobHeader {
|
struct HobHeader {
|
||||||
@@ -184,19 +174,14 @@ struct HobGuidType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug, Default)]
|
||||||
pub enum PayloadImageType {
|
pub enum PayloadImageType {
|
||||||
|
#[default]
|
||||||
ExecutablePayload,
|
ExecutablePayload,
|
||||||
BzImage,
|
BzImage,
|
||||||
RawVmLinux,
|
RawVmLinux,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for PayloadImageType {
|
|
||||||
fn default() -> Self {
|
|
||||||
PayloadImageType::ExecutablePayload
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy, Clone, Default, Debug)]
|
#[derive(Copy, Clone, Default, Debug)]
|
||||||
pub struct PayloadInfo {
|
pub struct PayloadInfo {
|
||||||
@@ -447,7 +432,7 @@ mod tests {
|
|||||||
let mut f = std::fs::File::open("tdvf.fd").unwrap();
|
let mut f = std::fs::File::open("tdvf.fd").unwrap();
|
||||||
let sections = parse_tdvf_sections(&mut f).unwrap();
|
let sections = parse_tdvf_sections(&mut f).unwrap();
|
||||||
for section in sections {
|
for section in sections {
|
||||||
eprintln!("{:x?}", section)
|
eprintln!("{section:x?}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,17 +8,17 @@ edition = "2021"
|
|||||||
default = []
|
default = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
io-uring = "0.5.8"
|
io-uring = "0.5.9"
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
qcow = { path = "../qcow" }
|
qcow = { path = "../qcow" }
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
versionize = "0.1.6"
|
versionize = "0.1.9"
|
||||||
versionize_derive = "0.1.4"
|
versionize_derive = "0.1.4"
|
||||||
vhdx = { path = "../vhdx" }
|
vhdx = { path = "../vhdx" }
|
||||||
virtio-bindings = { version = "0.1.0", features = ["virtio-v5_0_0"] }
|
virtio-bindings = { version = "0.1.0", features = ["virtio-v5_0_0"] }
|
||||||
virtio-queue = "0.6.1"
|
virtio-queue = "0.7.0"
|
||||||
vm-memory = { version = "0.9.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
|
vm-memory = { version = "0.10.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
|
||||||
vm-virtio = { path = "../vm-virtio" }
|
vm-virtio = { path = "../vm-virtio" }
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ impl AsyncIo for RawFileSync {
|
|||||||
let result = unsafe {
|
let result = unsafe {
|
||||||
libc::preadv(
|
libc::preadv(
|
||||||
self.fd as libc::c_int,
|
self.fd as libc::c_int,
|
||||||
iovecs.as_ptr() as *const libc::iovec,
|
iovecs.as_ptr(),
|
||||||
iovecs.len() as libc::c_int,
|
iovecs.len() as libc::c_int,
|
||||||
offset,
|
offset,
|
||||||
)
|
)
|
||||||
@@ -95,7 +95,7 @@ impl AsyncIo for RawFileSync {
|
|||||||
let result = unsafe {
|
let result = unsafe {
|
||||||
libc::pwritev(
|
libc::pwritev(
|
||||||
self.fd as libc::c_int,
|
self.fd as libc::c_int,
|
||||||
iovecs.as_ptr() as *const libc::iovec,
|
iovecs.as_ptr(),
|
||||||
iovecs.len() as libc::c_int,
|
iovecs.len() as libc::c_int,
|
||||||
offset,
|
offset,
|
||||||
)
|
)
|
||||||
|
|||||||
2
build.rs
2
build.rs
@@ -23,5 +23,5 @@ fn main() {
|
|||||||
// variable BUILT_VERSION, so that it can be reused from the binary.
|
// variable BUILT_VERSION, so that it can be reused from the binary.
|
||||||
// Particularly, this is used from src/main.rs to display the exact
|
// Particularly, this is used from src/main.rs to display the exact
|
||||||
// version.
|
// version.
|
||||||
println!("cargo:rustc-env=BUILT_VERSION={}", version);
|
println!("cargo:rustc-env=BUILT_VERSION={version}");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,20 +8,20 @@ edition = "2021"
|
|||||||
acpi_tables = { path = "../acpi_tables" }
|
acpi_tables = { path = "../acpi_tables" }
|
||||||
anyhow = "1.0.66"
|
anyhow = "1.0.66"
|
||||||
arch = { path = "../arch" }
|
arch = { path = "../arch" }
|
||||||
bitflags = "1.3.2"
|
bitflags = "2.4.1"
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
hypervisor = { path = "../hypervisor" }
|
hypervisor = { path = "../hypervisor" }
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
phf = { version = "0.11", features = ["macros"] }
|
phf = { version = "0.11.1", features = ["macros"] }
|
||||||
thiserror = "1.0.30"
|
thiserror = "1.0.37"
|
||||||
tpm = { path = "../tpm" }
|
tpm = { path = "../tpm" }
|
||||||
versionize = "0.1.6"
|
versionize = "0.1.9"
|
||||||
versionize_derive = "0.1.4"
|
versionize_derive = "0.1.4"
|
||||||
vm-device = { path = "../vm-device" }
|
vm-device = { path = "../vm-device" }
|
||||||
vm-memory = "0.9.0"
|
vm-memory = "0.10.0"
|
||||||
vm-migration = { path = "../vm-migration" }
|
vm-migration = { path = "../vm-migration" }
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|
||||||
[target.'cfg(target_arch = "aarch64")'.dependencies]
|
[target.'cfg(target_arch = "aarch64")'.dependencies]
|
||||||
arch = { path = "../arch" }
|
arch = { path = "../arch" }
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ impl DebugIoPortRange {
|
|||||||
impl fmt::Display for DebugIoPortRange {
|
impl fmt::Display for DebugIoPortRange {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
DebugIoPortRange::Firmware => write!(f, "{}: Firmware", DEBUG_IOPORT_PREFIX),
|
DebugIoPortRange::Firmware => write!(f, "{DEBUG_IOPORT_PREFIX}: Firmware"),
|
||||||
DebugIoPortRange::Bootloader => write!(f, "{}: Bootloader", DEBUG_IOPORT_PREFIX),
|
DebugIoPortRange::Bootloader => write!(f, "{DEBUG_IOPORT_PREFIX}: Bootloader"),
|
||||||
DebugIoPortRange::Kernel => write!(f, "{}: Kernel", DEBUG_IOPORT_PREFIX),
|
DebugIoPortRange::Kernel => write!(f, "{DEBUG_IOPORT_PREFIX}: Kernel"),
|
||||||
DebugIoPortRange::Userspace => write!(f, "{}: Userspace", DEBUG_IOPORT_PREFIX),
|
DebugIoPortRange::Userspace => write!(f, "{DEBUG_IOPORT_PREFIX}: Userspace"),
|
||||||
DebugIoPortRange::Custom => write!(f, "{}: Custom", DEBUG_IOPORT_PREFIX),
|
DebugIoPortRange::Custom => write!(f, "{DEBUG_IOPORT_PREFIX}: Custom"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,13 +51,13 @@ pub enum Error {
|
|||||||
impl fmt::Display for Error {
|
impl fmt::Display for Error {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Error::BadWriteOffset(offset) => write!(f, "Bad Write Offset: {}", offset),
|
Error::BadWriteOffset(offset) => write!(f, "Bad Write Offset: {offset}"),
|
||||||
Error::GpioInterruptDisabled => write!(f, "GPIO interrupt disabled by guest driver.",),
|
Error::GpioInterruptDisabled => write!(f, "GPIO interrupt disabled by guest driver.",),
|
||||||
Error::GpioInterruptFailure(ref e) => {
|
Error::GpioInterruptFailure(ref e) => {
|
||||||
write!(f, "Could not trigger GPIO interrupt: {}.", e)
|
write!(f, "Could not trigger GPIO interrupt: {e}.")
|
||||||
}
|
}
|
||||||
Error::GpioTriggerKeyFailure(key) => {
|
Error::GpioTriggerKeyFailure(key) => {
|
||||||
write!(f, "Invalid GPIO Input key triggerd: {}.", key)
|
write!(f, "Invalid GPIO Input key triggerd: {key}.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ pub enum Error {
|
|||||||
impl fmt::Display for Error {
|
impl fmt::Display for Error {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Error::BadWriteOffset(offset) => write!(f, "Bad Write Offset: {}", offset),
|
Error::BadWriteOffset(offset) => write!(f, "Bad Write Offset: {offset}"),
|
||||||
Error::InterruptFailure(e) => write!(f, "Failed to trigger interrupt: {}", e),
|
Error::InterruptFailure(e) => write!(f, "Failed to trigger interrupt: {e}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ pub enum Error {
|
|||||||
impl fmt::Display for Error {
|
impl fmt::Display for Error {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Error::BadWriteOffset(offset) => write!(f, "pl011_write: Bad Write Offset: {}", offset),
|
Error::BadWriteOffset(offset) => write!(f, "pl011_write: Bad Write Offset: {offset}"),
|
||||||
Error::DmaNotImplemented => write!(f, "pl011: DMA not implemented."),
|
Error::DmaNotImplemented => write!(f, "pl011: DMA not implemented."),
|
||||||
Error::InterruptFailure(e) => write!(f, "Failed to trigger interrupt: {}", e),
|
Error::InterruptFailure(e) => write!(f, "Failed to trigger interrupt: {e}"),
|
||||||
Error::WriteAllFailure(e) => write!(f, "Failed to write: {}", e),
|
Error::WriteAllFailure(e) => write!(f, "Failed to write: {e}"),
|
||||||
Error::FlushFailure(e) => write!(f, "Failed to flush: {}", e),
|
Error::FlushFailure(e) => write!(f, "Failed to flush: {e}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,10 +117,7 @@ fn get_fields_map(reg: u32) -> phf::Map<&'static str, [u32; 2]> {
|
|||||||
CRB_INTF_ID2 => CRB_INTF_ID2_FIELDS,
|
CRB_INTF_ID2 => CRB_INTF_ID2_FIELDS,
|
||||||
CRB_CTRL_STS => CRB_CTRL_STS_FIELDS,
|
CRB_CTRL_STS => CRB_CTRL_STS_FIELDS,
|
||||||
_ => {
|
_ => {
|
||||||
panic!(
|
panic!("Fields in '{reg:?}' register were accessed which are Invalid");
|
||||||
"Fields in '{:?}' register were accessed which are Invalid",
|
|
||||||
reg
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ process should be started to listen at the input socket. Below is an
|
|||||||
example invocation of swtpm process.
|
example invocation of swtpm process.
|
||||||
|
|
||||||
```
|
```
|
||||||
swtpm socket --tmpstate dir=/var/run/swtpm \
|
swtpm socket --tpmstate dir=/var/run/swtpm \
|
||||||
--ctrl type=unixio,path="/var/run/swtpm.socket" \
|
--ctrl type=unixio,path="/var/run/swtpm.socket" \
|
||||||
--flags startup-clear \
|
--flags startup-clear \
|
||||||
--tpm2
|
--tpm2
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ authors = ["The Cloud Hypervisor Authors"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
serde = { version = "1.0.147", features = ["rc", "derive"] }
|
once_cell = "1.16.0"
|
||||||
serde_json = "1.0.87"
|
serde = { version = "1.0.150", features = ["rc", "derive"] }
|
||||||
|
serde_json = "1.0.89"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
use once_cell::sync::OnceCell;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
@@ -11,12 +12,13 @@ use std::io::Write;
|
|||||||
use std::os::unix::io::AsRawFd;
|
use std::os::unix::io::AsRawFd;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
static mut MONITOR: Option<(File, Instant)> = None;
|
static MONITOR: OnceCell<(File, Instant)> = OnceCell::new();
|
||||||
|
|
||||||
/// This function must only be called once from the main process before any threads
|
/// This function must only be called once from the main process before any threads
|
||||||
/// are created to avoid race conditions
|
/// are created to avoid race conditions
|
||||||
pub fn set_monitor(file: File) -> Result<(), std::io::Error> {
|
pub fn set_monitor(file: File) -> Result<(), std::io::Error> {
|
||||||
assert!(unsafe { MONITOR.is_none() });
|
// There is only one caller of this function, so MONITOR is written to only once
|
||||||
|
assert!(MONITOR.get().is_none());
|
||||||
let fd = file.as_raw_fd();
|
let fd = file.as_raw_fd();
|
||||||
let ret = unsafe {
|
let ret = unsafe {
|
||||||
let mut flags = libc::fcntl(fd, libc::F_GETFL);
|
let mut flags = libc::fcntl(fd, libc::F_GETFL);
|
||||||
@@ -26,9 +28,9 @@ pub fn set_monitor(file: File) -> Result<(), std::io::Error> {
|
|||||||
if ret < 0 {
|
if ret < 0 {
|
||||||
return Err(std::io::Error::last_os_error());
|
return Err(std::io::Error::last_os_error());
|
||||||
}
|
}
|
||||||
unsafe {
|
|
||||||
MONITOR = Some((file, Instant::now()));
|
MONITOR.get_or_init(|| (file, Instant::now()));
|
||||||
};
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,7 +43,7 @@ struct Event<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn event_log(source: &str, event: &str, properties: Option<&HashMap<Cow<str>, Cow<str>>>) {
|
pub fn event_log(source: &str, event: &str, properties: Option<&HashMap<Cow<str>, Cow<str>>>) {
|
||||||
if let Some((file, start)) = unsafe { MONITOR.as_ref() } {
|
if let Some((file, start)) = MONITOR.get().as_ref() {
|
||||||
let e = Event {
|
let e = Event {
|
||||||
timestamp: start.elapsed(),
|
timestamp: start.elapsed(),
|
||||||
source,
|
source,
|
||||||
|
|||||||
167
fuzz/Cargo.lock
generated
167
fuzz/Cargo.lock
generated
@@ -56,17 +56,6 @@ dependencies = [
|
|||||||
"vmm-sys-util",
|
"vmm-sys-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "atty"
|
|
||||||
version = "0.2.14"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
|
||||||
dependencies = [
|
|
||||||
"hermit-abi",
|
|
||||||
"libc",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bincode"
|
name = "bincode"
|
||||||
version = "1.3.3"
|
version = "1.3.3"
|
||||||
@@ -82,6 +71,12 @@ version = "1.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitflags"
|
||||||
|
version = "2.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block_util"
|
name = "block_util"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -109,9 +104,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.73"
|
version = "1.0.77"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
|
checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"jobserver",
|
"jobserver",
|
||||||
]
|
]
|
||||||
@@ -124,13 +119,13 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.0.18"
|
version = "4.0.29"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b"
|
checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"bitflags 1.3.2",
|
||||||
"bitflags",
|
|
||||||
"clap_lex",
|
"clap_lex",
|
||||||
|
"is-terminal",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"strsim",
|
"strsim",
|
||||||
"termcolor",
|
"termcolor",
|
||||||
@@ -148,7 +143,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cloud-hypervisor"
|
name = "cloud-hypervisor"
|
||||||
version = "27.0.0"
|
version = "28.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"api_client",
|
"api_client",
|
||||||
@@ -251,7 +246,7 @@ dependencies = [
|
|||||||
"acpi_tables",
|
"acpi_tables",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"arch",
|
"arch",
|
||||||
"bitflags",
|
"bitflags 2.4.1",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"hypervisor",
|
"hypervisor",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -273,7 +268,7 @@ version = "4.3.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "20df693c700404f7e19d4d6fae6b15215d2913c27955d2b9d6f2c0f537511cd0"
|
checksum = "20df693c700404f7e19d4d6fae6b15215d2913c27955d2b9d6f2c0f537511cd0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -303,6 +298,7 @@ name = "event_monitor"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
|
"once_cell",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
@@ -332,9 +328,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "hermit-abi"
|
||||||
version = "0.1.20"
|
version = "0.2.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c7a30908dbce072eca83216eab939d2290080e00ca71611b96a09e5cdce5f3fa"
|
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
@@ -376,9 +372,13 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "io-lifetimes"
|
name = "io-lifetimes"
|
||||||
version = "0.7.5"
|
version = "1.0.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074"
|
checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "io-uring"
|
name = "io-uring"
|
||||||
@@ -386,10 +386,22 @@ version = "0.5.9"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7ba34abb5175052fc1a2227a10d2275b7386c9990167de9786c0b88d8b062330"
|
checksum = "7ba34abb5175052fc1a2227a10d2275b7386c9990167de9786c0b88d8b062330"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "is-terminal"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi",
|
||||||
|
"io-lifetimes",
|
||||||
|
"rustix",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
@@ -407,8 +419,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kvm-bindings"
|
name = "kvm-bindings"
|
||||||
version = "0.5.0"
|
version = "0.6.0"
|
||||||
source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.5.0-tdx#52e56d0e8ef0f6ea32fc0492e6a175b73617a49f"
|
source = "git+https://github.com/cloud-hypervisor/kvm-bindings?branch=ch-v0.6.0-tdx#7d9ffb47e5b9b1989577258800a0f57c93f1445f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
@@ -417,8 +429,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kvm-ioctls"
|
name = "kvm-ioctls"
|
||||||
version = "0.11.0"
|
version = "0.13.0"
|
||||||
source = "git+https://github.com/rust-vmm/kvm-ioctls?branch=main#1e03e29cdfbb0cb108a98de7a78045a5a517f18e"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b8f8dc9c1896e5f144ec5d07169bc29f39a047686d29585a91f30489abfaeb6b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"kvm-bindings",
|
"kvm-bindings",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -433,9 +446,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.137"
|
version = "0.2.138"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"
|
checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libfuzzer-sys"
|
name = "libfuzzer-sys"
|
||||||
@@ -450,18 +463,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-loader"
|
name = "linux-loader"
|
||||||
version = "0.7.0"
|
version = "0.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f8242360c7d79a7713a28043c994b815e9820b0e97e44b228ec9bd913c16bdfe"
|
checksum = "b9259ddbfbb52cc918f6bbc60390004ddd0228cf1d85f402009ff2b3d95de83f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"vm-memory",
|
"vm-memory",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-raw-sys"
|
name = "linux-raw-sys"
|
||||||
version = "0.0.46"
|
version = "0.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d"
|
checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
@@ -475,7 +488,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "micro_http"
|
name = "micro_http"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/firecracker-microvm/micro-http?branch=main#863b0370ba7e57f7df5b908ada9e5b44809ccae9"
|
source = "git+https://github.com/firecracker-microvm/micro-http?branch=main#4b18a043e997da5b5f679e3defc279fec908753e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"vmm-sys-util",
|
"vmm-sys-util",
|
||||||
@@ -521,9 +534,9 @@ version = "0.1.0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "os_str_bytes"
|
name = "os_str_bytes"
|
||||||
version = "6.4.0"
|
version = "6.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7b5bf27447411e9ee3ff51186bf7a08e16c341efdde93f4d823e8844429bed7e"
|
checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pci"
|
name = "pci"
|
||||||
@@ -592,9 +605,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.47"
|
version = "1.0.76"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
|
checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
@@ -665,11 +678,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "0.35.13"
|
version = "0.36.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9"
|
checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"errno",
|
"errno",
|
||||||
"io-lifetimes",
|
"io-lifetimes",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -700,18 +713,18 @@ checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.147"
|
version = "1.0.150"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
|
checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.147"
|
version = "1.0.150"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
|
checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -720,9 +733,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.87"
|
version = "1.0.89"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45"
|
checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
@@ -731,9 +744,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_with"
|
name = "serde_with"
|
||||||
version = "2.0.1"
|
version = "2.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "368f2d60d049ea019a84dcd6687b0d1e0030fe663ae105039bdf967ed5e6a9a7"
|
checksum = "25bf4a5a814902cd1014dbccfa4d4560fb8432c779471e96e035602519f82eef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_with_macros",
|
"serde_with_macros",
|
||||||
@@ -741,9 +754,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_with_macros"
|
name = "serde_with_macros"
|
||||||
version = "2.0.1"
|
version = "2.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1ccadfacf6cf10faad22bbadf55986bdd0856edfb5d9210aa1dcf1f516e84e93"
|
checksum = "e3452b4c0f6c1e357f73fdb87cd1efabaa12acf328c7a528e252893baeb3f4aa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@@ -794,9 +807,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.103"
|
version = "1.0.105"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d"
|
checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -814,9 +827,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "terminal_size"
|
name = "terminal_size"
|
||||||
version = "0.2.2"
|
version = "0.2.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "40ca90c434fd12083d1a6bdcbe9f92a14f96c8a1ba600ba451734ac334521f7a"
|
checksum = "cb20089a8ba2b69debd491f8d2d023761cbf196e999218c591fa1e7e15a21907"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustix",
|
"rustix",
|
||||||
"windows-sys",
|
"windows-sys",
|
||||||
@@ -882,9 +895,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "versionize"
|
name = "versionize"
|
||||||
version = "0.1.6"
|
version = "0.1.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7429cf68de8f091b667d27323ed323afd39584a56d533995b12ddd748e5e6ca9"
|
checksum = "d6e2495726cf917e7ba7ec8bf0f0fceab543dd38d0a4195ed6bef331e38a290f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"crc64",
|
"crc64",
|
||||||
@@ -909,17 +922,16 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vfio-bindings"
|
name = "vfio-bindings"
|
||||||
version = "0.3.1"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/rust-vmm/vfio?branch=main#43439e056ddfa84a4f7906ee7f2f58be70505c08"
|
||||||
checksum = "43449b404c488f70507dca193debd4bea361fe8089869b947adc19720e464bce"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"vmm-sys-util",
|
"vmm-sys-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vfio-ioctls"
|
name = "vfio-ioctls"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
source = "git+https://github.com/rust-vmm/vfio?branch=main#bf7c9b997b4ad0ca1ab4bfe96dc1b10d4bc5be24"
|
source = "git+https://github.com/rust-vmm/vfio?branch=main#43439e056ddfa84a4f7906ee7f2f58be70505c08"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"kvm-bindings",
|
"kvm-bindings",
|
||||||
@@ -962,10 +974,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vhost"
|
name = "vhost"
|
||||||
version = "0.5.0"
|
version = "0.6.0"
|
||||||
source = "git+https://github.com/rust-vmm/vhost?branch=main#f87156b77662af63b9fc9f116a213dd69e16007b"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c9b791c5b0717a0558888a4cf7240cea836f39a99cb342e12ce633dcaa078072"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"libc",
|
"libc",
|
||||||
"vm-memory",
|
"vm-memory",
|
||||||
"vmm-sys-util",
|
"vmm-sys-util",
|
||||||
@@ -1014,9 +1027,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "virtio-queue"
|
name = "virtio-queue"
|
||||||
version = "0.6.1"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "435dd49c7b38419729afd43675850c7b5dc4728f2fabd70c7a9079a331e4f8c6"
|
checksum = "19e927d93d54c365034fd7f31a5f458a1f540de4a37c52e892670dad9692173c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"virtio-bindings",
|
"virtio-bindings",
|
||||||
@@ -1048,14 +1061,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vm-fdt"
|
name = "vm-fdt"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
source = "git+https://github.com/rust-vmm/vm-fdt?branch=main#720e48e435b791ec6cbe8d2b229448b71dcb1ab9"
|
source = "git+https://github.com/rust-vmm/vm-fdt?branch=main#c5a99ab71b130435927d19b50c85fcd5ce904a8c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vm-memory"
|
name = "vm-memory"
|
||||||
version = "0.9.0"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "583f213899e8a5eea23d9c507252d4bed5bc88f0ecbe0783262f80034630744b"
|
checksum = "688a70366615b45575a424d9c665561c1b5ab2224d494f706b6a6812911a827c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -1092,7 +1105,7 @@ dependencies = [
|
|||||||
"anyhow",
|
"anyhow",
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"arch",
|
"arch",
|
||||||
"bitflags",
|
"bitflags 2.4.1",
|
||||||
"block_util",
|
"block_util",
|
||||||
"clap",
|
"clap",
|
||||||
"devices",
|
"devices",
|
||||||
@@ -1133,11 +1146,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vmm-sys-util"
|
name = "vmm-sys-util"
|
||||||
version = "0.10.0"
|
version = "0.11.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "08604d7be03eb26e33b3cee3ed4aef2bf550b305d1cca60e84da5d28d3790b62"
|
checksum = "cc06a16ee8ebf0d9269aed304030b0d20a866b8b3dd3d4ce532596ac567a0d24"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags 1.3.2",
|
||||||
"libc",
|
"libc",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ qcow = { path = "../qcow" }
|
|||||||
seccompiler = "0.3.0"
|
seccompiler = "0.3.0"
|
||||||
vhdx = { path = "../vhdx" }
|
vhdx = { path = "../vhdx" }
|
||||||
virtio-devices = { path = "../virtio-devices" }
|
virtio-devices = { path = "../virtio-devices" }
|
||||||
virtio-queue = "0.6.1"
|
virtio-queue = "0.7.0"
|
||||||
vmm = { path = "../vmm" }
|
vmm = { path = "../vmm" }
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
vm-memory = "0.9.0"
|
vm-memory = "0.10.0"
|
||||||
vm-device = { path = "../vm-device" }
|
vm-device = { path = "../vm-device" }
|
||||||
vm-virtio = { path = "../vm-virtio" }
|
vm-virtio = { path = "../vm-virtio" }
|
||||||
|
|
||||||
@@ -31,10 +31,8 @@ vm-virtio = { path = "../vm-virtio" }
|
|||||||
path = ".."
|
path = ".."
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.5.0-tdx" }
|
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.6.0-tdx" }
|
||||||
kvm-ioctls = { git = "https://github.com/rust-vmm/kvm-ioctls", branch = "main" }
|
|
||||||
versionize_derive = { git = "https://github.com/cloud-hypervisor/versionize_derive", branch = "ch" }
|
versionize_derive = { git = "https://github.com/cloud-hypervisor/versionize_derive", branch = "ch" }
|
||||||
vhost = { git = "https://github.com/rust-vmm/vhost", branch = "main" }
|
|
||||||
|
|
||||||
# Prevent this from interfering with workspaces
|
# Prevent this from interfering with workspaces
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|||||||
@@ -14,17 +14,17 @@ tdx = []
|
|||||||
anyhow = "1.0.66"
|
anyhow = "1.0.66"
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
kvm-ioctls = { version = "0.11.0", optional = true }
|
kvm-ioctls = { version = "0.13.0", optional = true }
|
||||||
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.5.0-tdx", features = ["with-serde", "fam-wrappers"], optional = true }
|
kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch-v0.6.0-tdx", features = ["with-serde", "fam-wrappers"], optional = true }
|
||||||
mshv-bindings = { git = "https://github.com/rust-vmm/mshv", branch = "main", features = ["with-serde", "fam-wrappers"], optional = true }
|
mshv-bindings = { git = "https://github.com/rust-vmm/mshv", branch = "main", features = ["with-serde", "fam-wrappers"], optional = true }
|
||||||
mshv-ioctls = { git = "https://github.com/rust-vmm/mshv", branch = "main", optional = true}
|
mshv-ioctls = { git = "https://github.com/rust-vmm/mshv", branch = "main", optional = true}
|
||||||
serde = { version = "1.0.147", features = ["rc", "derive"] }
|
serde = { version = "1.0.150", features = ["rc", "derive"] }
|
||||||
serde_with = { version = "2.0.1", default-features = false, features = ["macros"] }
|
serde_with = { version = "2.1.0", default-features = false, features = ["macros"] }
|
||||||
vfio-ioctls = { git = "https://github.com/rust-vmm/vfio", branch = "main", default-features = false }
|
vfio-ioctls = { git = "https://github.com/rust-vmm/vfio", branch = "main", default-features = false }
|
||||||
vm-memory = { version = "0.9.0", features = ["backend-mmap", "backend-atomic"] }
|
vm-memory = { version = "0.10.0", features = ["backend-mmap", "backend-atomic"] }
|
||||||
vmm-sys-util = { version = "0.10.0", features = ["with-serde"] }
|
vmm-sys-util = { version = "0.11.0", features = ["with-serde"] }
|
||||||
|
|
||||||
[target.'cfg(target_arch = "x86_64")'.dependencies.iced-x86]
|
[target.'cfg(target_arch = "x86_64")'.dependencies.iced-x86]
|
||||||
version = "1.17.0"
|
version = "1.17.0"
|
||||||
@@ -32,4 +32,4 @@ default-features = false
|
|||||||
features = ["std", "decoder", "op_code_info", "instr_info", "fast_fmt"]
|
features = ["std", "decoder", "op_code_info", "instr_info", "fast_fmt"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
env_logger = "0.9.3"
|
env_logger = "0.10.0"
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ impl<T: Debug> Display for Exception<T> {
|
|||||||
self.vector,
|
self.vector,
|
||||||
self.ip,
|
self.ip,
|
||||||
self.error
|
self.error
|
||||||
.map(|e| format!(": error {:x}", e))
|
.map(|e| format!(": error {e:x}"))
|
||||||
.unwrap_or_else(|| "".to_owned()),
|
.unwrap_or_else(|| "".to_owned()),
|
||||||
self.payload
|
self.payload
|
||||||
.map(|payload| format!(": payload {:x}", payload))
|
.map(|payload| format!(": payload {payload:x}"))
|
||||||
.unwrap_or_else(|| "".to_owned())
|
.unwrap_or_else(|| "".to_owned())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ fn get_op<T: CpuStateManager>(
|
|||||||
insn: &Instruction,
|
insn: &Instruction,
|
||||||
op_index: u32,
|
op_index: u32,
|
||||||
op_size: usize,
|
op_size: usize,
|
||||||
state: &mut T,
|
state: &T,
|
||||||
platform: &mut dyn PlatformEmulator<CpuState = T>,
|
platform: &dyn PlatformEmulator<CpuState = T>,
|
||||||
) -> Result<u64, PlatformError> {
|
) -> Result<u64, PlatformError> {
|
||||||
if insn.op_count() < op_index + 1 {
|
if insn.op_count() < op_index + 1 {
|
||||||
return Err(PlatformError::InvalidOperand(anyhow!(
|
return Err(PlatformError::InvalidOperand(anyhow!(
|
||||||
|
|||||||
@@ -237,6 +237,12 @@ pub enum HypervisorCpuError {
|
|||||||
///
|
///
|
||||||
#[error("Failed to initialize PMU")]
|
#[error("Failed to initialize PMU")]
|
||||||
InitializePmu,
|
InitializePmu,
|
||||||
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
///
|
||||||
|
/// Error getting TSC frequency
|
||||||
|
///
|
||||||
|
#[error("Failed to get TSC frequency: {0}")]
|
||||||
|
GetTscKhz(#[source] anyhow::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@@ -432,4 +438,11 @@ pub trait Vcpu: Send + Sync {
|
|||||||
/// Return the list of initial MSR entries for a VCPU
|
/// Return the list of initial MSR entries for a VCPU
|
||||||
///
|
///
|
||||||
fn boot_msr_entries(&self) -> Vec<MsrEntry>;
|
fn boot_msr_entries(&self) -> Vec<MsrEntry>;
|
||||||
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
///
|
||||||
|
/// Get the frequency of the TSC if available
|
||||||
|
///
|
||||||
|
fn tsc_khz(&self) -> Result<Option<u32>> {
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,8 +97,7 @@ pub fn is_system_register(regid: u64) -> bool {
|
|||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
!(size != KVM_REG_SIZE_U32 && size != KVM_REG_SIZE_U64),
|
!(size != KVM_REG_SIZE_U32 && size != KVM_REG_SIZE_U64),
|
||||||
"Unexpected register size for system register {}",
|
"Unexpected register size for system register {size}"
|
||||||
size
|
|
||||||
);
|
);
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ impl KvmVm {
|
|||||||
Ok(VfioDeviceFd::new_from_kvm(device_fd))
|
Ok(VfioDeviceFd::new_from_kvm(device_fd))
|
||||||
}
|
}
|
||||||
/// Checks if a particular `Cap` is available.
|
/// Checks if a particular `Cap` is available.
|
||||||
fn check_extension(&self, c: Cap) -> bool {
|
pub fn check_extension(&self, c: Cap) -> bool {
|
||||||
self.fd.check_extension(c)
|
self.fd.check_extension(c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2152,6 +2152,23 @@ impl cpu::Vcpu for KvmVcpu {
|
|||||||
.set_device_attr(&cpu_attr)
|
.set_device_attr(&cpu_attr)
|
||||||
.map_err(|_| cpu::HypervisorCpuError::InitializePmu)
|
.map_err(|_| cpu::HypervisorCpuError::InitializePmu)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
///
|
||||||
|
/// Get the frequency of the TSC if available
|
||||||
|
///
|
||||||
|
fn tsc_khz(&self) -> cpu::Result<Option<u32>> {
|
||||||
|
match self.fd.get_tsc_khz() {
|
||||||
|
Err(e) => {
|
||||||
|
if e.errno() == libc::EIO {
|
||||||
|
Ok(None)
|
||||||
|
} else {
|
||||||
|
Err(cpu::HypervisorCpuError::GetTscKhz(e.into()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(v) => Ok(Some(v)),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl KvmVcpu {
|
impl KvmVcpu {
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ pub fn check_required_kvm_extensions(kvm: &Kvm) -> KvmResult<()> {
|
|||||||
if !kvm.check_extension(Cap::ImmediateExit) {
|
if !kvm.check_extension(Cap::ImmediateExit) {
|
||||||
return Err(KvmError::CapabilityMissing(Cap::ImmediateExit));
|
return Err(KvmError::CapabilityMissing(Cap::ImmediateExit));
|
||||||
}
|
}
|
||||||
|
if !kvm.check_extension(Cap::GetTscKhz) {
|
||||||
|
return Err(KvmError::CapabilityMissing(Cap::GetTscKhz));
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
#[derive(Clone, Serialize, Deserialize)]
|
#[derive(Clone, Serialize, Deserialize)]
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ pub use vm::{
|
|||||||
Vm, VmOps,
|
Vm, VmOps,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||||
pub enum HypervisorType {
|
pub enum HypervisorType {
|
||||||
Kvm,
|
Kvm,
|
||||||
Mshv,
|
Mshv,
|
||||||
|
|||||||
@@ -38,9 +38,7 @@ use std::fs::File;
|
|||||||
use std::os::unix::io::AsRawFd;
|
use std::os::unix::io::AsRawFd;
|
||||||
|
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
use crate::arch::x86::{
|
use crate::arch::x86::{CpuIdEntry, FpuState, MsrEntry};
|
||||||
CpuIdEntry, FpuState, LapicState, MsrEntry, SpecialRegisters, StandardRegisters,
|
|
||||||
};
|
|
||||||
|
|
||||||
const DIRTY_BITMAP_CLEAR_DIRTY: u64 = 0x4;
|
const DIRTY_BITMAP_CLEAR_DIRTY: u64 = 0x4;
|
||||||
const DIRTY_BITMAP_SET_DIRTY: u64 = 0x8;
|
const DIRTY_BITMAP_SET_DIRTY: u64 = 0x8;
|
||||||
@@ -299,7 +297,7 @@ impl cpu::Vcpu for MshvVcpu {
|
|||||||
///
|
///
|
||||||
/// Returns the vCPU general purpose registers.
|
/// Returns the vCPU general purpose registers.
|
||||||
///
|
///
|
||||||
fn get_regs(&self) -> cpu::Result<StandardRegisters> {
|
fn get_regs(&self) -> cpu::Result<crate::arch::x86::StandardRegisters> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.fd
|
.fd
|
||||||
.get_regs()
|
.get_regs()
|
||||||
@@ -310,7 +308,7 @@ impl cpu::Vcpu for MshvVcpu {
|
|||||||
///
|
///
|
||||||
/// Sets the vCPU general purpose registers.
|
/// Sets the vCPU general purpose registers.
|
||||||
///
|
///
|
||||||
fn set_regs(&self, regs: &StandardRegisters) -> cpu::Result<()> {
|
fn set_regs(&self, regs: &crate::arch::x86::StandardRegisters) -> cpu::Result<()> {
|
||||||
let regs = (*regs).into();
|
let regs = (*regs).into();
|
||||||
self.fd
|
self.fd
|
||||||
.set_regs(®s)
|
.set_regs(®s)
|
||||||
@@ -320,7 +318,7 @@ impl cpu::Vcpu for MshvVcpu {
|
|||||||
///
|
///
|
||||||
/// Returns the vCPU special registers.
|
/// Returns the vCPU special registers.
|
||||||
///
|
///
|
||||||
fn get_sregs(&self) -> cpu::Result<SpecialRegisters> {
|
fn get_sregs(&self) -> cpu::Result<crate::arch::x86::SpecialRegisters> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.fd
|
.fd
|
||||||
.get_sregs()
|
.get_sregs()
|
||||||
@@ -331,7 +329,7 @@ impl cpu::Vcpu for MshvVcpu {
|
|||||||
///
|
///
|
||||||
/// Sets the vCPU special registers.
|
/// Sets the vCPU special registers.
|
||||||
///
|
///
|
||||||
fn set_sregs(&self, sregs: &SpecialRegisters) -> cpu::Result<()> {
|
fn set_sregs(&self, sregs: &crate::arch::x86::SpecialRegisters) -> cpu::Result<()> {
|
||||||
let sregs = (*sregs).into();
|
let sregs = (*sregs).into();
|
||||||
self.fd
|
self.fd
|
||||||
.set_sregs(&sregs)
|
.set_sregs(&sregs)
|
||||||
@@ -581,7 +579,7 @@ impl cpu::Vcpu for MshvVcpu {
|
|||||||
///
|
///
|
||||||
/// Returns the state of the LAPIC (Local Advanced Programmable Interrupt Controller).
|
/// Returns the state of the LAPIC (Local Advanced Programmable Interrupt Controller).
|
||||||
///
|
///
|
||||||
fn get_lapic(&self) -> cpu::Result<LapicState> {
|
fn get_lapic(&self) -> cpu::Result<crate::arch::x86::LapicState> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.fd
|
.fd
|
||||||
.get_lapic()
|
.get_lapic()
|
||||||
@@ -592,7 +590,7 @@ impl cpu::Vcpu for MshvVcpu {
|
|||||||
///
|
///
|
||||||
/// Sets the state of the LAPIC (Local Advanced Programmable Interrupt Controller).
|
/// Sets the state of the LAPIC (Local Advanced Programmable Interrupt Controller).
|
||||||
///
|
///
|
||||||
fn set_lapic(&self, lapic: &LapicState) -> cpu::Result<()> {
|
fn set_lapic(&self, lapic: &crate::arch::x86::LapicState) -> cpu::Result<()> {
|
||||||
let lapic: mshv_bindings::LapicState = (*lapic).clone().into();
|
let lapic: mshv_bindings::LapicState = (*lapic).clone().into();
|
||||||
self.fd
|
self.fd
|
||||||
.set_lapic(&lapic)
|
.set_lapic(&lapic)
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ authors = ["The Chromium OS Authors"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|||||||
@@ -28,10 +28,12 @@ pub mod inn;
|
|||||||
// generated with bindgen /usr/include/linux/sockios.h --no-unstable-rust
|
// generated with bindgen /usr/include/linux/sockios.h --no-unstable-rust
|
||||||
// --constified-enum '*' --with-derive-default
|
// --constified-enum '*' --with-derive-default
|
||||||
pub mod sockios;
|
pub mod sockios;
|
||||||
pub use if_tun::*;
|
pub use if_tun::{
|
||||||
pub use iff::*;
|
sock_fprog, IFF_MULTI_QUEUE, IFF_NO_PI, IFF_TAP, IFF_VNET_HDR, TUN_F_CSUM, TUN_F_TSO4,
|
||||||
pub use inn::*;
|
TUN_F_TSO6, TUN_F_TSO_ECN, TUN_F_UFO,
|
||||||
pub use sockios::*;
|
};
|
||||||
|
pub use iff::{ifreq, net_device_flags_IFF_UP, setsockopt, sockaddr, AF_INET};
|
||||||
|
pub use inn::sockaddr_in;
|
||||||
|
|
||||||
pub const TUNTAP: ::std::os::raw::c_uint = 84;
|
pub const TUNTAP: ::std::os::raw::c_uint = 84;
|
||||||
|
|
||||||
|
|||||||
@@ -6,23 +6,23 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
epoll = "4.3.1"
|
epoll = "4.3.1"
|
||||||
getrandom = "0.2.7"
|
getrandom = "0.2.8"
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
net_gen = { path = "../net_gen" }
|
net_gen = { path = "../net_gen" }
|
||||||
rate_limiter = { path = "../rate_limiter" }
|
rate_limiter = { path = "../rate_limiter" }
|
||||||
serde = "1.0.147"
|
serde = "1.0.150"
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
versionize = "0.1.6"
|
versionize = "0.1.9"
|
||||||
versionize_derive = "0.1.4"
|
versionize_derive = "0.1.4"
|
||||||
virtio-bindings = "0.1.0"
|
virtio-bindings = "0.1.0"
|
||||||
virtio-queue = "0.6.1"
|
virtio-queue = "0.7.0"
|
||||||
vm-memory = { version = "0.9.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
|
vm-memory = { version = "0.10.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
|
||||||
vm-virtio = { path = "../vm-virtio" }
|
vm-virtio = { path = "../vm-virtio" }
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
once_cell = "1.16.0"
|
once_cell = "1.16.0"
|
||||||
pnet = "0.31.0"
|
pnet = "0.34.0"
|
||||||
pnet_datalink = "0.31.0"
|
pnet_datalink = "0.34.0"
|
||||||
serde_json = "1.0.87"
|
serde_json = "1.0.89"
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ impl<'de> Deserialize<'de> for MacAddr {
|
|||||||
{
|
{
|
||||||
let s = String::deserialize(deserializer)?;
|
let s = String::deserialize(deserializer)?;
|
||||||
MacAddr::parse_str(&s)
|
MacAddr::parse_str(&s)
|
||||||
.map_err(|e| D::Error::custom(format!("The provided MAC address is invalid: {}", e)))
|
.map_err(|e| D::Error::custom(format!("The provided MAC address is invalid: {e}")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ mod tests {
|
|||||||
|
|
||||||
let mac = MacAddr::parse_str("12:34:56:78:9a:BC").unwrap();
|
let mac = MacAddr::parse_str("12:34:56:78:9a:BC").unwrap();
|
||||||
|
|
||||||
println!("parsed MAC address: {}", mac);
|
println!("parsed MAC address: {mac}");
|
||||||
|
|
||||||
let bytes = mac.get_bytes();
|
let bytes = mac.get_bytes();
|
||||||
assert_eq!(bytes, [0x12u8, 0x34, 0x56, 0x78, 0x9a, 0xbc]);
|
assert_eq!(bytes, [0x12u8, 0x34, 0x56, 0x78, 0x9a, 0xbc]);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ type Result<T> = std::result::Result<T, Error>;
|
|||||||
fn check_mq_support(if_name: &Option<&str>, queue_pairs: usize) -> Result<()> {
|
fn check_mq_support(if_name: &Option<&str>, queue_pairs: usize) -> Result<()> {
|
||||||
if let Some(tap_name) = if_name {
|
if let Some(tap_name) = if_name {
|
||||||
let mq = queue_pairs > 1;
|
let mq = queue_pairs > 1;
|
||||||
let path = format!("/sys/class/net/{}/tun_flags", tap_name);
|
let path = format!("/sys/class/net/{tap_name}/tun_flags");
|
||||||
// interface does not exist, check is not required
|
// interface does not exist, check is not required
|
||||||
if !Path::new(&path).exists() {
|
if !Path::new(&path).exists() {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ impl TxVirtio {
|
|||||||
let result = unsafe {
|
let result = unsafe {
|
||||||
libc::writev(
|
libc::writev(
|
||||||
tap.as_raw_fd() as libc::c_int,
|
tap.as_raw_fd() as libc::c_int,
|
||||||
iovecs.as_ptr() as *const libc::iovec,
|
iovecs.as_ptr(),
|
||||||
iovecs.len() as libc::c_int,
|
iovecs.len() as libc::c_int,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
@@ -104,6 +104,10 @@ impl TxVirtio {
|
|||||||
return Err(NetQueuePairError::WriteTap(e));
|
return Err(NetQueuePairError::WriteTap(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result as usize) < vnet_hdr_len() {
|
||||||
|
return Err(NetQueuePairError::InvalidVirtioNetHeader);
|
||||||
|
}
|
||||||
|
|
||||||
self.counter_bytes += Wrapping(result as u64 - vnet_hdr_len() as u64);
|
self.counter_bytes += Wrapping(result as u64 - vnet_hdr_len() as u64);
|
||||||
self.counter_frames += Wrapping(1);
|
self.counter_frames += Wrapping(1);
|
||||||
|
|
||||||
@@ -185,7 +189,7 @@ impl RxVirtio {
|
|||||||
.translate_gva(access_platform, desc.len() as usize),
|
.translate_gva(access_platform, desc.len() as usize),
|
||||||
10,
|
10,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.ok_or(NetQueuePairError::DescriptorInvalidHeader)?;
|
||||||
let mut next_desc = Some(desc);
|
let mut next_desc = Some(desc);
|
||||||
|
|
||||||
let mut iovecs = Vec::new();
|
let mut iovecs = Vec::new();
|
||||||
@@ -220,7 +224,7 @@ impl RxVirtio {
|
|||||||
let result = unsafe {
|
let result = unsafe {
|
||||||
libc::readv(
|
libc::readv(
|
||||||
tap.as_raw_fd() as libc::c_int,
|
tap.as_raw_fd() as libc::c_int,
|
||||||
iovecs.as_ptr() as *const libc::iovec,
|
iovecs.as_ptr(),
|
||||||
iovecs.len() as libc::c_int,
|
iovecs.len() as libc::c_int,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
@@ -238,6 +242,10 @@ impl RxVirtio {
|
|||||||
return Err(NetQueuePairError::ReadTap(e));
|
return Err(NetQueuePairError::ReadTap(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result as usize) < vnet_hdr_len() {
|
||||||
|
return Err(NetQueuePairError::InvalidVirtioNetHeader);
|
||||||
|
}
|
||||||
|
|
||||||
// Write num_buffers to guest memory. We simply write 1 as we
|
// Write num_buffers to guest memory. We simply write 1 as we
|
||||||
// never spread the frame over more than one descriptor chain.
|
// never spread the frame over more than one descriptor chain.
|
||||||
desc_chain
|
desc_chain
|
||||||
@@ -312,6 +320,10 @@ pub enum NetQueuePairError {
|
|||||||
QueueEnableNotification(virtio_queue::Error),
|
QueueEnableNotification(virtio_queue::Error),
|
||||||
#[error("Failed to add used index to the queue: {0}")]
|
#[error("Failed to add used index to the queue: {0}")]
|
||||||
QueueAddUsed(virtio_queue::Error),
|
QueueAddUsed(virtio_queue::Error),
|
||||||
|
#[error("Descriptor with invalid virtio-net header")]
|
||||||
|
DescriptorInvalidHeader,
|
||||||
|
#[error("Invalid virtio-net header")]
|
||||||
|
InvalidVirtioNetHeader,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct NetQueuePair {
|
pub struct NetQueuePair {
|
||||||
|
|||||||
@@ -586,7 +586,7 @@ mod tests {
|
|||||||
let _tap_ip_guard = TAP_IP_LOCK.lock().unwrap();
|
let _tap_ip_guard = TAP_IP_LOCK.lock().unwrap();
|
||||||
|
|
||||||
let t = Tap::new(1).unwrap();
|
let t = Tap::new(1).unwrap();
|
||||||
println!("created tap: {:?}", t);
|
println!("created tap: {t:?}");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ pub enum OptionParserError {
|
|||||||
impl fmt::Display for OptionParserError {
|
impl fmt::Display for OptionParserError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
OptionParserError::UnknownOption(s) => write!(f, "unknown option: {}", s),
|
OptionParserError::UnknownOption(s) => write!(f, "unknown option: {s}"),
|
||||||
OptionParserError::InvalidSyntax(s) => write!(f, "invalid syntax:{}", s),
|
OptionParserError::InvalidSyntax(s) => write!(f, "invalid syntax:{s}"),
|
||||||
OptionParserError::Conversion(field, value) => {
|
OptionParserError::Conversion(field, value) => {
|
||||||
write!(f, "unable to convert {} for {}", value, field)
|
write!(f, "unable to convert {value} for {field}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,20 +13,17 @@ mshv = ["vfio-ioctls/mshv"]
|
|||||||
anyhow = "1.0.66"
|
anyhow = "1.0.66"
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
hypervisor = { path = "../hypervisor" }
|
hypervisor = { path = "../hypervisor" }
|
||||||
|
vfio-bindings = { git = "https://github.com/rust-vmm/vfio", branch = "main", features = ["fam-wrappers"] }
|
||||||
vfio-ioctls = { git = "https://github.com/rust-vmm/vfio", branch = "main", default-features = false }
|
vfio-ioctls = { git = "https://github.com/rust-vmm/vfio", branch = "main", default-features = false }
|
||||||
vfio_user = { path = "../vfio_user" }
|
vfio_user = { path = "../vfio_user" }
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
serde = { version = "1.0.147", features = ["derive"] }
|
serde = { version = "1.0.150", features = ["derive"] }
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
versionize = "0.1.6"
|
versionize = "0.1.9"
|
||||||
versionize_derive = "0.1.4"
|
versionize_derive = "0.1.4"
|
||||||
vm-allocator = { path = "../vm-allocator" }
|
vm-allocator = { path = "../vm-allocator" }
|
||||||
vm-device = { path = "../vm-device" }
|
vm-device = { path = "../vm-device" }
|
||||||
vm-memory = "0.9.0"
|
vm-memory = "0.10.0"
|
||||||
vm-migration = { path = "../vm-migration" }
|
vm-migration = { path = "../vm-migration" }
|
||||||
|
|
||||||
[dependencies.vfio-bindings]
|
|
||||||
version = "0.3.1"
|
|
||||||
features = ["fam-wrappers"]
|
|
||||||
@@ -514,9 +514,9 @@ impl Display for Error {
|
|||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
use self::Error::*;
|
use self::Error::*;
|
||||||
match self {
|
match self {
|
||||||
BarAddressInvalid(a, s) => write!(f, "address {} size {} too big", a, s),
|
BarAddressInvalid(a, s) => write!(f, "address {a} size {s} too big"),
|
||||||
BarInUse(b) => write!(f, "bar {} already used", b),
|
BarInUse(b) => write!(f, "bar {b} already used"),
|
||||||
BarInUse64(b) => write!(f, "64bit bar {} already used(requires two regs)", b),
|
BarInUse64(b) => write!(f, "64bit bar {b} already used(requires two regs)"),
|
||||||
BarInvalid(b) => write!(f, "bar {} invalid, max {}", b, NUM_BAR_REGS - 1),
|
BarInvalid(b) => write!(f, "bar {} invalid, max {}", b, NUM_BAR_REGS - 1),
|
||||||
BarInvalid64(b) => write!(
|
BarInvalid64(b) => write!(
|
||||||
f,
|
f,
|
||||||
@@ -524,18 +524,18 @@ impl Display for Error {
|
|||||||
b,
|
b,
|
||||||
NUM_BAR_REGS - 1
|
NUM_BAR_REGS - 1
|
||||||
),
|
),
|
||||||
BarSizeInvalid(s) => write!(f, "bar address {} not a power of two", s),
|
BarSizeInvalid(s) => write!(f, "bar address {s} not a power of two"),
|
||||||
CapabilityEmpty => write!(f, "empty capabilities are invalid"),
|
CapabilityEmpty => write!(f, "empty capabilities are invalid"),
|
||||||
CapabilityLengthInvalid(l) => write!(f, "Invalid capability length {}", l),
|
CapabilityLengthInvalid(l) => write!(f, "Invalid capability length {l}"),
|
||||||
CapabilitySpaceFull(s) => write!(f, "capability of size {} doesn't fit", s),
|
CapabilitySpaceFull(s) => write!(f, "capability of size {s} doesn't fit"),
|
||||||
Decode32BarSize => write!(f, "failed to decode 32 bits BAR size"),
|
Decode32BarSize => write!(f, "failed to decode 32 bits BAR size"),
|
||||||
Decode64BarSize => write!(f, "failed to decode 64 bits BAR size"),
|
Decode64BarSize => write!(f, "failed to decode 64 bits BAR size"),
|
||||||
Encode32BarSize => write!(f, "failed to encode 32 bits BAR size"),
|
Encode32BarSize => write!(f, "failed to encode 32 bits BAR size"),
|
||||||
Encode64BarSize => write!(f, "failed to encode 64 bits BAR size"),
|
Encode64BarSize => write!(f, "failed to encode 64 bits BAR size"),
|
||||||
RomBarAddressInvalid(a, s) => write!(f, "address {} size {} too big", a, s),
|
RomBarAddressInvalid(a, s) => write!(f, "address {a} size {s} too big"),
|
||||||
RomBarInUse(b) => write!(f, "rom bar {} already used", b),
|
RomBarInUse(b) => write!(f, "rom bar {b} already used"),
|
||||||
RomBarInvalid(b) => write!(f, "rom bar {} invalid, max {}", b, NUM_BAR_REGS - 1),
|
RomBarInvalid(b) => write!(f, "rom bar {} invalid, max {}", b, NUM_BAR_REGS - 1),
|
||||||
RomBarSizeInvalid(s) => write!(f, "rom bar address {} not a power of two", s),
|
RomBarSizeInvalid(s) => write!(f, "rom bar address {s} not a power of two"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,15 +31,15 @@ impl Display for Error {
|
|||||||
use self::Error::*;
|
use self::Error::*;
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
CapabilitiesSetup(e) => write!(f, "failed to add capability {}", e),
|
CapabilitiesSetup(e) => write!(f, "failed to add capability {e}"),
|
||||||
IoAllocationFailed(size) => {
|
IoAllocationFailed(size) => {
|
||||||
write!(f, "failed to allocate space for an IO BAR, size={}", size)
|
write!(f, "failed to allocate space for an IO BAR, size={size}")
|
||||||
}
|
}
|
||||||
IoRegistrationFailed(addr, e) => {
|
IoRegistrationFailed(addr, e) => {
|
||||||
write!(f, "failed to register an IO BAR, addr={} err={}", addr, e)
|
write!(f, "failed to register an IO BAR, addr={addr} err={e}")
|
||||||
}
|
}
|
||||||
MissingResource => write!(f, "failed to find expected resource"),
|
MissingResource => write!(f, "failed to find expected resource"),
|
||||||
InvalidResource(r) => write!(f, "invalid resource {:?}", r),
|
InvalidResource(r) => write!(f, "invalid resource {r:?}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ use crate::{
|
|||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use byteorder::{ByteOrder, LittleEndian};
|
use byteorder::{ByteOrder, LittleEndian};
|
||||||
use hypervisor::HypervisorVmError;
|
use hypervisor::HypervisorVmError;
|
||||||
|
use libc::{sysconf, _SC_PAGESIZE};
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::collections::{BTreeMap, HashMap};
|
use std::collections::{BTreeMap, HashMap};
|
||||||
use std::io;
|
use std::io;
|
||||||
@@ -571,7 +572,12 @@ impl VfioCommon {
|
|||||||
PciBarRegionType::Memory64BitRegion => {
|
PciBarRegionType::Memory64BitRegion => {
|
||||||
// BAR allocation must be naturally aligned
|
// BAR allocation must be naturally aligned
|
||||||
mmio_allocator
|
mmio_allocator
|
||||||
.allocate(restored_bar_addr, region_size, Some(region_size))
|
.allocate(
|
||||||
|
restored_bar_addr,
|
||||||
|
region_size,
|
||||||
|
// SAFETY: FFI call. Trivially safe.
|
||||||
|
Some(unsafe { sysconf(_SC_PAGESIZE) as GuestUsize }),
|
||||||
|
)
|
||||||
.ok_or(PciDeviceError::IoAllocationFailed(region_size))?
|
.ok_or(PciDeviceError::IoAllocationFailed(region_size))?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1278,8 +1284,10 @@ impl VfioPciDevice {
|
|||||||
self.iommu_attached
|
self.iommu_attached
|
||||||
}
|
}
|
||||||
|
|
||||||
fn align_4k(address: u64) -> u64 {
|
fn align_page_size(address: u64) -> u64 {
|
||||||
(address + 0xfff) & 0xffff_ffff_ffff_f000
|
// SAFETY: FFI call. Trivially safe.
|
||||||
|
let page_size = unsafe { sysconf(_SC_PAGESIZE) as u64 };
|
||||||
|
(address + page_size - 1) & !(page_size - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_4k_aligned(address: u64) -> bool {
|
fn is_4k_aligned(address: u64) -> bool {
|
||||||
@@ -1339,6 +1347,7 @@ impl VfioPciDevice {
|
|||||||
let mut sparse_areas = Vec::new();
|
let mut sparse_areas = Vec::new();
|
||||||
let mut current_offset = 0;
|
let mut current_offset = 0;
|
||||||
for (range_offset, range_size) in inter_ranges {
|
for (range_offset, range_size) in inter_ranges {
|
||||||
|
let range_offset = Self::align_page_size(range_offset);
|
||||||
if range_offset > current_offset {
|
if range_offset > current_offset {
|
||||||
sparse_areas.push(VfioRegionSparseMmapArea {
|
sparse_areas.push(VfioRegionSparseMmapArea {
|
||||||
offset: current_offset,
|
offset: current_offset,
|
||||||
@@ -1346,13 +1355,13 @@ impl VfioPciDevice {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
current_offset = Self::align_4k(range_offset + range_size);
|
current_offset = Self::align_page_size(range_offset + range_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if region_size > current_offset {
|
if region_size > current_offset {
|
||||||
sparse_areas.push(VfioRegionSparseMmapArea {
|
sparse_areas.push(VfioRegionSparseMmapArea {
|
||||||
offset: current_offset,
|
offset: Self::align_page_size(current_offset),
|
||||||
size: region_size - current_offset,
|
size: Self::align_page_size(region_size - current_offset),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -617,13 +617,13 @@ impl<M: GuestAddressSpace + Sync + Send> ExternalDmaMapping for VfioUserDmaMappi
|
|||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
std::io::Error::new(
|
std::io::Error::new(
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
format!("Error mapping region: {}", e),
|
format!("Error mapping region: {e}"),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Err(std::io::Error::new(
|
Err(std::io::Error::new(
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
format!("Region not found for 0x{:x}", gpa),
|
format!("Region not found for 0x{gpa:x}"),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -636,7 +636,7 @@ impl<M: GuestAddressSpace + Sync + Send> ExternalDmaMapping for VfioUserDmaMappi
|
|||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
std::io::Error::new(
|
std::io::Error::new(
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
format!("Error unmapping region: {}", e),
|
format!("Error unmapping region: {e}"),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ edition = "2021"
|
|||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.0.18", features = ["wrap_help","cargo"] }
|
clap = { version = "4.0.29", features = ["wrap_help","cargo"] }
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
serde = { version = "1.0.147", features = ["rc", "derive"] }
|
serde = { version = "1.0.150", features = ["rc", "derive"] }
|
||||||
serde_json = "1.0.87"
|
serde_json = "1.0.89"
|
||||||
test_infra = { path = "../test_infra" }
|
test_infra = { path = "../test_infra" }
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
wait-timeout = "0.2.0"
|
wait-timeout = "0.2.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
clap = { version = "4.0.18", features = ["cargo"] }
|
clap = { version = "4.0.29", features = ["cargo"] }
|
||||||
|
|||||||
@@ -22,5 +22,5 @@ fn main() {
|
|||||||
// variable GIT_HUMAN_READABLE, so that it can be reused from the binary.
|
// variable GIT_HUMAN_READABLE, so that it can be reused from the binary.
|
||||||
// Particularly, this is used from the main.rs to display the exact
|
// Particularly, this is used from the main.rs to display the exact
|
||||||
// version information.
|
// version information.
|
||||||
println!("cargo:rustc-env=GIT_HUMAN_READABLE={}", git_human_readable);
|
println!("cargo:rustc-env=GIT_HUMAN_READABLE={git_human_readable}");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ pub struct PerformanceTestOverrides {
|
|||||||
impl fmt::Display for PerformanceTestOverrides {
|
impl fmt::Display for PerformanceTestOverrides {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
if let Some(test_iterations) = self.test_iterations {
|
if let Some(test_iterations) = self.test_iterations {
|
||||||
write!(f, "test_iterations = {}", test_iterations)?;
|
write!(f, "test_iterations = {test_iterations}")?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -141,19 +141,19 @@ impl fmt::Display for PerformanceTestControl {
|
|||||||
self.test_timeout, self.test_iterations
|
self.test_timeout, self.test_iterations
|
||||||
);
|
);
|
||||||
if let Some(o) = self.num_queues {
|
if let Some(o) = self.num_queues {
|
||||||
output = format!("{}, num_queues = {}", output, o);
|
output = format!("{output}, num_queues = {o}");
|
||||||
}
|
}
|
||||||
if let Some(o) = self.queue_size {
|
if let Some(o) = self.queue_size {
|
||||||
output = format!("{}, queue_size = {}", output, o);
|
output = format!("{output}, queue_size = {o}");
|
||||||
}
|
}
|
||||||
if let Some(o) = self.net_rx {
|
if let Some(o) = self.net_rx {
|
||||||
output = format!("{}, net_rx = {}", output, o);
|
output = format!("{output}, net_rx = {o}");
|
||||||
}
|
}
|
||||||
if let Some(o) = &self.fio_ops {
|
if let Some(o) = &self.fio_ops {
|
||||||
output = format!("{}, fio_ops = {}", output, o);
|
output = format!("{output}, fio_ops = {o}");
|
||||||
}
|
}
|
||||||
|
|
||||||
write!(f, "{}", output)
|
write!(f, "{output}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -569,7 +569,7 @@ fn main() {
|
|||||||
metrics_report.results.push(r);
|
metrics_report.results.push(r);
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("Aborting test due to error: '{:?}'", e);
|
eprintln!("Aborting test due to error: '{e:?}'");
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -583,7 +583,7 @@ fn main() {
|
|||||||
Box::new(
|
Box::new(
|
||||||
std::fs::File::create(std::path::Path::new(file))
|
std::fs::File::create(std::path::Path::new(file))
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
eprintln!("Error opening report file: {}: {}", file, e);
|
eprintln!("Error opening report file: {file}: {e}");
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
})
|
})
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
@@ -599,7 +599,7 @@ fn main() {
|
|||||||
.as_bytes(),
|
.as_bytes(),
|
||||||
)
|
)
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
eprintln!("Error writing report file: {}", e);
|
eprintln!("Error writing report file: {e}");
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ pub fn init_tests() {
|
|||||||
// The test image can not be created on tmpfs (e.g. /tmp) filesystem,
|
// The test image can not be created on tmpfs (e.g. /tmp) filesystem,
|
||||||
// as tmpfs does not support O_DIRECT
|
// as tmpfs does not support O_DIRECT
|
||||||
assert!(exec_host_command_output(&format!(
|
assert!(exec_host_command_output(&format!(
|
||||||
"dd if=/dev/zero of={} bs=1M count=4096",
|
"dd if=/dev/zero of={BLK_IO_TEST_IMG} bs=1M count=4096"
|
||||||
BLK_IO_TEST_IMG
|
|
||||||
))
|
))
|
||||||
.status
|
.status
|
||||||
.success());
|
.success());
|
||||||
@@ -46,7 +45,7 @@ pub fn init_tests() {
|
|||||||
|
|
||||||
pub fn cleanup_tests() {
|
pub fn cleanup_tests() {
|
||||||
fs::remove_file(BLK_IO_TEST_IMG)
|
fs::remove_file(BLK_IO_TEST_IMG)
|
||||||
.unwrap_or_else(|_| panic!("Failed to remove file '{}'.", BLK_IO_TEST_IMG));
|
.unwrap_or_else(|_| panic!("Failed to remove file '{BLK_IO_TEST_IMG}'."));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Performance tests are expected to be executed sequentially, so we can
|
// Performance tests are expected to be executed sequentially, so we can
|
||||||
@@ -92,7 +91,7 @@ pub fn performance_net_throughput(control: &PerformanceTestControl) -> f64 {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let mut child = GuestCommand::new(&guest)
|
let mut child = GuestCommand::new(&guest)
|
||||||
.args(["--cpus", &format!("boot={}", num_queues)])
|
.args(["--cpus", &format!("boot={num_queues}")])
|
||||||
.args(["--memory", "size=4G"])
|
.args(["--memory", "size=4G"])
|
||||||
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
||||||
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
||||||
@@ -133,7 +132,7 @@ pub fn performance_net_latency(control: &PerformanceTestControl) -> f64 {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let mut child = GuestCommand::new(&guest)
|
let mut child = GuestCommand::new(&guest)
|
||||||
.args(["--cpus", &format!("boot={}", num_queues)])
|
.args(["--cpus", &format!("boot={num_queues}")])
|
||||||
.args(["--memory", "size=4G"])
|
.args(["--memory", "size=4G"])
|
||||||
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
||||||
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
||||||
@@ -169,7 +168,6 @@ fn parse_boot_time_output(output: &[u8]) -> Result<f64, Error> {
|
|||||||
std::panic::catch_unwind(|| {
|
std::panic::catch_unwind(|| {
|
||||||
let l: Vec<String> = String::from_utf8_lossy(output)
|
let l: Vec<String> = String::from_utf8_lossy(output)
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.filter(|l| l.contains("Debug I/O port: Kernel code"))
|
.filter(|l| l.contains("Debug I/O port: Kernel code"))
|
||||||
.map(|l| l.to_string())
|
.map(|l| l.to_string())
|
||||||
.collect();
|
.collect();
|
||||||
@@ -349,7 +347,7 @@ pub fn performance_block_io(control: &PerformanceTestControl) -> f64 {
|
|||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
let mut child = GuestCommand::new(&guest)
|
let mut child = GuestCommand::new(&guest)
|
||||||
.args(["--cpus", &format!("boot={}", num_queues)])
|
.args(["--cpus", &format!("boot={num_queues}")])
|
||||||
.args(["--memory", "size=4G"])
|
.args(["--memory", "size=4G"])
|
||||||
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
.args(["--kernel", direct_kernel_boot_path().to_str().unwrap()])
|
||||||
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
.args(["--cmdline", DIRECT_KERNEL_BOOT_CMDLINE])
|
||||||
@@ -365,7 +363,7 @@ pub fn performance_block_io(control: &PerformanceTestControl) -> f64 {
|
|||||||
guest.disk_config.disk(DiskType::CloudInit).unwrap()
|
guest.disk_config.disk(DiskType::CloudInit).unwrap()
|
||||||
)
|
)
|
||||||
.as_str(),
|
.as_str(),
|
||||||
format!("path={}", BLK_IO_TEST_IMG).as_str(),
|
format!("path={BLK_IO_TEST_IMG}").as_str(),
|
||||||
])
|
])
|
||||||
.default_net()
|
.default_net()
|
||||||
.args(["--api-socket", &api_socket])
|
.args(["--api-socket", &api_socket])
|
||||||
@@ -381,8 +379,7 @@ pub fn performance_block_io(control: &PerformanceTestControl) -> f64 {
|
|||||||
let fio_command = format!(
|
let fio_command = format!(
|
||||||
"sudo fio --filename=/dev/vdc --name=test --output-format=json \
|
"sudo fio --filename=/dev/vdc --name=test --output-format=json \
|
||||||
--direct=1 --bs=4k --ioengine=io_uring --iodepth=64 \
|
--direct=1 --bs=4k --ioengine=io_uring --iodepth=64 \
|
||||||
--rw={} --runtime={} --numjobs={}",
|
--rw={fio_ops} --runtime={test_timeout} --numjobs={num_queues}"
|
||||||
fio_ops, test_timeout, num_queues
|
|
||||||
);
|
);
|
||||||
let output = guest
|
let output = guest
|
||||||
.ssh_command(&fio_command)
|
.ssh_command(&fio_command)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ path = "src/qcow.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
remain = "0.2.5"
|
remain = "0.2.5"
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|||||||
125
qcow/src/qcow.rs
125
qcow/src/qcow.rs
@@ -80,45 +80,41 @@ impl Display for Error {
|
|||||||
match self {
|
match self {
|
||||||
BackingFilesNotSupported => write!(f, "backing files not supported"),
|
BackingFilesNotSupported => write!(f, "backing files not supported"),
|
||||||
CompressedBlocksNotSupported => write!(f, "compressed blocks not supported"),
|
CompressedBlocksNotSupported => write!(f, "compressed blocks not supported"),
|
||||||
EvictingCache(e) => write!(f, "failed to evict cache: {}", e),
|
EvictingCache(e) => write!(f, "failed to evict cache: {e}"),
|
||||||
FileTooBig(size) => write!(
|
FileTooBig(size) => write!(f, "file larger than max of {MAX_QCOW_FILE_SIZE}: {size}"),
|
||||||
f,
|
GettingFileSize(e) => write!(f, "failed to get file size: {e}"),
|
||||||
"file larger than max of {}: {}",
|
GettingRefcount(e) => write!(f, "failed to get refcount: {e}"),
|
||||||
MAX_QCOW_FILE_SIZE, size
|
|
||||||
),
|
|
||||||
GettingFileSize(e) => write!(f, "failed to get file size: {}", e),
|
|
||||||
GettingRefcount(e) => write!(f, "failed to get refcount: {}", e),
|
|
||||||
InvalidClusterIndex => write!(f, "invalid cluster index"),
|
InvalidClusterIndex => write!(f, "invalid cluster index"),
|
||||||
InvalidClusterSize => write!(f, "invalid cluster size"),
|
InvalidClusterSize => write!(f, "invalid cluster size"),
|
||||||
InvalidIndex => write!(f, "invalid index"),
|
InvalidIndex => write!(f, "invalid index"),
|
||||||
InvalidL1TableOffset => write!(f, "invalid L1 table offset"),
|
InvalidL1TableOffset => write!(f, "invalid L1 table offset"),
|
||||||
InvalidL1TableSize(size) => write!(f, "invalid L1 table size {}", size),
|
InvalidL1TableSize(size) => write!(f, "invalid L1 table size {size}"),
|
||||||
InvalidMagic => write!(f, "invalid magic"),
|
InvalidMagic => write!(f, "invalid magic"),
|
||||||
InvalidOffset(_) => write!(f, "invalid offset"),
|
InvalidOffset(_) => write!(f, "invalid offset"),
|
||||||
InvalidRefcountTableOffset => write!(f, "invalid refcount table offset"),
|
InvalidRefcountTableOffset => write!(f, "invalid refcount table offset"),
|
||||||
InvalidRefcountTableSize(size) => write!(f, "invalid refcount table size: {}", size),
|
InvalidRefcountTableSize(size) => write!(f, "invalid refcount table size: {size}"),
|
||||||
NoFreeClusters => write!(f, "no free clusters"),
|
NoFreeClusters => write!(f, "no free clusters"),
|
||||||
NoRefcountClusters => write!(f, "no refcount clusters"),
|
NoRefcountClusters => write!(f, "no refcount clusters"),
|
||||||
NotEnoughSpaceForRefcounts => write!(f, "not enough space for refcounts"),
|
NotEnoughSpaceForRefcounts => write!(f, "not enough space for refcounts"),
|
||||||
OpeningFile(e) => write!(f, "failed to open file: {}", e),
|
OpeningFile(e) => write!(f, "failed to open file: {e}"),
|
||||||
ReadingData(e) => write!(f, "failed to read data: {}", e),
|
ReadingData(e) => write!(f, "failed to read data: {e}"),
|
||||||
ReadingHeader(e) => write!(f, "failed to read header: {}", e),
|
ReadingHeader(e) => write!(f, "failed to read header: {e}"),
|
||||||
ReadingPointers(e) => write!(f, "failed to read pointers: {}", e),
|
ReadingPointers(e) => write!(f, "failed to read pointers: {e}"),
|
||||||
ReadingRefCountBlock(e) => write!(f, "failed to read ref count block: {}", e),
|
ReadingRefCountBlock(e) => write!(f, "failed to read ref count block: {e}"),
|
||||||
ReadingRefCounts(e) => write!(f, "failed to read ref counts: {}", e),
|
ReadingRefCounts(e) => write!(f, "failed to read ref counts: {e}"),
|
||||||
RebuildingRefCounts(e) => write!(f, "failed to rebuild ref counts: {}", e),
|
RebuildingRefCounts(e) => write!(f, "failed to rebuild ref counts: {e}"),
|
||||||
RefcountTableOffEnd => write!(f, "refcount table offset past file end"),
|
RefcountTableOffEnd => write!(f, "refcount table offset past file end"),
|
||||||
RefcountTableTooLarge => write!(f, "too many clusters specified for refcount table"),
|
RefcountTableTooLarge => write!(f, "too many clusters specified for refcount table"),
|
||||||
SeekingFile(e) => write!(f, "failed to seek file: {}", e),
|
SeekingFile(e) => write!(f, "failed to seek file: {e}"),
|
||||||
SettingFileSize(e) => write!(f, "failed to set file size: {}", e),
|
SettingFileSize(e) => write!(f, "failed to set file size: {e}"),
|
||||||
SettingRefcountRefcount(e) => write!(f, "failed to set refcount refcount: {}", e),
|
SettingRefcountRefcount(e) => write!(f, "failed to set refcount refcount: {e}"),
|
||||||
SizeTooSmallForNumberOfClusters => write!(f, "size too small for number of clusters"),
|
SizeTooSmallForNumberOfClusters => write!(f, "size too small for number of clusters"),
|
||||||
TooManyL1Entries(count) => write!(f, "l1 entry table too large: {}", count),
|
TooManyL1Entries(count) => write!(f, "l1 entry table too large: {count}"),
|
||||||
TooManyRefcounts(count) => write!(f, "ref count table too large: {}", count),
|
TooManyRefcounts(count) => write!(f, "ref count table too large: {count}"),
|
||||||
UnsupportedRefcountOrder => write!(f, "unsupported refcount order"),
|
UnsupportedRefcountOrder => write!(f, "unsupported refcount order"),
|
||||||
UnsupportedVersion(v) => write!(f, "unsupported version: {}", v),
|
UnsupportedVersion(v) => write!(f, "unsupported version: {v}"),
|
||||||
WritingData(e) => write!(f, "failed to write data: {}", e),
|
WritingData(e) => write!(f, "failed to write data: {e}"),
|
||||||
WritingHeader(e) => write!(f, "failed to write header: {}", e),
|
WritingHeader(e) => write!(f, "failed to write header: {e}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -190,7 +186,7 @@ pub struct QcowHeader {
|
|||||||
impl QcowHeader {
|
impl QcowHeader {
|
||||||
/// Creates a QcowHeader from a reference to a file.
|
/// Creates a QcowHeader from a reference to a file.
|
||||||
pub fn new(f: &mut RawFile) -> Result<QcowHeader> {
|
pub fn new(f: &mut RawFile) -> Result<QcowHeader> {
|
||||||
f.seek(SeekFrom::Start(0)).map_err(Error::ReadingHeader)?;
|
f.rewind().map_err(Error::ReadingHeader)?;
|
||||||
let magic = f.read_u32::<BigEndian>().map_err(Error::ReadingHeader)?;
|
let magic = f.read_u32::<BigEndian>().map_err(Error::ReadingHeader)?;
|
||||||
if magic != QCOW_MAGIC {
|
if magic != QCOW_MAGIC {
|
||||||
return Err(Error::InvalidMagic);
|
return Err(Error::InvalidMagic);
|
||||||
@@ -559,7 +555,7 @@ impl QcowFile {
|
|||||||
/// Creates a new QcowFile at the given path.
|
/// Creates a new QcowFile at the given path.
|
||||||
pub fn new(mut file: RawFile, version: u32, virtual_size: u64) -> Result<QcowFile> {
|
pub fn new(mut file: RawFile, version: u32, virtual_size: u64) -> Result<QcowFile> {
|
||||||
let header = QcowHeader::create_for_size(version, virtual_size);
|
let header = QcowHeader::create_for_size(version, virtual_size);
|
||||||
file.seek(SeekFrom::Start(0)).map_err(Error::SeekingFile)?;
|
file.rewind().map_err(Error::SeekingFile)?;
|
||||||
header.write_to(&mut file)?;
|
header.write_to(&mut file)?;
|
||||||
|
|
||||||
let mut qcow = Self::from(file)?;
|
let mut qcow = Self::from(file)?;
|
||||||
@@ -777,10 +773,8 @@ impl QcowFile {
|
|||||||
refcounts: &mut [u16],
|
refcounts: &mut [u16],
|
||||||
cluster_size: u64,
|
cluster_size: u64,
|
||||||
refblock_clusters: u64,
|
refblock_clusters: u64,
|
||||||
pointers_per_cluster: u64,
|
|
||||||
) -> Result<Vec<u64>> {
|
) -> Result<Vec<u64>> {
|
||||||
let refcount_table_entries = div_round_up_u64(refblock_clusters, pointers_per_cluster);
|
let mut ref_table = vec![0; refblock_clusters as usize];
|
||||||
let mut ref_table = vec![0; refcount_table_entries as usize];
|
|
||||||
let mut first_free_cluster: u64 = 0;
|
let mut first_free_cluster: u64 = 0;
|
||||||
for refblock_addr in &mut ref_table {
|
for refblock_addr in &mut ref_table {
|
||||||
loop {
|
loop {
|
||||||
@@ -812,10 +806,7 @@ impl QcowFile {
|
|||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
// Rewrite the header with lazy refcounts enabled while we are rebuilding the tables.
|
// Rewrite the header with lazy refcounts enabled while we are rebuilding the tables.
|
||||||
header.compatible_features |= COMPATIBLE_FEATURES_LAZY_REFCOUNTS;
|
header.compatible_features |= COMPATIBLE_FEATURES_LAZY_REFCOUNTS;
|
||||||
raw_file
|
raw_file.file_mut().rewind().map_err(Error::SeekingFile)?;
|
||||||
.file_mut()
|
|
||||||
.seek(SeekFrom::Start(0))
|
|
||||||
.map_err(Error::SeekingFile)?;
|
|
||||||
header.write_to(raw_file.file_mut())?;
|
header.write_to(raw_file.file_mut())?;
|
||||||
|
|
||||||
for (i, refblock_addr) in ref_table.iter().enumerate() {
|
for (i, refblock_addr) in ref_table.iter().enumerate() {
|
||||||
@@ -850,10 +841,7 @@ impl QcowFile {
|
|||||||
|
|
||||||
// Rewrite the header again, now with lazy refcounts disabled.
|
// Rewrite the header again, now with lazy refcounts disabled.
|
||||||
header.compatible_features &= !COMPATIBLE_FEATURES_LAZY_REFCOUNTS;
|
header.compatible_features &= !COMPATIBLE_FEATURES_LAZY_REFCOUNTS;
|
||||||
raw_file
|
raw_file.file_mut().rewind().map_err(Error::SeekingFile)?;
|
||||||
.file_mut()
|
|
||||||
.seek(SeekFrom::Start(0))
|
|
||||||
.map_err(Error::SeekingFile)?;
|
|
||||||
header.write_to(raw_file.file_mut())?;
|
header.write_to(raw_file.file_mut())?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -907,12 +895,7 @@ impl QcowFile {
|
|||||||
set_refcount_table_refcounts(&mut refcounts, header, cluster_size)?;
|
set_refcount_table_refcounts(&mut refcounts, header, cluster_size)?;
|
||||||
|
|
||||||
// Allocate clusters to store the new reference count blocks.
|
// Allocate clusters to store the new reference count blocks.
|
||||||
let ref_table = alloc_refblocks(
|
let ref_table = alloc_refblocks(&mut refcounts, cluster_size, refblock_clusters)?;
|
||||||
&mut refcounts,
|
|
||||||
cluster_size,
|
|
||||||
refblock_clusters,
|
|
||||||
pointers_per_cluster,
|
|
||||||
)?;
|
|
||||||
|
|
||||||
// Write updated reference counts and point the reftable at them.
|
// Write updated reference counts and point the reftable at them.
|
||||||
write_refblocks(
|
write_refblocks(
|
||||||
@@ -1240,7 +1223,7 @@ impl QcowFile {
|
|||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
io::Error::new(
|
io::Error::new(
|
||||||
io::ErrorKind::InvalidData,
|
io::ErrorKind::InvalidData,
|
||||||
format!("failed to get cluster refcount: {}", e),
|
format!("failed to get cluster refcount: {e}"),
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
if refcount == 0 {
|
if refcount == 0 {
|
||||||
@@ -1656,9 +1639,7 @@ where
|
|||||||
R: Read + Seek + SeekHole,
|
R: Read + Seek + SeekHole,
|
||||||
{
|
{
|
||||||
let src_size = reader.seek(SeekFrom::End(0)).map_err(Error::SeekingFile)?;
|
let src_size = reader.seek(SeekFrom::End(0)).map_err(Error::SeekingFile)?;
|
||||||
reader
|
reader.rewind().map_err(Error::SeekingFile)?;
|
||||||
.seek(SeekFrom::Start(0))
|
|
||||||
.map_err(Error::SeekingFile)?;
|
|
||||||
|
|
||||||
// Ensure the destination file is empty before writing to it.
|
// Ensure the destination file is empty before writing to it.
|
||||||
dst_file.set_len(0).map_err(Error::SettingFileSize)?;
|
dst_file.set_len(0).map_err(Error::SettingFileSize)?;
|
||||||
@@ -1700,10 +1681,8 @@ pub fn convert(mut src_file: RawFile, dst_file: RawFile, dst_type: ImageType) ->
|
|||||||
|
|
||||||
/// Detect the type of an image file by checking for a valid qcow2 header.
|
/// Detect the type of an image file by checking for a valid qcow2 header.
|
||||||
pub fn detect_image_type(file: &mut RawFile) -> Result<ImageType> {
|
pub fn detect_image_type(file: &mut RawFile) -> Result<ImageType> {
|
||||||
let orig_seek = file
|
let orig_seek = file.stream_position().map_err(Error::SeekingFile)?;
|
||||||
.seek(SeekFrom::Current(0))
|
file.rewind().map_err(Error::SeekingFile)?;
|
||||||
.map_err(Error::SeekingFile)?;
|
|
||||||
file.seek(SeekFrom::Start(0)).map_err(Error::SeekingFile)?;
|
|
||||||
let magic = file.read_u32::<BigEndian>().map_err(Error::ReadingHeader)?;
|
let magic = file.read_u32::<BigEndian>().map_err(Error::ReadingHeader)?;
|
||||||
let image_type = if magic == QCOW_MAGIC {
|
let image_type = if magic == QCOW_MAGIC {
|
||||||
ImageType::Qcow2
|
ImageType::Qcow2
|
||||||
@@ -1794,7 +1773,7 @@ mod tests {
|
|||||||
let mut disk_file: RawFile = RawFile::new(TempFile::new().unwrap().into_file(), false);
|
let mut disk_file: RawFile = RawFile::new(TempFile::new().unwrap().into_file(), false);
|
||||||
disk_file.write_all(header).unwrap();
|
disk_file.write_all(header).unwrap();
|
||||||
disk_file.set_len(0x1_0000_0000).unwrap();
|
disk_file.set_len(0x1_0000_0000).unwrap();
|
||||||
disk_file.seek(SeekFrom::Start(0)).unwrap();
|
disk_file.rewind().unwrap();
|
||||||
|
|
||||||
testfn(disk_file); // File closed when the function exits.
|
testfn(disk_file); // File closed when the function exits.
|
||||||
}
|
}
|
||||||
@@ -1816,7 +1795,7 @@ mod tests {
|
|||||||
header
|
header
|
||||||
.write_to(&mut disk_file)
|
.write_to(&mut disk_file)
|
||||||
.expect("Failed to write header to temporary file.");
|
.expect("Failed to write header to temporary file.");
|
||||||
disk_file.seek(SeekFrom::Start(0)).unwrap();
|
disk_file.rewind().unwrap();
|
||||||
QcowFile::from(disk_file).expect("Failed to create Qcow from default Header");
|
QcowFile::from(disk_file).expect("Failed to create Qcow from default Header");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1827,7 +1806,7 @@ mod tests {
|
|||||||
header
|
header
|
||||||
.write_to(&mut disk_file)
|
.write_to(&mut disk_file)
|
||||||
.expect("Failed to write header to temporary file.");
|
.expect("Failed to write header to temporary file.");
|
||||||
disk_file.seek(SeekFrom::Start(0)).unwrap();
|
disk_file.rewind().unwrap();
|
||||||
QcowFile::from(disk_file).expect("Failed to create Qcow from default Header");
|
QcowFile::from(disk_file).expect("Failed to create Qcow from default Header");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1955,7 +1934,7 @@ mod tests {
|
|||||||
q.write_all(b"test first bytes")
|
q.write_all(b"test first bytes")
|
||||||
.expect("Failed to write test string.");
|
.expect("Failed to write test string.");
|
||||||
let mut buf = [0u8; 4];
|
let mut buf = [0u8; 4];
|
||||||
q.seek(SeekFrom::Start(0)).expect("Failed to seek.");
|
q.rewind().expect("Failed to seek.");
|
||||||
q.read_exact(&mut buf).expect("Failed to read.");
|
q.read_exact(&mut buf).expect("Failed to read.");
|
||||||
assert_eq!(&buf, b"test");
|
assert_eq!(&buf, b"test");
|
||||||
});
|
});
|
||||||
@@ -2007,15 +1986,15 @@ mod tests {
|
|||||||
let mut q = QcowFile::from(disk_file).unwrap();
|
let mut q = QcowFile::from(disk_file).unwrap();
|
||||||
// Write some test data.
|
// Write some test data.
|
||||||
let b = [0x55u8; CHUNK_SIZE];
|
let b = [0x55u8; CHUNK_SIZE];
|
||||||
q.seek(SeekFrom::Start(0)).expect("Failed to seek.");
|
q.rewind().expect("Failed to seek.");
|
||||||
q.write_all(&b).expect("Failed to write test string.");
|
q.write_all(&b).expect("Failed to write test string.");
|
||||||
// Overwrite the full cluster with zeroes.
|
// Overwrite the full cluster with zeroes.
|
||||||
q.seek(SeekFrom::Start(0)).expect("Failed to seek.");
|
q.rewind().expect("Failed to seek.");
|
||||||
let nwritten = q.write_zeroes(CHUNK_SIZE).expect("Failed to write zeroes.");
|
let nwritten = q.write_zeroes(CHUNK_SIZE).expect("Failed to write zeroes.");
|
||||||
assert_eq!(nwritten, CHUNK_SIZE);
|
assert_eq!(nwritten, CHUNK_SIZE);
|
||||||
// Verify that the data was zeroed out.
|
// Verify that the data was zeroed out.
|
||||||
let mut buf = [0u8; CHUNK_SIZE];
|
let mut buf = [0u8; CHUNK_SIZE];
|
||||||
q.seek(SeekFrom::Start(0)).expect("Failed to seek.");
|
q.rewind().expect("Failed to seek.");
|
||||||
q.read_exact(&mut buf).expect("Failed to read.");
|
q.read_exact(&mut buf).expect("Failed to read.");
|
||||||
assert_eq!(buf[0], 0);
|
assert_eq!(buf[0], 0);
|
||||||
assert_eq!(buf[CHUNK_SIZE - 1], 0);
|
assert_eq!(buf[CHUNK_SIZE - 1], 0);
|
||||||
@@ -2457,7 +2436,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check that address 0 is still zeros.
|
// Check that address 0 is still zeros.
|
||||||
qcow_file.seek(SeekFrom::Start(0)).expect("Failed to seek.");
|
qcow_file.rewind().expect("Failed to seek.");
|
||||||
let nread = qcow_file.read(&mut readback).expect("Failed to read.");
|
let nread = qcow_file.read(&mut readback).expect("Failed to read.");
|
||||||
assert_eq!(nread, BLOCK_SIZE);
|
assert_eq!(nread, BLOCK_SIZE);
|
||||||
for read in readback.iter() {
|
for read in readback.iter() {
|
||||||
@@ -2481,7 +2460,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn seek_cur(file: &mut QcowFile) -> u64 {
|
fn seek_cur(file: &mut QcowFile) -> u64 {
|
||||||
file.seek(SeekFrom::Current(0)).unwrap()
|
file.stream_position().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -2545,7 +2524,7 @@ mod tests {
|
|||||||
assert_eq!(seek_cur(&mut file), 0xFFFF);
|
assert_eq!(seek_cur(&mut file), 0xFFFF);
|
||||||
|
|
||||||
// seek_hole at or after the end of the file should return None
|
// seek_hole at or after the end of the file should return None
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x30000).unwrap(), None);
|
assert_eq!(file.seek_hole(0x30000).unwrap(), None);
|
||||||
assert_eq!(seek_cur(&mut file), 0);
|
assert_eq!(seek_cur(&mut file), 0);
|
||||||
assert_eq!(file.seek_hole(0x30001).unwrap(), None);
|
assert_eq!(file.seek_hole(0x30001).unwrap(), None);
|
||||||
@@ -2563,33 +2542,33 @@ mod tests {
|
|||||||
assert_eq!(seek_cur(&mut file), 0xFFFF);
|
assert_eq!(seek_cur(&mut file), 0xFFFF);
|
||||||
|
|
||||||
// seek_hole within data should return the next hole
|
// seek_hole within data should return the next hole
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x10000).unwrap(), Some(0x20000));
|
assert_eq!(file.seek_hole(0x10000).unwrap(), Some(0x20000));
|
||||||
assert_eq!(seek_cur(&mut file), 0x20000);
|
assert_eq!(seek_cur(&mut file), 0x20000);
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x10001).unwrap(), Some(0x20000));
|
assert_eq!(file.seek_hole(0x10001).unwrap(), Some(0x20000));
|
||||||
assert_eq!(seek_cur(&mut file), 0x20000);
|
assert_eq!(seek_cur(&mut file), 0x20000);
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x1FFFF).unwrap(), Some(0x20000));
|
assert_eq!(file.seek_hole(0x1FFFF).unwrap(), Some(0x20000));
|
||||||
assert_eq!(seek_cur(&mut file), 0x20000);
|
assert_eq!(seek_cur(&mut file), 0x20000);
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0xFFFF).unwrap(), Some(0xFFFF));
|
assert_eq!(file.seek_hole(0xFFFF).unwrap(), Some(0xFFFF));
|
||||||
assert_eq!(seek_cur(&mut file), 0xFFFF);
|
assert_eq!(seek_cur(&mut file), 0xFFFF);
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x10000).unwrap(), Some(0x20000));
|
assert_eq!(file.seek_hole(0x10000).unwrap(), Some(0x20000));
|
||||||
assert_eq!(seek_cur(&mut file), 0x20000);
|
assert_eq!(seek_cur(&mut file), 0x20000);
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x1FFFF).unwrap(), Some(0x20000));
|
assert_eq!(file.seek_hole(0x1FFFF).unwrap(), Some(0x20000));
|
||||||
assert_eq!(seek_cur(&mut file), 0x20000);
|
assert_eq!(seek_cur(&mut file), 0x20000);
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x20000).unwrap(), Some(0x20000));
|
assert_eq!(file.seek_hole(0x20000).unwrap(), Some(0x20000));
|
||||||
assert_eq!(seek_cur(&mut file), 0x20000);
|
assert_eq!(seek_cur(&mut file), 0x20000);
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x20001).unwrap(), Some(0x20001));
|
assert_eq!(file.seek_hole(0x20001).unwrap(), Some(0x20001));
|
||||||
assert_eq!(seek_cur(&mut file), 0x20001);
|
assert_eq!(seek_cur(&mut file), 0x20001);
|
||||||
|
|
||||||
// seek_hole at EOF should return None
|
// seek_hole at EOF should return None
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x30000).unwrap(), None);
|
assert_eq!(file.seek_hole(0x30000).unwrap(), None);
|
||||||
assert_eq!(seek_cur(&mut file), 0);
|
assert_eq!(seek_cur(&mut file), 0);
|
||||||
|
|
||||||
@@ -2600,10 +2579,10 @@ mod tests {
|
|||||||
// seek_hole within [0x20000, 0x30000) should now find the hole at EOF
|
// seek_hole within [0x20000, 0x30000) should now find the hole at EOF
|
||||||
assert_eq!(file.seek_hole(0x20000).unwrap(), Some(0x30000));
|
assert_eq!(file.seek_hole(0x20000).unwrap(), Some(0x30000));
|
||||||
assert_eq!(seek_cur(&mut file), 0x30000);
|
assert_eq!(seek_cur(&mut file), 0x30000);
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x20001).unwrap(), Some(0x30000));
|
assert_eq!(file.seek_hole(0x20001).unwrap(), Some(0x30000));
|
||||||
assert_eq!(seek_cur(&mut file), 0x30000);
|
assert_eq!(seek_cur(&mut file), 0x30000);
|
||||||
file.seek(SeekFrom::Start(0)).unwrap();
|
file.rewind().unwrap();
|
||||||
assert_eq!(file.seek_hole(0x30000).unwrap(), None);
|
assert_eq!(file.seek_hole(0x30000).unwrap(), None);
|
||||||
assert_eq!(seek_cur(&mut file), 0);
|
assert_eq!(seek_cur(&mut file), 0);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ impl QcowRawFile {
|
|||||||
non_zero_flags: u64,
|
non_zero_flags: u64,
|
||||||
) -> io::Result<()> {
|
) -> io::Result<()> {
|
||||||
self.file.seek(SeekFrom::Start(offset))?;
|
self.file.seek(SeekFrom::Start(offset))?;
|
||||||
let mut buffer = BufWriter::with_capacity(table.len() * size_of::<u64>(), &mut self.file);
|
let mut buffer = BufWriter::with_capacity(std::mem::size_of_val(table), &mut self.file);
|
||||||
for addr in table {
|
for addr in table {
|
||||||
let val = if *addr == 0 {
|
let val = if *addr == 0 {
|
||||||
0
|
0
|
||||||
@@ -91,7 +91,7 @@ impl QcowRawFile {
|
|||||||
/// Writes a refcount block to the file.
|
/// Writes a refcount block to the file.
|
||||||
pub fn write_refcount_block(&mut self, offset: u64, table: &[u16]) -> io::Result<()> {
|
pub fn write_refcount_block(&mut self, offset: u64, table: &[u16]) -> io::Result<()> {
|
||||||
self.file.seek(SeekFrom::Start(offset))?;
|
self.file.seek(SeekFrom::Start(offset))?;
|
||||||
let mut buffer = BufWriter::with_capacity(table.len() * size_of::<u16>(), &mut self.file);
|
let mut buffer = BufWriter::with_capacity(std::mem::size_of_val(table), &mut self.file);
|
||||||
for count in table {
|
for count in table {
|
||||||
buffer.write_u16::<BigEndian>(*count)?;
|
buffer.write_u16::<BigEndian>(*count)?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,16 +31,14 @@ impl Display for Error {
|
|||||||
use self::Error::*;
|
use self::Error::*;
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
EvictingRefCounts(e) => write!(
|
EvictingRefCounts(e) => {
|
||||||
f,
|
write!(f, "failed to write a refblock from the cache to disk: {e}")
|
||||||
"failed to write a refblock from the cache to disk: {}",
|
}
|
||||||
e
|
|
||||||
),
|
|
||||||
InvalidIndex => write!(f, "address requested is not within the range of the disk"),
|
InvalidIndex => write!(f, "address requested is not within the range of the disk"),
|
||||||
NeedCluster(addr) => write!(f, "cluster with addr={} needs to be read", addr),
|
NeedCluster(addr) => write!(f, "cluster with addr={addr} needs to be read"),
|
||||||
NeedNewCluster => write!(f, "new cluster needs to be allocated for refcounts"),
|
NeedNewCluster => write!(f, "new cluster needs to be allocated for refcounts"),
|
||||||
ReadingRefCounts(e) => {
|
ReadingRefCounts(e) => {
|
||||||
write!(f, "failed to read the file into the refcount cache: {}", e)
|
write!(f, "failed to read the file into the refcount cache: {e}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ version = "0.1.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|||||||
@@ -888,7 +888,7 @@ pub(crate) mod tests {
|
|||||||
fn test_rate_limiter_debug() {
|
fn test_rate_limiter_debug() {
|
||||||
let l = RateLimiter::new(1, 2, 3, 4, 5, 6).unwrap();
|
let l = RateLimiter::new(1, 2, 3, 4, 5, 6).unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
format!("{:?}", l),
|
format!("{l:?}"),
|
||||||
format!(
|
format!(
|
||||||
"RateLimiter {{ bandwidth: {:?}, ops: {:?} }}",
|
"RateLimiter {{ bandwidth: {:?}, ops: {:?} }}",
|
||||||
l.bandwidth(),
|
l.bandwidth(),
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
- [v28.4](#v284)
|
||||||
|
- [v28.3](#v283)
|
||||||
|
- [v28.2](#v282)
|
||||||
|
- [v28.1](#v281)
|
||||||
- [v28.0](#v280)
|
- [v28.0](#v280)
|
||||||
- [Community Engagement (Reminder)](#community-engagement-reminder)
|
- [Community Engagement (Reminder)](#community-engagement-reminder)
|
||||||
- [Long Term Support (LTS) Release](#long-term-support-lts-release)
|
- [Long Term Support (LTS) Release](#long-term-support-lts-release)
|
||||||
@@ -247,6 +251,54 @@
|
|||||||
- [Unit testing](#unit-testing)
|
- [Unit testing](#unit-testing)
|
||||||
- [Integration tests parallelization](#integration-tests-parallelization)
|
- [Integration tests parallelization](#integration-tests-parallelization)
|
||||||
|
|
||||||
|
|
||||||
|
# v28.4
|
||||||
|
|
||||||
|
This is a bug fix release. The following issues have been addressed:
|
||||||
|
|
||||||
|
* Fix VFIO on platforms with non-4k page size (#5450)
|
||||||
|
* Fix seccomp filter lists related to virtio-console, serial and pty
|
||||||
|
(#5506, #5524)
|
||||||
|
* Populate APIC ID properly (#5512)
|
||||||
|
* Ignore and warn TAP FDs in more situations (#5522)
|
||||||
|
* Disallow concurrent CPU resizing (#5668)
|
||||||
|
* Use wrapping add for memory offset from instruction emulator (#5719)
|
||||||
|
* Replace unsound `static mut` with `once_cell` (#5772)
|
||||||
|
* Fix a deadlock when TDX is enabled (#5845)
|
||||||
|
* Bug fix to OpenAPI specification file (#5967)
|
||||||
|
* Error out early for live migration when TDX is enabled (#6025)
|
||||||
|
|
||||||
|
# v28.3
|
||||||
|
|
||||||
|
This is a bug fix release. The following issues have been addressed:
|
||||||
|
|
||||||
|
* Ignore and warn TAP FDs sent via the HTTP request body (#5350)
|
||||||
|
* Properly preserve and close valid FDs for TAP devices (#5373)
|
||||||
|
* Only use `KVM_ARM_VCPU_PMU_V3` if available (#5360)
|
||||||
|
* Fix seccomp filter lists for vhost-user devices (#5361)
|
||||||
|
* Fix the offset setting while removing the entire mapping of
|
||||||
|
`vhost-user` FS client (#5235)
|
||||||
|
* Set vcpu thread status properly and signal exit_evt upon thread exit (#5211)
|
||||||
|
* Populate CPUID leaf 0x4000_0010 (TSC frequency) (#5179)
|
||||||
|
* Bug fix to OpenAPI specification file (#5186)
|
||||||
|
|
||||||
|
# v28.2
|
||||||
|
This is a bug fix release. The following issues have been addressed:
|
||||||
|
|
||||||
|
* Fix QCOW2 refcount table size (#5034)
|
||||||
|
* Fix unpause support on MSHV in dual binary (#5037)
|
||||||
|
* Threads inside `virtio` devices are now shutdown on reboot (#5095)
|
||||||
|
|
||||||
|
# v28.1
|
||||||
|
This is a bug fix release. The following issues have been addressed:
|
||||||
|
|
||||||
|
* Update dependencies including a version of `linux-loader` that
|
||||||
|
addresses an infinite loop issue ([details](https://github.com/rust-vmm/linux-loader/security/advisories/GHSA-52h2-m2cf-9jh6))
|
||||||
|
* Fix bugs related to `virtio-net` including an integer overflow issue
|
||||||
|
(#4924, #4949)
|
||||||
|
* Use host `cpuid` information for L2 cache for older KVM on x86 (#4920)
|
||||||
|
* Improve README and documentation
|
||||||
|
|
||||||
# v28.0
|
# v28.0
|
||||||
|
|
||||||
This release has been tracked in our new [roadmap
|
This release has been tracked in our new [roadmap
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# When changing this file don't forget to update the tag name in the
|
# When changing this file don't forget to update the tag name in the
|
||||||
# .github/workflows/docker-image.yaml file if doing multiple per day
|
# .github/workflows/docker-image.yaml file if doing multiple per day
|
||||||
|
|
||||||
FROM ubuntu:20.04 as dev
|
FROM ubuntu:22.04 as dev
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG RUST_TOOLCHAIN="1.62.0"
|
ARG RUST_TOOLCHAIN="1.65.0"
|
||||||
ARG CLH_SRC_DIR="/cloud-hypervisor"
|
ARG CLH_SRC_DIR="/cloud-hypervisor"
|
||||||
ARG CLH_BUILD_DIR="$CLH_SRC_DIR/build"
|
ARG CLH_BUILD_DIR="$CLH_SRC_DIR/build"
|
||||||
ARG CARGO_REGISTRY_DIR="$CLH_BUILD_DIR/cargo_registry"
|
ARG CARGO_REGISTRY_DIR="$CLH_BUILD_DIR/cargo_registry"
|
||||||
@@ -16,40 +16,43 @@ ENV PATH="$PATH:$CARGO_HOME/bin"
|
|||||||
|
|
||||||
# Install all CI dependencies
|
# Install all CI dependencies
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get -yq upgrade \
|
&& apt-get -yq upgrade \
|
||||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq \
|
&& apt-get install --no-install-recommends -yq \
|
||||||
build-essential \
|
build-essential \
|
||||||
bc \
|
bc \
|
||||||
curl \
|
curl \
|
||||||
wget \
|
wget \
|
||||||
sudo \
|
sudo \
|
||||||
mtools \
|
mtools \
|
||||||
musl-tools \
|
musl-tools \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
flex \
|
flex \
|
||||||
bison \
|
bison \
|
||||||
libelf-dev \
|
libelf-dev \
|
||||||
qemu-utils \
|
qemu-utils \
|
||||||
libglib2.0-dev \
|
libglib2.0-dev \
|
||||||
libpixman-1-dev \
|
libpixman-1-dev \
|
||||||
libseccomp-dev \
|
libseccomp-dev \
|
||||||
libcap-ng-dev \
|
libcap-ng-dev \
|
||||||
socat \
|
socat \
|
||||||
dosfstools \
|
dosfstools \
|
||||||
cpio \
|
cpio \
|
||||||
python \
|
python3 \
|
||||||
python3 \
|
python3-setuptools \
|
||||||
python3-setuptools \
|
ntfs-3g \
|
||||||
ntfs-3g \
|
python3-distutils \
|
||||||
openvswitch-switch-dpdk \
|
uuid-dev \
|
||||||
python3-distutils \
|
iperf3 \
|
||||||
uuid-dev \
|
zip \
|
||||||
iperf3 \
|
git-core \
|
||||||
zip \
|
dnsmasq \
|
||||||
git-core \
|
dmsetup \
|
||||||
dnsmasq \
|
ca-certificates \
|
||||||
dmsetup \
|
unzip \
|
||||||
|
iproute2 \
|
||||||
|
dbus \
|
||||||
|
&& apt-get install openvswitch-switch-dpdk -yq \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
@@ -112,17 +115,18 @@ RUN echo 'source $CARGO_HOME/env' >> $HOME/.bashrc \
|
|||||||
RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
||||||
git clone https://github.com/spdk/spdk \
|
git clone https://github.com/spdk/spdk \
|
||||||
&& cd spdk \
|
&& cd spdk \
|
||||||
&& git checkout 6301f8915de32baed10dba1eebed556a6749211a \
|
&& git checkout ef8bcce58f3f02b79c0619a297e4f17e81e62b24 \
|
||||||
&& git submodule update --init \
|
&& git submodule update --init \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& ./scripts/pkgdep.sh \
|
&& ./scripts/pkgdep.sh \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& ./configure --with-vfio-user \
|
&& ./configure --with-vfio-user \
|
||||||
&& make -j `nproc` \
|
&& make -j $(nproc) TARGET_ARCHITECTURE=skylake \
|
||||||
|
&& rm -rf /usr/local/bin/spdk-nvme \
|
||||||
&& mkdir /usr/local/bin/spdk-nvme \
|
&& mkdir /usr/local/bin/spdk-nvme \
|
||||||
&& cp ./build/bin/nvmf_tgt /usr/local/bin/spdk-nvme \
|
&& cp -f ./build/bin/nvmf_tgt /usr/local/bin/spdk-nvme \
|
||||||
&& cp ./scripts/rpc.py /usr/local/bin/spdk-nvme \
|
&& cp -f ./scripts/rpc.py /usr/local/bin/spdk-nvme \
|
||||||
&& cp -r ./scripts/rpc /usr/local/bin/spdk-nvme \
|
&& cp -rf ./python /usr/local/bin \
|
||||||
&& cd .. && rm -rf spdk; fi
|
&& cd .. && rm -rf spdk; fi
|
||||||
|
|
||||||
# install ethr tool for performance tests
|
# install ethr tool for performance tests
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export BUILD_TARGET=${BUILD_TARGET-aarch64-unknown-linux-gnu}
|
|
||||||
|
|
||||||
WORKLOADS_DIR="$HOME/workloads"
|
WORKLOADS_DIR="$HOME/workloads"
|
||||||
|
|
||||||
mkdir -p "$WORKLOADS_DIR"
|
mkdir -p "$WORKLOADS_DIR"
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
|
|
||||||
CLI_NAME="Cloud Hypervisor"
|
CLI_NAME="Cloud Hypervisor"
|
||||||
|
|
||||||
CTR_IMAGE_TAG="cloudhypervisor/dev"
|
CTR_IMAGE_TAG="ghcr.io/cloud-hypervisor/cloud-hypervisor"
|
||||||
CTR_IMAGE_VERSION="20220705-0"
|
CTR_IMAGE_VERSION="20231220-0"
|
||||||
CTR_IMAGE="${CTR_IMAGE_TAG}:${CTR_IMAGE_VERSION}"
|
: "${CTR_IMAGE:=${CTR_IMAGE_TAG}:${CTR_IMAGE_VERSION}}"
|
||||||
|
|
||||||
DOCKER_RUNTIME="docker"
|
DOCKER_RUNTIME="docker"
|
||||||
|
|
||||||
@@ -277,11 +277,10 @@ cmd_build() {
|
|||||||
[ $build = "release" ] && cargo_args+=("--release")
|
[ $build = "release" ] && cargo_args+=("--release")
|
||||||
cargo_args+=(--target "$target")
|
cargo_args+=(--target "$target")
|
||||||
|
|
||||||
rustflags=""
|
rustflags="$RUSTFLAGS"
|
||||||
target_cc=""
|
target_cc=""
|
||||||
if [ "$(uname -m)" = "aarch64" ] && [ "$libc" = "musl" ]; then
|
if [ "$(uname -m)" = "aarch64" ] && [ "$libc" = "musl" ]; then
|
||||||
rustflags="-C link-arg=-lgcc -C link_arg=-specs -C link_arg=/usr/lib/aarch64-linux-musl/musl-gcc.specs"
|
rustflags="$rustflags -C link-args=-Wl,-Bstatic -C link-args=-lc"
|
||||||
target_cc="musl-gcc"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$DOCKER_RUNTIME run \
|
$DOCKER_RUNTIME run \
|
||||||
@@ -387,6 +386,12 @@ cmd_tests() {
|
|||||||
process_volumes_args
|
process_volumes_args
|
||||||
target="$(uname -m)-unknown-linux-${libc}"
|
target="$(uname -m)-unknown-linux-${libc}"
|
||||||
|
|
||||||
|
rustflags="$RUSTFLAGS"
|
||||||
|
target_cc=""
|
||||||
|
if [ "$(uname -m)" = "aarch64" ] && [ "$libc" = "musl" ]; then
|
||||||
|
rustflags="$rustflags -C link-args=-Wl,-Bstatic -C link-args=-lc"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$unit" = true ]]; then
|
if [[ "$unit" = true ]]; then
|
||||||
say "Running unit tests for $target..."
|
say "Running unit tests for $target..."
|
||||||
$DOCKER_RUNTIME run \
|
$DOCKER_RUNTIME run \
|
||||||
@@ -397,6 +402,8 @@ cmd_tests() {
|
|||||||
--cap-add net_admin \
|
--cap-add net_admin \
|
||||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
||||||
--env BUILD_TARGET="$target" \
|
--env BUILD_TARGET="$target" \
|
||||||
|
--env RUSTFLAGS="$rustflags" \
|
||||||
|
--env TARGET_CC="$target_cc" \
|
||||||
"$CTR_IMAGE" \
|
"$CTR_IMAGE" \
|
||||||
./scripts/run_unit_tests.sh "$@" || fix_dir_perms $? || exit $?
|
./scripts/run_unit_tests.sh "$@" || fix_dir_perms $? || exit $?
|
||||||
fi
|
fi
|
||||||
@@ -415,7 +422,9 @@ cmd_tests() {
|
|||||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
||||||
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
||||||
--env USER="root" \
|
--env USER="root" \
|
||||||
--env CH_LIBC="${libc}" \
|
--env BUILD_TARGET="$target" \
|
||||||
|
--env RUSTFLAGS="$rustflags" \
|
||||||
|
--env TARGET_CC="$target_cc" \
|
||||||
"$CTR_IMAGE" \
|
"$CTR_IMAGE" \
|
||||||
./scripts/run_integration_tests_"$(uname -m)".sh "$@" || fix_dir_perms $? || exit $?
|
./scripts/run_integration_tests_"$(uname -m)".sh "$@" || fix_dir_perms $? || exit $?
|
||||||
fi
|
fi
|
||||||
@@ -434,7 +443,9 @@ cmd_tests() {
|
|||||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
||||||
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
||||||
--env USER="root" \
|
--env USER="root" \
|
||||||
--env CH_LIBC="${libc}" \
|
--env BUILD_TARGET="$target" \
|
||||||
|
--env RUSTFLAGS="$rustflags" \
|
||||||
|
--env TARGET_CC="$target_cc" \
|
||||||
"$CTR_IMAGE" \
|
"$CTR_IMAGE" \
|
||||||
./scripts/run_integration_tests_sgx.sh "$@" || fix_dir_perms $? || exit $?
|
./scripts/run_integration_tests_sgx.sh "$@" || fix_dir_perms $? || exit $?
|
||||||
fi
|
fi
|
||||||
@@ -453,7 +464,9 @@ cmd_tests() {
|
|||||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
||||||
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
||||||
--env USER="root" \
|
--env USER="root" \
|
||||||
--env CH_LIBC="${libc}" \
|
--env BUILD_TARGET="$target" \
|
||||||
|
--env RUSTFLAGS="$rustflags" \
|
||||||
|
--env TARGET_CC="$target_cc" \
|
||||||
"$CTR_IMAGE" \
|
"$CTR_IMAGE" \
|
||||||
./scripts/run_integration_tests_vfio.sh "$@" || fix_dir_perms $? || exit $?
|
./scripts/run_integration_tests_vfio.sh "$@" || fix_dir_perms $? || exit $?
|
||||||
fi
|
fi
|
||||||
@@ -472,7 +485,9 @@ cmd_tests() {
|
|||||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
||||||
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
||||||
--env USER="root" \
|
--env USER="root" \
|
||||||
--env CH_LIBC="${libc}" \
|
--env BUILD_TARGET="$target" \
|
||||||
|
--env RUSTFLAGS="$rustflags" \
|
||||||
|
--env TARGET_CC="$target_cc" \
|
||||||
"$CTR_IMAGE" \
|
"$CTR_IMAGE" \
|
||||||
./scripts/run_integration_tests_windows_"$(uname -m)".sh "$@" || fix_dir_perms $? || exit $?
|
./scripts/run_integration_tests_windows_"$(uname -m)".sh "$@" || fix_dir_perms $? || exit $?
|
||||||
fi
|
fi
|
||||||
@@ -491,7 +506,9 @@ cmd_tests() {
|
|||||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
||||||
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
||||||
--env USER="root" \
|
--env USER="root" \
|
||||||
--env CH_LIBC="${libc}" \
|
--env BUILD_TARGET="$target" \
|
||||||
|
--env RUSTFLAGS="$rustflags" \
|
||||||
|
--env TARGET_CC="$target_cc" \
|
||||||
"$CTR_IMAGE" \
|
"$CTR_IMAGE" \
|
||||||
./scripts/run_integration_tests_live_migration.sh "$@" || fix_dir_perms $? || exit $?
|
./scripts/run_integration_tests_live_migration.sh "$@" || fix_dir_perms $? || exit $?
|
||||||
fi
|
fi
|
||||||
@@ -510,7 +527,9 @@ cmd_tests() {
|
|||||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
||||||
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
||||||
--env USER="root" \
|
--env USER="root" \
|
||||||
--env CH_LIBC="${libc}" \
|
--env BUILD_TARGET="$target" \
|
||||||
|
--env RUSTFLAGS="$rustflags" \
|
||||||
|
--env TARGET_CC="$target_cc" \
|
||||||
"$CTR_IMAGE" \
|
"$CTR_IMAGE" \
|
||||||
./scripts/run_integration_tests_rate_limiter.sh "$@" || fix_dir_perms $? || exit $?
|
./scripts/run_integration_tests_rate_limiter.sh "$@" || fix_dir_perms $? || exit $?
|
||||||
fi
|
fi
|
||||||
@@ -529,7 +548,10 @@ cmd_tests() {
|
|||||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" $exported_volumes \
|
||||||
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
--volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \
|
||||||
--env USER="root" \
|
--env USER="root" \
|
||||||
--env CH_LIBC="${libc}" \
|
--env BUILD_TARGET="$target" \
|
||||||
|
--env RUSTFLAGS="$rustflags" \
|
||||||
|
--env TARGET_CC="$target_cc" \
|
||||||
|
--env RUST_BACKTRACE="${RUST_BACKTRACE}" \
|
||||||
"$CTR_IMAGE" \
|
"$CTR_IMAGE" \
|
||||||
./scripts/run_metrics.sh "$@" || fix_dir_perms $? || exit $?
|
./scripts/run_metrics.sh "$@" || fix_dir_perms $? || exit $?
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -11,15 +11,16 @@ build_spdk_nvme() {
|
|||||||
SPDK_DIR="$WORKLOADS_DIR/spdk"
|
SPDK_DIR="$WORKLOADS_DIR/spdk"
|
||||||
SPDK_REPO="https://github.com/spdk/spdk.git"
|
SPDK_REPO="https://github.com/spdk/spdk.git"
|
||||||
SPDK_DEPLOY_DIR="/usr/local/bin/spdk-nvme"
|
SPDK_DEPLOY_DIR="/usr/local/bin/spdk-nvme"
|
||||||
checkout_repo "$SPDK_DIR" "$SPDK_REPO" master "6301f8915de32baed10dba1eebed556a6749211a"
|
checkout_repo "$SPDK_DIR" "$SPDK_REPO" master "ef8bcce58f3f02b79c0619a297e4f17e81e62b24"
|
||||||
|
|
||||||
if [ ! -f "$SPDK_DIR/.built" ]; then
|
if [ ! -f "$SPDK_DIR/.built" ]; then
|
||||||
pushd $SPDK_DIR
|
pushd $SPDK_DIR
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
apt-get update
|
apt-get update
|
||||||
|
sed -i "/grpcio/d" scripts/pkgdep/debian.sh
|
||||||
./scripts/pkgdep.sh
|
./scripts/pkgdep.sh
|
||||||
./configure --with-vfio-user
|
./configure --with-vfio-user
|
||||||
chmod +x /usr/local/lib/python3.8/dist-packages/ninja/data/bin/ninja
|
chmod +x /usr/local/lib/python3.10/dist-packages/ninja/data/bin/ninja
|
||||||
make -j `nproc` || exit 1
|
make -j `nproc` || exit 1
|
||||||
touch .built
|
touch .built
|
||||||
popd
|
popd
|
||||||
@@ -29,14 +30,15 @@ build_spdk_nvme() {
|
|||||||
fi
|
fi
|
||||||
cp "$WORKLOADS_DIR/spdk/build/bin/nvmf_tgt" $SPDK_DEPLOY_DIR/nvmf_tgt
|
cp "$WORKLOADS_DIR/spdk/build/bin/nvmf_tgt" $SPDK_DEPLOY_DIR/nvmf_tgt
|
||||||
cp "$WORKLOADS_DIR/spdk/scripts/rpc.py" $SPDK_DEPLOY_DIR/rpc.py
|
cp "$WORKLOADS_DIR/spdk/scripts/rpc.py" $SPDK_DEPLOY_DIR/rpc.py
|
||||||
cp -r "$WORKLOADS_DIR/spdk/scripts/rpc" $SPDK_DEPLOY_DIR/rpc
|
cp -r "$WORKLOADS_DIR/spdk/python/spdk/" $SPDK_DEPLOY_DIR/
|
||||||
|
cp -r "$WORKLOADS_DIR/spdk/python" $SPDK_DEPLOY_DIR/../
|
||||||
}
|
}
|
||||||
|
|
||||||
build_virtiofsd() {
|
build_virtiofsd() {
|
||||||
VIRTIOFSD_DIR="$WORKLOADS_DIR/virtiofsd_build"
|
VIRTIOFSD_DIR="$WORKLOADS_DIR/virtiofsd_build"
|
||||||
VIRTIOFSD_REPO="https://gitlab.com/virtio-fs/virtiofsd.git"
|
VIRTIOFSD_REPO="https://gitlab.com/virtio-fs/virtiofsd.git"
|
||||||
|
|
||||||
checkout_repo "$VIRTIOFSD_DIR" "$VIRTIOFSD_REPO" v1.1.0 "220405d7a2606c92636d31992b5cb3036a41047b"
|
checkout_repo "$VIRTIOFSD_DIR" "$VIRTIOFSD_REPO" v1.8.0 "97ea7908fe7f9bc59916671a771bdcfaf4044b45"
|
||||||
|
|
||||||
if [ ! -f "$VIRTIOFSD_DIR/.built" ]; then
|
if [ ! -f "$VIRTIOFSD_DIR/.built" ]; then
|
||||||
pushd $VIRTIOFSD_DIR
|
pushd $VIRTIOFSD_DIR
|
||||||
@@ -152,8 +154,21 @@ update_workloads() {
|
|||||||
CH_RELEASE_URL="https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/$LAST_RELEASE_VERSION/cloud-hypervisor-static-aarch64"
|
CH_RELEASE_URL="https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/$LAST_RELEASE_VERSION/cloud-hypervisor-static-aarch64"
|
||||||
CH_RELEASE_NAME="cloud-hypervisor-static-aarch64"
|
CH_RELEASE_NAME="cloud-hypervisor-static-aarch64"
|
||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
time wget --quiet $CH_RELEASE_URL -O "$CH_RELEASE_NAME" || exit 1
|
# Repeat a few times to workaround a random wget failure
|
||||||
chmod +x $CH_RELEASE_NAME
|
WGET_RETRY_MAX=10
|
||||||
|
wget_retry=0
|
||||||
|
|
||||||
|
until [ "$wget_retry" -ge "$WGET_RETRY_MAX" ]
|
||||||
|
do
|
||||||
|
time wget $CH_RELEASE_URL -O "$CH_RELEASE_NAME" && break
|
||||||
|
wget_retry=$((wget_retry+1))
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $wget_retry -ge "$WGET_RETRY_MAX" ]; then
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
chmod +x $CH_RELEASE_NAME
|
||||||
|
fi
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Build custom kernel for guest VMs
|
# Build custom kernel for guest VMs
|
||||||
@@ -225,12 +240,6 @@ if [ $RES -ne 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_TARGET="aarch64-unknown-linux-${CH_LIBC}"
|
|
||||||
if [[ "${BUILD_TARGET}" == "aarch64-unknown-linux-musl" ]]; then
|
|
||||||
export TARGET_CC="musl-gcc"
|
|
||||||
export RUSTFLAGS="-C link-arg=-lgcc -C link_arg=-specs -C link_arg=/usr/lib/aarch64-linux-musl/musl-gcc.specs"
|
|
||||||
fi
|
|
||||||
|
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
|
|
||||||
# Test without ACPI
|
# Test without ACPI
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ set -x
|
|||||||
source $HOME/.cargo/env
|
source $HOME/.cargo/env
|
||||||
source $(dirname "$0")/test-util.sh
|
source $(dirname "$0")/test-util.sh
|
||||||
|
|
||||||
export BUILD_TARGET=${BUILD_TARGET-x86_64-unknown-linux-gnu}
|
|
||||||
|
|
||||||
WORKLOADS_DIR="$HOME/workloads"
|
WORKLOADS_DIR="$HOME/workloads"
|
||||||
mkdir -p "$WORKLOADS_DIR"
|
mkdir -p "$WORKLOADS_DIR"
|
||||||
|
|
||||||
@@ -78,11 +76,8 @@ if [ -d "$LINUX_CUSTOM_DIR" ]; then
|
|||||||
rm -rf $LINUX_CUSTOM_DIR
|
rm -rf $LINUX_CUSTOM_DIR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
|
|
||||||
CFLAGS=""
|
CFLAGS=""
|
||||||
TARGET_CC=""
|
|
||||||
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
||||||
TARGET_CC="musl-gcc"
|
|
||||||
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ set -x
|
|||||||
source $HOME/.cargo/env
|
source $HOME/.cargo/env
|
||||||
source $(dirname "$0")/test-util.sh
|
source $(dirname "$0")/test-util.sh
|
||||||
|
|
||||||
export BUILD_TARGET=${BUILD_TARGET-x86_64-unknown-linux-gnu}
|
|
||||||
|
|
||||||
WORKLOADS_DIR="$HOME/workloads"
|
WORKLOADS_DIR="$HOME/workloads"
|
||||||
mkdir -p "$WORKLOADS_DIR"
|
mkdir -p "$WORKLOADS_DIR"
|
||||||
|
|
||||||
@@ -69,11 +67,8 @@ if [ -d "$LINUX_CUSTOM_DIR" ]; then
|
|||||||
rm -rf $LINUX_CUSTOM_DIR
|
rm -rf $LINUX_CUSTOM_DIR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
|
|
||||||
CFLAGS=""
|
CFLAGS=""
|
||||||
TARGET_CC=""
|
|
||||||
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
||||||
TARGET_CC="musl-gcc"
|
|
||||||
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -14,12 +14,9 @@ fi
|
|||||||
# For now these values are default for kvm
|
# For now these values are default for kvm
|
||||||
features=""
|
features=""
|
||||||
|
|
||||||
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
|
|
||||||
CFLAGS=""
|
CFLAGS=""
|
||||||
TARGET_CC=""
|
|
||||||
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
||||||
TARGET_CC="musl-gcc"
|
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
||||||
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cargo build --all --release $features --target $BUILD_TARGET
|
cargo build --all --release $features --target $BUILD_TARGET
|
||||||
|
|||||||
@@ -35,12 +35,9 @@ cp $FOCAL_OS_IMAGE $VFIO_DIR
|
|||||||
cp $FW $VFIO_DIR
|
cp $FW $VFIO_DIR
|
||||||
cp $VMLINUX_IMAGE $VFIO_DIR || exit 1
|
cp $VMLINUX_IMAGE $VFIO_DIR || exit 1
|
||||||
|
|
||||||
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
|
|
||||||
CFLAGS=""
|
CFLAGS=""
|
||||||
TARGET_CC=""
|
|
||||||
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
||||||
TARGET_CC="musl-gcc"
|
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
||||||
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cargo build --all --release $features --target $BUILD_TARGET
|
cargo build --all --release $features --target $BUILD_TARGET
|
||||||
|
|||||||
@@ -22,14 +22,6 @@ WIN_IMAGE_FILE="$WORKLOADS_DIR/$WIN_IMAGE_BASENAME"
|
|||||||
OVMF_FW="$WORKLOADS_DIR/CLOUDHV_EFI.fd"
|
OVMF_FW="$WORKLOADS_DIR/CLOUDHV_EFI.fd"
|
||||||
build_edk2
|
build_edk2
|
||||||
|
|
||||||
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
|
|
||||||
CFLAGS=""
|
|
||||||
TARGET_CC=""
|
|
||||||
if [[ "${BUILD_TARGET}" == "aarch64-unknown-linux-musl" ]]; then
|
|
||||||
export TARGET_CC="musl-gcc"
|
|
||||||
export RUSTFLAGS="-C link-arg=-lgcc -C link_arg=-specs -C link_arg=/usr/lib/aarch64-linux-musl/musl-gcc.specs"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if the images are present
|
# Check if the images are present
|
||||||
if [[ ! -f ${WIN_IMAGE_FILE} || ! -f ${OVMF_FW} ]]; then
|
if [[ ! -f ${WIN_IMAGE_FILE} || ! -f ${OVMF_FW} ]]; then
|
||||||
echo "Windows image/firmware not present in the host"
|
echo "Windows image/firmware not present in the host"
|
||||||
|
|||||||
@@ -22,12 +22,9 @@ if [ ! -f "$OVMF_FW" ]; then
|
|||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
|
|
||||||
CFLAGS=""
|
CFLAGS=""
|
||||||
TARGET_CC=""
|
|
||||||
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then
|
||||||
TARGET_CC="musl-gcc"
|
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
||||||
CFLAGS="-I /usr/include/x86_64-linux-musl/ -idirafter /usr/include/"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if the images are present
|
# Check if the images are present
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ set -x
|
|||||||
source $HOME/.cargo/env
|
source $HOME/.cargo/env
|
||||||
source $(dirname "$0")/test-util.sh
|
source $(dirname "$0")/test-util.sh
|
||||||
|
|
||||||
export BUILD_TARGET=${BUILD_TARGET-x86_64-unknown-linux-gnu}
|
|
||||||
|
|
||||||
WORKLOADS_DIR="$HOME/workloads"
|
WORKLOADS_DIR="$HOME/workloads"
|
||||||
mkdir -p "$WORKLOADS_DIR"
|
mkdir -p "$WORKLOADS_DIR"
|
||||||
|
|
||||||
@@ -134,7 +132,7 @@ if [ ! -f "$VIRTIOFSD" ]; then
|
|||||||
pushd $WORKLOADS_DIR
|
pushd $WORKLOADS_DIR
|
||||||
git clone "https://gitlab.com/virtio-fs/virtiofsd.git" $VIRTIOFSD_DIR
|
git clone "https://gitlab.com/virtio-fs/virtiofsd.git" $VIRTIOFSD_DIR
|
||||||
pushd $VIRTIOFSD_DIR
|
pushd $VIRTIOFSD_DIR
|
||||||
git checkout v1.1.0
|
git checkout v1.8.0
|
||||||
time cargo build --release
|
time cargo build --release
|
||||||
cp target/release/virtiofsd $VIRTIOFSD || exit 1
|
cp target/release/virtiofsd $VIRTIOFSD || exit 1
|
||||||
popd
|
popd
|
||||||
@@ -172,8 +170,6 @@ cp $FOCAL_OS_RAW_IMAGE $VFIO_DIR
|
|||||||
cp $FW $VFIO_DIR
|
cp $FW $VFIO_DIR
|
||||||
cp $VMLINUX_IMAGE $VFIO_DIR || exit 1
|
cp $VMLINUX_IMAGE $VFIO_DIR || exit 1
|
||||||
|
|
||||||
BUILD_TARGET="$(uname -m)-unknown-linux-${CH_LIBC}"
|
|
||||||
|
|
||||||
cargo build --all --release $features --target $BUILD_TARGET
|
cargo build --all --release $features --target $BUILD_TARGET
|
||||||
strip target/$BUILD_TARGET/release/cloud-hypervisor
|
strip target/$BUILD_TARGET/release/cloud-hypervisor
|
||||||
strip target/$BUILD_TARGET/release/vhost_user_net
|
strip target/$BUILD_TARGET/release/vhost_user_net
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ source $HOME/.cargo/env
|
|||||||
source $(dirname "$0")/test-util.sh
|
source $(dirname "$0")/test-util.sh
|
||||||
|
|
||||||
export TEST_ARCH=$(uname -m)
|
export TEST_ARCH=$(uname -m)
|
||||||
export BUILD_TARGET=${BUILD_TARGET-${TEST_ARCH}-unknown-linux-gnu}
|
|
||||||
|
|
||||||
|
|
||||||
WORKLOADS_DIR="$HOME/workloads"
|
WORKLOADS_DIR="$HOME/workloads"
|
||||||
mkdir -p "$WORKLOADS_DIR"
|
mkdir -p "$WORKLOADS_DIR"
|
||||||
@@ -91,11 +89,8 @@ fi
|
|||||||
# Build custom kernel based on virtio-pmem and virtio-fs upstream patches
|
# Build custom kernel based on virtio-pmem and virtio-fs upstream patches
|
||||||
build_custom_linux
|
build_custom_linux
|
||||||
|
|
||||||
BUILD_TARGET="${TEST_ARCH}-unknown-linux-${CH_LIBC}"
|
|
||||||
CFLAGS=""
|
CFLAGS=""
|
||||||
TARGET_CC=""
|
|
||||||
if [[ "${BUILD_TARGET}" == "${TEST_ARCH}-unknown-linux-musl" ]]; then
|
if [[ "${BUILD_TARGET}" == "${TEST_ARCH}-unknown-linux-musl" ]]; then
|
||||||
TARGET_CC="musl-gcc"
|
|
||||||
CFLAGS="-I /usr/include/${TEST_ARCH}-linux-musl/ -idirafter /usr/include/"
|
CFLAGS="-I /usr/include/${TEST_ARCH}-linux-musl/ -idirafter /usr/include/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ source $(dirname "$0")/test-util.sh
|
|||||||
|
|
||||||
process_common_args "$@"
|
process_common_args "$@"
|
||||||
|
|
||||||
BUILD_TARGET=${BUILD_TARGET-x86_64-unknown-linux-gnu}
|
|
||||||
cargo_args=("")
|
cargo_args=("")
|
||||||
|
|
||||||
if [[ $hypervisor = "mshv" ]]; then
|
if [[ $hypervisor = "mshv" ]]; then
|
||||||
@@ -15,10 +14,5 @@ elif [[ $(uname -m) = "x86_64" ]]; then
|
|||||||
cargo_args+=("--features tdx")
|
cargo_args+=("--features tdx")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${BUILD_TARGET}" == "aarch64-unknown-linux-musl" ]]; then
|
|
||||||
export TARGET_CC="musl-gcc"
|
|
||||||
export RUSTFLAGS="-C link-arg=-lgcc -C link_arg=-specs -C link_arg=/usr/lib/aarch64-linux-musl/musl-gcc.specs"
|
|
||||||
fi
|
|
||||||
|
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
cargo test --lib --bins --target $BUILD_TARGET --workspace ${cargo_args[@]} || exit 1
|
cargo test --lib --bins --target $BUILD_TARGET --workspace ${cargo_args[@]} || exit 1
|
||||||
|
|||||||
@@ -41,21 +41,21 @@ impl fmt::Display for Error {
|
|||||||
use Error::*;
|
use Error::*;
|
||||||
match self {
|
match self {
|
||||||
ApiClient(e) => e.fmt(f),
|
ApiClient(e) => e.fmt(f),
|
||||||
Connect(e) => write!(f, "Error opening HTTP socket: {}", e),
|
Connect(e) => write!(f, "Error opening HTTP socket: {e}"),
|
||||||
InvalidCpuCount(e) => write!(f, "Error parsing CPU count: {}", e),
|
InvalidCpuCount(e) => write!(f, "Error parsing CPU count: {e}"),
|
||||||
InvalidMemorySize(e) => write!(f, "Error parsing memory size: {:?}", e),
|
InvalidMemorySize(e) => write!(f, "Error parsing memory size: {e:?}"),
|
||||||
InvalidBalloonSize(e) => write!(f, "Error parsing balloon size: {:?}", e),
|
InvalidBalloonSize(e) => write!(f, "Error parsing balloon size: {e:?}"),
|
||||||
AddDeviceConfig(e) => write!(f, "Error parsing device syntax: {}", e),
|
AddDeviceConfig(e) => write!(f, "Error parsing device syntax: {e}"),
|
||||||
AddDiskConfig(e) => write!(f, "Error parsing disk syntax: {}", e),
|
AddDiskConfig(e) => write!(f, "Error parsing disk syntax: {e}"),
|
||||||
AddFsConfig(e) => write!(f, "Error parsing filesystem syntax: {}", e),
|
AddFsConfig(e) => write!(f, "Error parsing filesystem syntax: {e}"),
|
||||||
AddPmemConfig(e) => write!(f, "Error parsing persistent memory syntax: {}", e),
|
AddPmemConfig(e) => write!(f, "Error parsing persistent memory syntax: {e}"),
|
||||||
AddNetConfig(e) => write!(f, "Error parsing network syntax: {}", e),
|
AddNetConfig(e) => write!(f, "Error parsing network syntax: {e}"),
|
||||||
AddUserDeviceConfig(e) => write!(f, "Error parsing user device syntax: {}", e),
|
AddUserDeviceConfig(e) => write!(f, "Error parsing user device syntax: {e}"),
|
||||||
AddVdpaConfig(e) => write!(f, "Error parsing vDPA device syntax: {}", e),
|
AddVdpaConfig(e) => write!(f, "Error parsing vDPA device syntax: {e}"),
|
||||||
AddVsockConfig(e) => write!(f, "Error parsing vsock syntax: {}", e),
|
AddVsockConfig(e) => write!(f, "Error parsing vsock syntax: {e}"),
|
||||||
Restore(e) => write!(f, "Error parsing restore syntax: {}", e),
|
Restore(e) => write!(f, "Error parsing restore syntax: {e}"),
|
||||||
ReadingStdin(e) => write!(f, "Error reading from stdin: {}", e),
|
ReadingStdin(e) => write!(f, "Error reading from stdin: {e}"),
|
||||||
ReadingFile(e) => write!(f, "Error reading from file: {}", e),
|
ReadingFile(e) => write!(f, "Error reading from file: {e}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -680,7 +680,7 @@ fn main() {
|
|||||||
let matches = app.get_matches();
|
let matches = app.get_matches();
|
||||||
|
|
||||||
if let Err(e) = do_command(&matches) {
|
if let Err(e) = do_command(&matches) {
|
||||||
eprintln!("Error running command: {}", e);
|
eprintln!("Error running command: {e}");
|
||||||
process::exit(1)
|
process::exit(1)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
39
src/main.rs
39
src/main.rs
@@ -477,7 +477,7 @@ fn start_vmm(cmd_arguments: ArgMatches) -> Result<Option<String>, Error> {
|
|||||||
"log" => SeccompAction::Log,
|
"log" => SeccompAction::Log,
|
||||||
_ => {
|
_ => {
|
||||||
// The user providing an invalid value will be rejected by clap
|
// The user providing an invalid value will be rejected by clap
|
||||||
panic!("Invalid parameter {} for \"--seccomp\" flag", seccomp_value);
|
panic!("Invalid parameter {seccomp_value} for \"--seccomp\" flag");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -497,7 +497,7 @@ fn start_vmm(cmd_arguments: ArgMatches) -> Result<Option<String>, Error> {
|
|||||||
signal_hook::low_level::emulate_default_handler(SIGSYS).unwrap();
|
signal_hook::low_level::emulate_default_handler(SIGSYS).unwrap();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.map_err(|e| eprintln!("Error adding SIGSYS signal handler: {}", e))
|
.map_err(|e| eprintln!("Error adding SIGSYS signal handler: {e}"))
|
||||||
.ok();
|
.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -506,13 +506,13 @@ fn start_vmm(cmd_arguments: ArgMatches) -> Result<Option<String>, Error> {
|
|||||||
// dedicated signal handling thread we'll start in a bit.
|
// dedicated signal handling thread we'll start in a bit.
|
||||||
for sig in &vmm::vm::Vm::HANDLED_SIGNALS {
|
for sig in &vmm::vm::Vm::HANDLED_SIGNALS {
|
||||||
if let Err(e) = block_signal(*sig) {
|
if let Err(e) = block_signal(*sig) {
|
||||||
eprintln!("Error blocking signals: {}", e);
|
eprintln!("Error blocking signals: {e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for sig in &vmm::Vmm::HANDLED_SIGNALS {
|
for sig in &vmm::Vmm::HANDLED_SIGNALS {
|
||||||
if let Err(e) = block_signal(*sig) {
|
if let Err(e) = block_signal(*sig) {
|
||||||
eprintln!("Error blocking signals: {}", e);
|
eprintln!("Error blocking signals: {e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,7 +602,7 @@ fn main() {
|
|||||||
0
|
0
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("{}", e);
|
eprintln!("{e}");
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -722,6 +722,7 @@ mod unit_tests {
|
|||||||
gdb: false,
|
gdb: false,
|
||||||
platform: None,
|
platform: None,
|
||||||
tpm: None,
|
tpm: None,
|
||||||
|
preserved_fds: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(expected_vm_config, result_vm_config);
|
assert_eq!(expected_vm_config, result_vm_config);
|
||||||
@@ -729,7 +730,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_cpus() {
|
fn test_valid_vm_config_cpus() {
|
||||||
vec![
|
[
|
||||||
(
|
(
|
||||||
vec![
|
vec![
|
||||||
"cloud-hypervisor",
|
"cloud-hypervisor",
|
||||||
@@ -847,7 +848,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_kernel() {
|
fn test_valid_vm_config_kernel() {
|
||||||
vec![(
|
[(
|
||||||
vec!["cloud-hypervisor", "--kernel", "/path/to/kernel"],
|
vec!["cloud-hypervisor", "--kernel", "/path/to/kernel"],
|
||||||
r#"{
|
r#"{
|
||||||
"payload": {"kernel": "/path/to/kernel"}
|
"payload": {"kernel": "/path/to/kernel"}
|
||||||
@@ -862,7 +863,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_cmdline() {
|
fn test_valid_vm_config_cmdline() {
|
||||||
vec![(
|
[(
|
||||||
vec![
|
vec![
|
||||||
"cloud-hypervisor",
|
"cloud-hypervisor",
|
||||||
"--kernel",
|
"--kernel",
|
||||||
@@ -883,7 +884,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_disks() {
|
fn test_valid_vm_config_disks() {
|
||||||
vec![
|
[
|
||||||
(
|
(
|
||||||
vec![
|
vec![
|
||||||
"cloud-hypervisor",
|
"cloud-hypervisor",
|
||||||
@@ -1155,7 +1156,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_rng() {
|
fn test_valid_vm_config_rng() {
|
||||||
vec![(
|
[(
|
||||||
vec![
|
vec![
|
||||||
"cloud-hypervisor",
|
"cloud-hypervisor",
|
||||||
"--kernel",
|
"--kernel",
|
||||||
@@ -1177,8 +1178,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_fs() {
|
fn test_valid_vm_config_fs() {
|
||||||
vec![
|
[(
|
||||||
(
|
|
||||||
vec![
|
vec![
|
||||||
"cloud-hypervisor", "--kernel", "/path/to/kernel",
|
"cloud-hypervisor", "--kernel", "/path/to/kernel",
|
||||||
"--memory", "shared=true",
|
"--memory", "shared=true",
|
||||||
@@ -1246,8 +1246,7 @@ mod unit_tests {
|
|||||||
]
|
]
|
||||||
}"#,
|
}"#,
|
||||||
true,
|
true,
|
||||||
),
|
)]
|
||||||
]
|
|
||||||
.iter()
|
.iter()
|
||||||
.for_each(|(cli, openapi, equal)| {
|
.for_each(|(cli, openapi, equal)| {
|
||||||
compare_vm_config_cli_vs_json(cli, openapi, *equal);
|
compare_vm_config_cli_vs_json(cli, openapi, *equal);
|
||||||
@@ -1256,7 +1255,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_pmem() {
|
fn test_valid_vm_config_pmem() {
|
||||||
vec![
|
[
|
||||||
(
|
(
|
||||||
vec![
|
vec![
|
||||||
"cloud-hypervisor",
|
"cloud-hypervisor",
|
||||||
@@ -1319,7 +1318,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_serial_console() {
|
fn test_valid_vm_config_serial_console() {
|
||||||
vec![
|
[
|
||||||
(
|
(
|
||||||
vec!["cloud-hypervisor", "--kernel", "/path/to/kernel"],
|
vec!["cloud-hypervisor", "--kernel", "/path/to/kernel"],
|
||||||
r#"{
|
r#"{
|
||||||
@@ -1370,7 +1369,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_serial_pty_console_pty() {
|
fn test_valid_vm_config_serial_pty_console_pty() {
|
||||||
vec![
|
[
|
||||||
(
|
(
|
||||||
vec!["cloud-hypervisor", "--kernel", "/path/to/kernel"],
|
vec!["cloud-hypervisor", "--kernel", "/path/to/kernel"],
|
||||||
r#"{
|
r#"{
|
||||||
@@ -1516,7 +1515,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_vdpa() {
|
fn test_valid_vm_config_vdpa() {
|
||||||
vec![
|
[
|
||||||
(
|
(
|
||||||
vec![
|
vec![
|
||||||
"cloud-hypervisor",
|
"cloud-hypervisor",
|
||||||
@@ -1561,7 +1560,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_vsock() {
|
fn test_valid_vm_config_vsock() {
|
||||||
vec![
|
[
|
||||||
(
|
(
|
||||||
vec![
|
vec![
|
||||||
"cloud-hypervisor",
|
"cloud-hypervisor",
|
||||||
@@ -1644,7 +1643,7 @@ mod unit_tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_valid_vm_config_tpm_socket() {
|
fn test_valid_vm_config_tpm_socket() {
|
||||||
vec![(
|
[(
|
||||||
vec![
|
vec![
|
||||||
"cloud-hypervisor",
|
"cloud-hypervisor",
|
||||||
"--kernel",
|
"--kernel",
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
epoll = "4.3.1"
|
epoll = "4.3.1"
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
once_cell = "1.16.0"
|
once_cell = "1.16.0"
|
||||||
serde = { version = "1.0.147", features = ["rc", "derive"] }
|
serde = { version = "1.0.150", features = ["rc", "derive"] }
|
||||||
serde_json = "1.0.87"
|
serde_json = "1.0.89"
|
||||||
ssh2 = { version = "0.9.3", features = ["vendored-openssl"] }
|
ssh2 = { version = "0.9.3", features = ["vendored-openssl"] }
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
wait-timeout = "0.2.0"
|
wait-timeout = "0.2.0"
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ impl GuestNetworkConfig {
|
|||||||
None => DEFAULT_TCP_LISTENER_TIMEOUT,
|
None => DEFAULT_TCP_LISTENER_TIMEOUT,
|
||||||
};
|
};
|
||||||
|
|
||||||
match (|| -> Result<(), WaitForBootError> {
|
let mut closure = || -> Result<(), WaitForBootError> {
|
||||||
let listener =
|
let listener =
|
||||||
TcpListener::bind(listen_addr.as_str()).map_err(WaitForBootError::Listen)?;
|
TcpListener::bind(listen_addr.as_str()).map_err(WaitForBootError::Listen)?;
|
||||||
listener
|
listener
|
||||||
@@ -106,7 +106,7 @@ impl GuestNetworkConfig {
|
|||||||
epoll::Event::new(epoll::Events::EPOLLIN, 0),
|
epoll::Event::new(epoll::Events::EPOLLIN, 0),
|
||||||
)
|
)
|
||||||
.expect("Cannot add 'tcp_listener' event to epoll");
|
.expect("Cannot add 'tcp_listener' event to epoll");
|
||||||
let mut events = vec![epoll::Event::new(epoll::Events::empty(), 0); 1];
|
let mut events = [epoll::Event::new(epoll::Events::empty(), 0); 1];
|
||||||
loop {
|
loop {
|
||||||
let num_events = match epoll::wait(epoll_fd, timeout * 1000_i32, &mut events[..]) {
|
let num_events = match epoll::wait(epoll_fd, timeout * 1000_i32, &mut events[..]) {
|
||||||
Ok(num_events) => Ok(num_events),
|
Ok(num_events) => Ok(num_events),
|
||||||
@@ -141,18 +141,19 @@ impl GuestNetworkConfig {
|
|||||||
Err(WaitForBootError::Accept(e))
|
Err(WaitForBootError::Accept(e))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})() {
|
};
|
||||||
|
|
||||||
|
match closure() {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let duration = start.elapsed();
|
let duration = start.elapsed();
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"\n\n==== Start 'wait_vm_boot' (FAILED) ====\n\n\
|
"\n\n==== Start 'wait_vm_boot' (FAILED) ====\n\n\
|
||||||
duration =\"{:?}, timeout = {}s\"\n\
|
duration =\"{duration:?}, timeout = {timeout}s\"\n\
|
||||||
listen_addr=\"{}\"\n\
|
listen_addr=\"{listen_addr}\"\n\
|
||||||
expected_guest_addr=\"{}\"\n\
|
expected_guest_addr=\"{expected_guest_addr}\"\n\
|
||||||
message=\"{}\"\n\
|
message=\"{s}\"\n\
|
||||||
error=\"{:?}\"\n\
|
error=\"{e:?}\"\n\
|
||||||
\n==== End 'wait_vm_boot' outout ====\n\n",
|
\n==== End 'wait_vm_boot' outout ====\n\n"
|
||||||
duration, timeout, listen_addr, expected_guest_addr, s, e
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Err(e)
|
Err(e)
|
||||||
@@ -250,7 +251,7 @@ impl DiskConfig for UbuntuDiskConfig {
|
|||||||
.join("cloud-init")
|
.join("cloud-init")
|
||||||
.join("ubuntu");
|
.join("ubuntu");
|
||||||
|
|
||||||
vec!["meta-data"].iter().for_each(|x| {
|
["meta-data"].iter().for_each(|x| {
|
||||||
rate_limited_copy(source_file_dir.join(x), cloud_init_directory.join(x))
|
rate_limited_copy(source_file_dir.join(x), cloud_init_directory.join(x))
|
||||||
.expect("Expect copying cloud-init meta-data to succeed");
|
.expect("Expect copying cloud-init meta-data to succeed");
|
||||||
});
|
});
|
||||||
@@ -306,7 +307,7 @@ impl DiskConfig for UbuntuDiskConfig {
|
|||||||
.output()
|
.output()
|
||||||
.expect("Expect creating disk image to succeed");
|
.expect("Expect creating disk image to succeed");
|
||||||
|
|
||||||
vec!["user-data", "meta-data", "network-config"]
|
["user-data", "meta-data", "network-config"]
|
||||||
.iter()
|
.iter()
|
||||||
.for_each(|x| {
|
.for_each(|x| {
|
||||||
std::process::Command::new("mcopy")
|
std::process::Command::new("mcopy")
|
||||||
@@ -433,7 +434,7 @@ impl DiskConfig for WindowsDiskConfig {
|
|||||||
.output()
|
.output()
|
||||||
.expect("Expect device mapper nodes to be ready");
|
.expect("Expect device mapper nodes to be ready");
|
||||||
|
|
||||||
self.osdisk_path = format!("/dev/mapper/{}", windows_snapshot);
|
self.osdisk_path = format!("/dev/mapper/{windows_snapshot}");
|
||||||
self.windows_snapshot_cow = windows_snapshot_cow;
|
self.windows_snapshot_cow = windows_snapshot_cow;
|
||||||
self.windows_snapshot = windows_snapshot;
|
self.windows_snapshot = windows_snapshot;
|
||||||
}
|
}
|
||||||
@@ -461,10 +462,7 @@ pub fn rate_limited_copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::
|
|||||||
|
|
||||||
// Make sure there is at least 6 GiB of space
|
// Make sure there is at least 6 GiB of space
|
||||||
if free_bytes < 6 << 30 {
|
if free_bytes < 6 << 30 {
|
||||||
eprintln!(
|
eprintln!("Not enough space on disk ({free_bytes}). Attempt {i} of 10. Sleeping.");
|
||||||
"Not enough space on disk ({}). Attempt {} of 10. Sleeping.",
|
|
||||||
free_bytes, i
|
|
||||||
);
|
|
||||||
thread::sleep(std::time::Duration::new(60, 0));
|
thread::sleep(std::time::Duration::new(60, 0));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -473,7 +471,7 @@ pub fn rate_limited_copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::
|
|||||||
Err(e) => {
|
Err(e) => {
|
||||||
if let Some(errno) = e.raw_os_error() {
|
if let Some(errno) = e.raw_os_error() {
|
||||||
if errno == libc::ENOSPC {
|
if errno == libc::ENOSPC {
|
||||||
eprintln!("Copy returned ENOSPC. Attempt {} of 10. Sleeping.", i);
|
eprintln!("Copy returned ENOSPC. Attempt {i} of 10. Sleeping.");
|
||||||
thread::sleep(std::time::Duration::new(60, 0));
|
thread::sleep(std::time::Duration::new(60, 0));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -508,7 +506,7 @@ pub fn handle_child_output(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
Some(code) => {
|
Some(code) => {
|
||||||
eprintln!("\n\n==== child exit code: {} ====", code);
|
eprintln!("\n\n==== child exit code: {code} ====");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,9 +558,9 @@ fn scp_to_guest_with_auth(
|
|||||||
) -> Result<(), SshCommandError> {
|
) -> Result<(), SshCommandError> {
|
||||||
let mut counter = 0;
|
let mut counter = 0;
|
||||||
loop {
|
loop {
|
||||||
match (|| -> Result<(), SshCommandError> {
|
let closure = || -> Result<(), SshCommandError> {
|
||||||
let tcp =
|
let tcp =
|
||||||
TcpStream::connect(format!("{}:22", ip)).map_err(SshCommandError::Connection)?;
|
TcpStream::connect(format!("{ip}:22")).map_err(SshCommandError::Connection)?;
|
||||||
let mut sess = Session::new().unwrap();
|
let mut sess = Session::new().unwrap();
|
||||||
sess.set_tcp_stream(tcp);
|
sess.set_tcp_stream(tcp);
|
||||||
sess.handshake().map_err(SshCommandError::Handshake)?;
|
sess.handshake().map_err(SshCommandError::Handshake)?;
|
||||||
@@ -593,20 +591,21 @@ fn scp_to_guest_with_auth(
|
|||||||
let _ = channel.wait_close();
|
let _ = channel.wait_close();
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
})() {
|
};
|
||||||
|
|
||||||
|
match closure() {
|
||||||
Ok(_) => break,
|
Ok(_) => break,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
counter += 1;
|
counter += 1;
|
||||||
if counter >= retries {
|
if counter >= retries {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"\n\n==== Start scp command output (FAILED) ====\n\n\
|
"\n\n==== Start scp command output (FAILED) ====\n\n\
|
||||||
path =\"{:?}\"\n\
|
path =\"{path:?}\"\n\
|
||||||
remote_path =\"{:?}\"\n\
|
remote_path =\"{remote_path:?}\"\n\
|
||||||
auth=\"{:#?}\"\n\
|
auth=\"{auth:#?}\"\n\
|
||||||
ip=\"{}\"\n\
|
ip=\"{ip}\"\n\
|
||||||
error=\"{:?}\"\n\
|
error=\"{e:?}\"\n\
|
||||||
\n==== End scp command outout ====\n\n",
|
\n==== End scp command outout ====\n\n"
|
||||||
path, remote_path, auth, ip, e
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return Err(e);
|
return Err(e);
|
||||||
@@ -649,9 +648,9 @@ pub fn ssh_command_ip_with_auth(
|
|||||||
|
|
||||||
let mut counter = 0;
|
let mut counter = 0;
|
||||||
loop {
|
loop {
|
||||||
match (|| -> Result<(), SshCommandError> {
|
let mut closure = || -> Result<(), SshCommandError> {
|
||||||
let tcp =
|
let tcp =
|
||||||
TcpStream::connect(format!("{}:22", ip)).map_err(SshCommandError::Connection)?;
|
TcpStream::connect(format!("{ip}:22")).map_err(SshCommandError::Connection)?;
|
||||||
let mut sess = Session::new().unwrap();
|
let mut sess = Session::new().unwrap();
|
||||||
sess.set_tcp_stream(tcp);
|
sess.set_tcp_stream(tcp);
|
||||||
sess.handshake().map_err(SshCommandError::Handshake)?;
|
sess.handshake().map_err(SshCommandError::Handshake)?;
|
||||||
@@ -678,20 +677,21 @@ pub fn ssh_command_ip_with_auth(
|
|||||||
} else {
|
} else {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
})() {
|
};
|
||||||
|
|
||||||
|
match closure() {
|
||||||
Ok(_) => break,
|
Ok(_) => break,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
counter += 1;
|
counter += 1;
|
||||||
if counter >= retries {
|
if counter >= retries {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"\n\n==== Start ssh command output (FAILED) ====\n\n\
|
"\n\n==== Start ssh command output (FAILED) ====\n\n\
|
||||||
command=\"{}\"\n\
|
command=\"{command}\"\n\
|
||||||
auth=\"{:#?}\"\n\
|
auth=\"{auth:#?}\"\n\
|
||||||
ip=\"{}\"\n\
|
ip=\"{ip}\"\n\
|
||||||
output=\"{}\"\n\
|
output=\"{s}\"\n\
|
||||||
error=\"{:?}\"\n\
|
error=\"{e:?}\"\n\
|
||||||
\n==== End ssh command outout ====\n\n",
|
\n==== End ssh command outout ====\n\n"
|
||||||
command, auth, ip, s, e
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return Err(e);
|
return Err(e);
|
||||||
@@ -725,14 +725,14 @@ pub fn exec_host_command_status(command: &str) -> ExitStatus {
|
|||||||
std::process::Command::new("bash")
|
std::process::Command::new("bash")
|
||||||
.args(["-c", command])
|
.args(["-c", command])
|
||||||
.status()
|
.status()
|
||||||
.unwrap_or_else(|_| panic!("Expected '{}' to run", command))
|
.unwrap_or_else(|_| panic!("Expected '{command}' to run"))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn exec_host_command_output(command: &str) -> Output {
|
pub fn exec_host_command_output(command: &str) -> Output {
|
||||||
std::process::Command::new("bash")
|
std::process::Command::new("bash")
|
||||||
.args(["-c", command])
|
.args(["-c", command])
|
||||||
.output()
|
.output()
|
||||||
.unwrap_or_else(|_| panic!("Expected '{}' to run", command))
|
.unwrap_or_else(|_| panic!("Expected '{command}' to run"))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const PIPE_SIZE: i32 = 32 << 20;
|
pub const PIPE_SIZE: i32 = 32 << 20;
|
||||||
@@ -753,15 +753,15 @@ impl Guest {
|
|||||||
let tmp_dir = TempDir::new_with_prefix("/tmp/ch").unwrap();
|
let tmp_dir = TempDir::new_with_prefix("/tmp/ch").unwrap();
|
||||||
|
|
||||||
let network = GuestNetworkConfig {
|
let network = GuestNetworkConfig {
|
||||||
guest_ip: format!("{}.{}.2", class, id),
|
guest_ip: format!("{class}.{id}.2"),
|
||||||
l2_guest_ip1: format!("{}.{}.3", class, id),
|
l2_guest_ip1: format!("{class}.{id}.3"),
|
||||||
l2_guest_ip2: format!("{}.{}.4", class, id),
|
l2_guest_ip2: format!("{class}.{id}.4"),
|
||||||
l2_guest_ip3: format!("{}.{}.5", class, id),
|
l2_guest_ip3: format!("{class}.{id}.5"),
|
||||||
host_ip: format!("{}.{}.1", class, id),
|
host_ip: format!("{class}.{id}.1"),
|
||||||
guest_mac: format!("12:34:56:78:90:{:02x}", id),
|
guest_mac: format!("12:34:56:78:90:{id:02x}"),
|
||||||
l2_guest_mac1: format!("de:ad:be:ef:12:{:02x}", id),
|
l2_guest_mac1: format!("de:ad:be:ef:12:{id:02x}"),
|
||||||
l2_guest_mac2: format!("de:ad:be:ef:34:{:02x}", id),
|
l2_guest_mac2: format!("de:ad:be:ef:34:{id:02x}"),
|
||||||
l2_guest_mac3: format!("de:ad:be:ef:56:{:02x}", id),
|
l2_guest_mac3: format!("de:ad:be:ef:56:{id:02x}"),
|
||||||
tcp_listener_port: DEFAULT_TCP_LISTENER_PORT + id as u16,
|
tcp_listener_port: DEFAULT_TCP_LISTENER_PORT + id as u16,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -898,9 +898,8 @@ impl Guest {
|
|||||||
pub fn get_numa_node_memory(&self, node_id: usize) -> Result<u32, Error> {
|
pub fn get_numa_node_memory(&self, node_id: usize) -> Result<u32, Error> {
|
||||||
self.ssh_command(
|
self.ssh_command(
|
||||||
format!(
|
format!(
|
||||||
"grep MemTotal /sys/devices/system/node/node{}/meminfo \
|
"grep MemTotal /sys/devices/system/node/node{node_id}/meminfo \
|
||||||
| cut -d \":\" -f 2 | grep -o \"[0-9]*\"",
|
| cut -d \":\" -f 2 | grep -o \"[0-9]*\""
|
||||||
node_id
|
|
||||||
)
|
)
|
||||||
.as_str(),
|
.as_str(),
|
||||||
)?
|
)?
|
||||||
@@ -917,10 +916,7 @@ impl Guest {
|
|||||||
|
|
||||||
pub fn check_numa_node_cpus(&self, node_id: usize, cpus: Vec<usize>) -> Result<(), Error> {
|
pub fn check_numa_node_cpus(&self, node_id: usize, cpus: Vec<usize>) -> Result<(), Error> {
|
||||||
for cpu in cpus.iter() {
|
for cpu in cpus.iter() {
|
||||||
let cmd = format!(
|
let cmd = format!("[ -d \"/sys/devices/system/node/node{node_id}/cpu{cpu}\" ]");
|
||||||
"[ -d \"/sys/devices/system/node/node{}/cpu{}\" ]",
|
|
||||||
node_id, cpu
|
|
||||||
);
|
|
||||||
self.ssh_command(cmd.as_str())?;
|
self.ssh_command(cmd.as_str())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -932,7 +928,7 @@ impl Guest {
|
|||||||
node_id: usize,
|
node_id: usize,
|
||||||
distances: &str,
|
distances: &str,
|
||||||
) -> Result<bool, Error> {
|
) -> Result<bool, Error> {
|
||||||
let cmd = format!("cat /sys/devices/system/node/node{}/distance", node_id);
|
let cmd = format!("cat /sys/devices/system/node/node{node_id}/distance");
|
||||||
if self.ssh_command(cmd.as_str())?.trim() == distances {
|
if self.ssh_command(cmd.as_str())?.trim() == distances {
|
||||||
Ok(true)
|
Ok(true)
|
||||||
} else {
|
} else {
|
||||||
@@ -1045,8 +1041,7 @@ impl Guest {
|
|||||||
|
|
||||||
// Write something to vsock from the host
|
// Write something to vsock from the host
|
||||||
assert!(exec_host_command_status(&format!(
|
assert!(exec_host_command_status(&format!(
|
||||||
"echo -e \"CONNECT 16\\nHelloWorld!\" | socat - UNIX-CONNECT:{}",
|
"echo -e \"CONNECT 16\\nHelloWorld!\" | socat - UNIX-CONNECT:{socket}"
|
||||||
socket
|
|
||||||
))
|
))
|
||||||
.success());
|
.success());
|
||||||
|
|
||||||
@@ -1131,7 +1126,7 @@ impl Guest {
|
|||||||
}
|
}
|
||||||
// Check if the console is usable
|
// Check if the console is usable
|
||||||
if let Some(console_text) = console_text {
|
if let Some(console_text) = console_text {
|
||||||
let console_cmd = format!("echo {} | sudo tee /dev/hvc0", console_text);
|
let console_cmd = format!("echo {console_text} | sudo tee /dev/hvc0");
|
||||||
self.ssh_command(&console_cmd).unwrap();
|
self.ssh_command(&console_cmd).unwrap();
|
||||||
}
|
}
|
||||||
// The net device is 'automatically' exercised through the above 'ssh' commands
|
// The net device is 'automatically' exercised through the above 'ssh' commands
|
||||||
@@ -1139,13 +1134,11 @@ impl Guest {
|
|||||||
// Check if the pmem device is usable
|
// Check if the pmem device is usable
|
||||||
if let Some(pmem_path) = pmem_path {
|
if let Some(pmem_path) = pmem_path {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
self.ssh_command(&format!("ls {}", pmem_path))
|
self.ssh_command(&format!("ls {pmem_path}")).unwrap().trim(),
|
||||||
.unwrap()
|
|
||||||
.trim(),
|
|
||||||
pmem_path
|
pmem_path
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
self.ssh_command(&format!("sudo mount {} /mnt", pmem_path))
|
self.ssh_command(&format!("sudo mount {pmem_path} /mnt"))
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
@@ -1156,7 +1149,7 @@ impl Guest {
|
|||||||
assert_eq!(self.ssh_command("ls /mnt").unwrap(), "");
|
assert_eq!(self.ssh_command("ls /mnt").unwrap(), "");
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
self.ssh_command(&format!("sudo mount {} /mnt", pmem_path))
|
self.ssh_command(&format!("sudo mount {pmem_path} /mnt"))
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
@@ -1279,8 +1272,7 @@ impl<'a> GuestCommand<'a> {
|
|||||||
Err(std::io::Error::new(
|
Err(std::io::Error::new(
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
format!(
|
format!(
|
||||||
"resizing pipe w/ 'fnctl' failed: stdout pipesize {}, stderr pipesize {}",
|
"resizing pipe w/ 'fnctl' failed: stdout pipesize {pipesize}, stderr pipesize {pipesize1}"
|
||||||
pipesize, pipesize1
|
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
@@ -1338,8 +1330,8 @@ impl<'a> GuestCommand<'a> {
|
|||||||
|
|
||||||
pub fn clh_command(cmd: &str) -> String {
|
pub fn clh_command(cmd: &str) -> String {
|
||||||
env::var("BUILD_TARGET").map_or(
|
env::var("BUILD_TARGET").map_or(
|
||||||
format!("target/x86_64-unknown-linux-gnu/release/{}", cmd),
|
format!("target/x86_64-unknown-linux-gnu/release/{cmd}"),
|
||||||
|target| format!("target/{}/release/{}", target, cmd),
|
|target| format!("target/{target}/release/{cmd}"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1440,8 +1432,7 @@ pub fn parse_fio_output(output: &str, fio_ops: &FioOps, num_jobs: u32) -> Result
|
|||||||
})
|
})
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"=============== Fio output ===============\n\n{}\n\n===========end============\n\n",
|
"=============== Fio output ===============\n\n{output}\n\n===========end============\n\n"
|
||||||
output
|
|
||||||
);
|
);
|
||||||
Error::FioOutputParse
|
Error::FioOutputParse
|
||||||
})
|
})
|
||||||
@@ -1496,8 +1487,7 @@ pub fn parse_fio_output_iops(output: &str, fio_ops: &FioOps, num_jobs: u32) -> R
|
|||||||
})
|
})
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
"=============== Fio output ===============\n\n{}\n\n===========end============\n\n",
|
"=============== Fio output ===============\n\n{output}\n\n===========end============\n\n"
|
||||||
output
|
|
||||||
);
|
);
|
||||||
Error::FioOutputParse
|
Error::FioOutputParse
|
||||||
})
|
})
|
||||||
@@ -1550,7 +1540,7 @@ pub fn measure_virtio_net_throughput(
|
|||||||
"-p",
|
"-p",
|
||||||
&format!("{}", default_port + n),
|
&format!("{}", default_port + n),
|
||||||
"-t",
|
"-t",
|
||||||
&format!("{}", test_timeout),
|
&format!("{test_timeout}"),
|
||||||
]);
|
]);
|
||||||
// For measuring the guest transmit throughput (as a sender),
|
// For measuring the guest transmit throughput (as a sender),
|
||||||
// use reverse mode of the iperf3 client on the host
|
// use reverse mode of the iperf3 client on the host
|
||||||
@@ -1644,7 +1634,7 @@ pub fn measure_virtio_net_latency(guest: &Guest, test_timeout: u32) -> Result<Ve
|
|||||||
)?;
|
)?;
|
||||||
|
|
||||||
// Start the ethr server on the guest
|
// Start the ethr server on the guest
|
||||||
guest.ssh_command(&format!("{} -s &> /dev/null &", ethr_remote_path))?;
|
guest.ssh_command(&format!("{ethr_remote_path} -s &> /dev/null &"))?;
|
||||||
|
|
||||||
thread::sleep(Duration::new(10, 0));
|
thread::sleep(Duration::new(10, 0));
|
||||||
|
|
||||||
@@ -1665,7 +1655,7 @@ pub fn measure_virtio_net_latency(guest: &Guest, test_timeout: u32) -> Result<Ve
|
|||||||
"-o",
|
"-o",
|
||||||
&log_file, // file output is JSON format
|
&log_file, // file output is JSON format
|
||||||
"-d",
|
"-d",
|
||||||
&format!("{}s", test_timeout),
|
&format!("{test_timeout}s"),
|
||||||
])
|
])
|
||||||
.stderr(Stdio::piped())
|
.stderr(Stdio::piped())
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -6,9 +6,9 @@ license = "Apache-2.0"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.56"
|
anyhow = "1.0.66"
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
libc = "0.2.133"
|
libc = "0.2.138"
|
||||||
log = "0.4.14"
|
log = "0.4.17"
|
||||||
thiserror = "1.0.30"
|
thiserror = "1.0.37"
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|||||||
@@ -277,11 +277,7 @@ impl Emulator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.established_flag_cached = true;
|
self.established_flag_cached = true;
|
||||||
if est.resp.bit != 0 {
|
self.established_flag = est.resp.bit == 0;
|
||||||
self.established_flag = false;
|
|
||||||
} else {
|
|
||||||
self.established_flag = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.established_flag
|
self.established_flag
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ authors = ["The Cloud Hypervisor Authors"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
once_cell = "1.16.0"
|
once_cell = "1.16.0"
|
||||||
serde = { version = "1.0.147", features = ["rc", "derive"] }
|
serde = { version = "1.0.150", features = ["rc", "derive"] }
|
||||||
serde_json = "1.0.87"
|
serde_json = "1.0.89"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
tracing = []
|
tracing = []
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ impl Tracer {
|
|||||||
if let Some(depth) = self.thread_depths.get_mut(thread_name) {
|
if let Some(depth) = self.thread_depths.get_mut(thread_name) {
|
||||||
depth.fetch_sub(1, Ordering::SeqCst);
|
depth.fetch_sub(1, Ordering::SeqCst);
|
||||||
} else {
|
} else {
|
||||||
panic!("Unmatched decreas for thread: {}", thread_name);
|
panic!("Unmatched decreas for thread: {thread_name}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,15 +5,13 @@ authors = ["The Cloud Hypervisor Authors"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
serde = { version = "1.0.147", features = ["rc"] }
|
serde = { version = "1.0.150", features = ["rc"] }
|
||||||
serde_derive = "1.0.142"
|
serde_derive = "1.0.150"
|
||||||
serde_json = "1.0.87"
|
serde_json = "1.0.89"
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
vm-memory = { version = "0.9.0", features = ["backend-mmap", "backend-atomic"] }
|
vfio-bindings = { git = "https://github.com/rust-vmm/vfio", branch = "main", features = ["fam-wrappers"] }
|
||||||
vmm-sys-util = "0.10.0"
|
vm-memory = { version = "0.10.0", features = ["backend-mmap", "backend-atomic"] }
|
||||||
|
vmm-sys-util = "0.11.0"
|
||||||
|
|
||||||
[dependencies.vfio-bindings]
|
|
||||||
version = "0.3.1"
|
|
||||||
features = ["fam-wrappers"]
|
|
||||||
|
|||||||
@@ -24,8 +24,9 @@ extern crate log;
|
|||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(u16)]
|
#[repr(u16)]
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug, Default)]
|
||||||
enum Command {
|
enum Command {
|
||||||
|
#[default]
|
||||||
Unknown = 0,
|
Unknown = 0,
|
||||||
Version = 1,
|
Version = 1,
|
||||||
DmaMap = 2,
|
DmaMap = 2,
|
||||||
@@ -43,28 +44,17 @@ enum Command {
|
|||||||
UserDirtyPages = 14,
|
UserDirtyPages = 14,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Command {
|
|
||||||
fn default() -> Self {
|
|
||||||
Command::Unknown
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Default)]
|
||||||
enum HeaderFlags {
|
enum HeaderFlags {
|
||||||
|
#[default]
|
||||||
Command = 0,
|
Command = 0,
|
||||||
Reply = 1,
|
Reply = 1,
|
||||||
NoReply = 1 << 4,
|
NoReply = 1 << 4,
|
||||||
Error = 1 << 5,
|
Error = 1 << 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for HeaderFlags {
|
|
||||||
fn default() -> Self {
|
|
||||||
HeaderFlags::Command
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Default, Clone, Copy, Debug)]
|
#[derive(Default, Clone, Copy, Debug)]
|
||||||
struct Header {
|
struct Header {
|
||||||
@@ -331,11 +321,8 @@ impl Client {
|
|||||||
|
|
||||||
debug!("Reply: {:?}", server_version);
|
debug!("Reply: {:?}", server_version);
|
||||||
|
|
||||||
let mut server_version_data = Vec::new();
|
let mut server_version_data =
|
||||||
server_version_data.resize(
|
vec![0; server_version.header.message_size as usize - size_of::<Version>()];
|
||||||
server_version.header.message_size as usize - size_of::<Version>(),
|
|
||||||
0,
|
|
||||||
);
|
|
||||||
self.stream
|
self.stream
|
||||||
.read_exact(server_version_data.as_mut_slice())
|
.read_exact(server_version_data.as_mut_slice())
|
||||||
.map_err(Error::StreamRead)?;
|
.map_err(Error::StreamRead)?;
|
||||||
@@ -576,7 +563,7 @@ impl Client {
|
|||||||
let mmap_cap_size = size_of::<vfio_region_info_cap_sparse_mmap>() as u32;
|
let mmap_cap_size = size_of::<vfio_region_info_cap_sparse_mmap>() as u32;
|
||||||
let mmap_area_size = size_of::<vfio_region_sparse_mmap_area>() as u32;
|
let mmap_area_size = size_of::<vfio_region_sparse_mmap_area>() as u32;
|
||||||
|
|
||||||
let cap_data_ptr = cap_data.as_ptr() as *const u8;
|
let cap_data_ptr = cap_data.as_ptr();
|
||||||
let mut region_info_offset = region_info.cap_offset;
|
let mut region_info_offset = region_info.cap_offset;
|
||||||
while region_info_offset != 0 {
|
while region_info_offset != 0 {
|
||||||
// calculate the offset from the begining of the cap_data based on the offset
|
// calculate the offset from the begining of the cap_data based on the offset
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ license = "Apache-2.0"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
crc32c = "0.6.3"
|
crc32c = "0.6.3"
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
remain = "0.2.5"
|
remain = "0.2.5"
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
uuid = { version = "1.2.1", features = ["v4"] }
|
uuid = { version = "1.2.2", features = ["v4"] }
|
||||||
|
|||||||
@@ -105,8 +105,7 @@ impl Read for Vhdx {
|
|||||||
std::io::Error::new(
|
std::io::Error::new(
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
format!(
|
format!(
|
||||||
"Failed reading {} sectors from VHDx at index {}: {}",
|
"Failed reading {sector_count} sectors from VHDx at index {sector_index}: {e}"
|
||||||
sector_count, sector_index, e
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@@ -130,7 +129,7 @@ impl Write for Vhdx {
|
|||||||
self.vhdx_header.update(&mut self.file).map_err(|e| {
|
self.vhdx_header.update(&mut self.file).map_err(|e| {
|
||||||
std::io::Error::new(
|
std::io::Error::new(
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
format!("Failed to update VHDx header: {}", e),
|
format!("Failed to update VHDx header: {e}"),
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -148,8 +147,7 @@ impl Write for Vhdx {
|
|||||||
std::io::Error::new(
|
std::io::Error::new(
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
format!(
|
format!(
|
||||||
"Failed writing {} sectors on VHDx at index {}: {}",
|
"Failed writing {sector_count} sectors on VHDx at index {sector_index}: {e}"
|
||||||
sector_count, sector_index, e
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ impl DiskSpec {
|
|||||||
.map_err(VhdxMetadataError::ReadMetadata)?;
|
.map_err(VhdxMetadataError::ReadMetadata)?;
|
||||||
|
|
||||||
// MUST be at least 1 MiB and not greater than 256 MiB
|
// MUST be at least 1 MiB and not greater than 256 MiB
|
||||||
if disk_spec.block_size < BLOCK_SIZE_MIN && disk_spec.block_size > BLOCK_SIZE_MAX {
|
if disk_spec.block_size < BLOCK_SIZE_MIN || disk_spec.block_size > BLOCK_SIZE_MAX {
|
||||||
return Err(VhdxMetadataError::InvalidBlockSize);
|
return Err(VhdxMetadataError::InvalidBlockSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,11 +145,7 @@ impl DiskSpec {
|
|||||||
let bits = f
|
let bits = f
|
||||||
.read_u32::<LittleEndian>()
|
.read_u32::<LittleEndian>()
|
||||||
.map_err(VhdxMetadataError::ReadMetadata)?;
|
.map_err(VhdxMetadataError::ReadMetadata)?;
|
||||||
if bits & BLOCK_HAS_PARENT != 0 {
|
disk_spec.has_parent = bits & BLOCK_HAS_PARENT != 0;
|
||||||
disk_spec.has_parent = true;
|
|
||||||
} else {
|
|
||||||
disk_spec.has_parent = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
metadata_presence |= METADATA_FILE_PARAMETER_PRESENT;
|
metadata_presence |= METADATA_FILE_PARAMETER_PRESENT;
|
||||||
} else if metadata_entry.item_id
|
} else if metadata_entry.item_id
|
||||||
|
|||||||
@@ -6,19 +6,19 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
block_util = { path = "../block_util" }
|
block_util = { path = "../block_util" }
|
||||||
clap = { version = "4.0.18", features = ["wrap_help","cargo"] }
|
clap = { version = "4.0.29", features = ["wrap_help","cargo"] }
|
||||||
env_logger = "0.9.3"
|
env_logger = "0.10.0"
|
||||||
epoll = "4.3.1"
|
epoll = "4.3.1"
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
option_parser = { path = "../option_parser" }
|
option_parser = { path = "../option_parser" }
|
||||||
qcow = { path = "../qcow" }
|
qcow = { path = "../qcow" }
|
||||||
vhost = { version = "0.5.0", features = ["vhost-user-slave"] }
|
vhost = { version = "0.6.0", features = ["vhost-user-slave"] }
|
||||||
vhost-user-backend = "0.7.0"
|
vhost-user-backend = "0.8.0"
|
||||||
virtio-bindings = "0.1.0"
|
virtio-bindings = "0.1.0"
|
||||||
virtio-queue = "0.6.1"
|
virtio-queue = "0.7.0"
|
||||||
vm-memory = "0.9.0"
|
vm-memory = "0.10.0"
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
clap = { version = "4.0.18", features = ["cargo"] }
|
clap = { version = "4.0.29", features = ["cargo"] }
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ pub const SYNTAX: &str = "vhost-user-block backend parameters \
|
|||||||
|
|
||||||
impl fmt::Display for Error {
|
impl fmt::Display for Error {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "vhost_user_block_error: {:?}", self)
|
write!(f, "vhost_user_block_error: {self:?}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,7 +504,7 @@ pub fn start_block_backend(backend_command: &str) {
|
|||||||
let backend_config = match VhostUserBlkBackendConfig::parse(backend_command) {
|
let backend_config = match VhostUserBlkBackendConfig::parse(backend_command) {
|
||||||
Ok(config) => config,
|
Ok(config) => config,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Failed parsing parameters {:?}", e);
|
println!("Failed parsing parameters {e:?}");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ authors = ["The Cloud Hypervisor Authors"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.0.18", features = ["wrap_help","cargo"] }
|
clap = { version = "4.0.29", features = ["wrap_help","cargo"] }
|
||||||
env_logger = "0.9.3"
|
env_logger = "0.10.0"
|
||||||
epoll = "4.3.1"
|
epoll = "4.3.1"
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
net_util = { path = "../net_util" }
|
net_util = { path = "../net_util" }
|
||||||
option_parser = { path = "../option_parser" }
|
option_parser = { path = "../option_parser" }
|
||||||
vhost = { version = "0.5.0", features = ["vhost-user-slave"] }
|
vhost = { version = "0.6.0", features = ["vhost-user-slave"] }
|
||||||
vhost-user-backend = "0.7.0"
|
vhost-user-backend = "0.8.0"
|
||||||
virtio-bindings = "0.1.0"
|
virtio-bindings = "0.1.0"
|
||||||
vm-memory = "0.9.0"
|
vm-memory = "0.10.0"
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
clap = { version = "4.0.18", features = ["cargo"] }
|
clap = { version = "4.0.29", features = ["cargo"] }
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,tap=<if_name>\"";
|
|||||||
|
|
||||||
impl fmt::Display for Error {
|
impl fmt::Display for Error {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "vhost_user_net_error: {:?}", self)
|
write!(f, "vhost_user_net_error: {self:?}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,7 +348,7 @@ pub fn start_net_backend(backend_command: &str) {
|
|||||||
let backend_config = match VhostUserNetBackendConfig::parse(backend_command) {
|
let backend_config = match VhostUserNetBackendConfig::parse(backend_command) {
|
||||||
Ok(config) => config,
|
Ok(config) => config,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("Failed parsing parameters {:?}", e);
|
eprintln!("Failed parsing parameters {e:?}");
|
||||||
process::exit(1);
|
process::exit(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,26 +14,26 @@ block_util = { path = "../block_util" }
|
|||||||
byteorder = "1.4.3"
|
byteorder = "1.4.3"
|
||||||
epoll = "4.3.1"
|
epoll = "4.3.1"
|
||||||
event_monitor = { path = "../event_monitor" }
|
event_monitor = { path = "../event_monitor" }
|
||||||
io-uring = "0.5.8"
|
io-uring = "0.5.9"
|
||||||
libc = "0.2.137"
|
libc = "0.2.138"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
net_gen = { path = "../net_gen" }
|
net_gen = { path = "../net_gen" }
|
||||||
net_util = { path = "../net_util" }
|
net_util = { path = "../net_util" }
|
||||||
pci = { path = "../pci" }
|
pci = { path = "../pci" }
|
||||||
rate_limiter = { path = "../rate_limiter" }
|
rate_limiter = { path = "../rate_limiter" }
|
||||||
seccompiler = "0.3.0"
|
seccompiler = "0.3.0"
|
||||||
serde = { version = "1.0.147", features = ["derive"] }
|
serde = { version = "1.0.150", features = ["derive"] }
|
||||||
serde_json = "1.0.87"
|
serde_json = "1.0.89"
|
||||||
serial_buffer = { path = "../serial_buffer" }
|
serial_buffer = { path = "../serial_buffer" }
|
||||||
thiserror = "1.0.37"
|
thiserror = "1.0.37"
|
||||||
versionize = "0.1.6"
|
versionize = "0.1.9"
|
||||||
versionize_derive = "0.1.4"
|
versionize_derive = "0.1.4"
|
||||||
vhost = { version = "0.5.0", features = ["vhost-user-master", "vhost-user-slave", "vhost-kern", "vhost-vdpa"] }
|
vhost = { version = "0.6.0", features = ["vhost-user-master", "vhost-user-slave", "vhost-kern", "vhost-vdpa"] }
|
||||||
virtio-bindings = { version = "0.1.0", features = ["virtio-v5_0_0"] }
|
virtio-bindings = { version = "0.1.0", features = ["virtio-v5_0_0"] }
|
||||||
virtio-queue = "0.6.1"
|
virtio-queue = "0.7.0"
|
||||||
vm-allocator = { path = "../vm-allocator" }
|
vm-allocator = { path = "../vm-allocator" }
|
||||||
vm-device = { path = "../vm-device" }
|
vm-device = { path = "../vm-device" }
|
||||||
vm-memory = { version = "0.9.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
|
vm-memory = { version = "0.10.0", features = ["backend-mmap", "backend-atomic", "backend-bitmap"] }
|
||||||
vm-migration = { path = "../vm-migration" }
|
vm-migration = { path = "../vm-migration" }
|
||||||
vm-virtio = { path = "../vm-virtio" }
|
vm-virtio = { path = "../vm-virtio" }
|
||||||
vmm-sys-util = "0.10.0"
|
vmm-sys-util = "0.11.0"
|
||||||
|
|||||||
@@ -443,6 +443,7 @@ impl Drop for Balloon {
|
|||||||
// Ignore the result because there is nothing we can do about it.
|
// Ignore the result because there is nothing we can do about it.
|
||||||
let _ = kill_evt.write(1);
|
let _ = kill_evt.write(1);
|
||||||
}
|
}
|
||||||
|
self.common.wait_for_epoll_threads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ impl Block {
|
|||||||
let disk_size = disk_image.size().map_err(|e| {
|
let disk_size = disk_image.size().map_err(|e| {
|
||||||
io::Error::new(
|
io::Error::new(
|
||||||
io::ErrorKind::Other,
|
io::ErrorKind::Other,
|
||||||
format!("Failed getting disk size: {}", e),
|
format!("Failed getting disk size: {e}"),
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
if disk_size % SECTOR_SIZE != 0 {
|
if disk_size % SECTOR_SIZE != 0 {
|
||||||
@@ -581,6 +581,7 @@ impl Drop for Block {
|
|||||||
// Ignore the result because there is nothing we can do about it.
|
// Ignore the result because there is nothing we can do about it.
|
||||||
let _ = kill_evt.write(1);
|
let _ = kill_evt.write(1);
|
||||||
}
|
}
|
||||||
|
self.common.wait_for_epoll_threads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -705,6 +705,7 @@ impl Drop for Console {
|
|||||||
// Ignore the result because there is nothing we can do about it.
|
// Ignore the result because there is nothing we can do about it.
|
||||||
let _ = kill_evt.write(1);
|
let _ = kill_evt.write(1);
|
||||||
}
|
}
|
||||||
|
self.common.wait_for_epoll_threads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -781,7 +781,7 @@ impl DmaRemapping for IommuMapping {
|
|||||||
|
|
||||||
Err(io::Error::new(
|
Err(io::Error::new(
|
||||||
io::ErrorKind::Other,
|
io::ErrorKind::Other,
|
||||||
format!("failed to translate GVA addr 0x{:x}", addr),
|
format!("failed to translate GVA addr 0x{addr:x}"),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -809,7 +809,7 @@ impl DmaRemapping for IommuMapping {
|
|||||||
|
|
||||||
Err(io::Error::new(
|
Err(io::Error::new(
|
||||||
io::ErrorKind::Other,
|
io::ErrorKind::Other,
|
||||||
format!("failed to translate GPA addr 0x{:x}", addr),
|
format!("failed to translate GPA addr 0x{addr:x}"),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -985,6 +985,7 @@ impl Drop for Iommu {
|
|||||||
// Ignore the result because there is nothing we can do about it.
|
// Ignore the result because there is nothing we can do about it.
|
||||||
let _ = kill_evt.write(1);
|
let _ = kill_evt.write(1);
|
||||||
}
|
}
|
||||||
|
self.common.wait_for_epoll_threads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user