30ee2c12 | 21-May-2025 |
Philipp Schuster <philipp.schuster@cyberus-technology.de> |
misc: vm-migration: streamline error Display::fmt()
The changes were mostly automatically applied using the Python script mentioned in the first commit of this series.
Signed-off-by: Philipp Schust
misc: vm-migration: streamline error Display::fmt()
The changes were mostly automatically applied using the Python script mentioned in the first commit of this series.
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
show more ...
|
12b72ba3 | 26-May-2025 |
Philipp Schuster <philipp.schuster@cyberus-technology.de> |
ci: bump typos
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com |
20296e90 | 26-May-2025 |
Philipp Schuster <philipp.schuster@cyberus-technology.de> |
misc: streamline thiserror cargo dep
As almost every sub crate depends on thiserror, lets upgrade it to a workspace dependency.
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.
misc: streamline thiserror cargo dep
As almost every sub crate depends on thiserror, lets upgrade it to a workspace dependency.
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
show more ...
|
05968f5c | 09-May-2025 |
Philipp Schuster <philipp.schuster@cyberus-technology.de> |
block: introduce advisory locks for disk image files
# What
This commit introduces file-based advisory locking for the files backing up the block devices by using the fcntl() syscall with OFD locks
block: introduce advisory locks for disk image files
# What
This commit introduces file-based advisory locking for the files backing up the block devices by using the fcntl() syscall with OFD locks. The per-open-file-descriptor (OFD) locks are more robust than traditional POSIX locks (F_SETLK) as they are not tied to process IDs and avoid common issues in multithreaded or multi-fd scenarios [1]. Therefore, we don't use `std::fs::File::try_lock()`, which is backed by F_SETLKW.
The locking mechanism is aware of the `readonly` property and allows `n` readers or `1` writer (exclusive mode).
As the locks are advisory, multiple cloud-hypervisor processes can prevent themselves from writing to the same file. However, this is not a system-wide file-system level locking mechanism preventing to open() a file.
The introduced new locking mechanism does not cover vhost-user devices.
# Why
To prevent misconfiguration and improve safety, it is good practice to protect disk image files with a locking mechanism. Experience and common best practices suggest that advisory locks are preferable over mandatory locks due to better compatibility and fewer pitfalls (in fs space).
The introduced functionality is aligned with the approach taken by QEMU [0], and is also recommended in [1].
# Implementation Details
We need to ensure that not only normal operation keeps working but also state save/resume and live-migration. Especially for live migration, it is crucial that the sender VMM releases the locks when the VM stops so the receiver VMM can acquire them right after that.
Therefore, the locking and releasing happen directly on the block device struct. The device manager knows all block devices and can forward requests to these types.
Last but not least, this commit uses on explicit lock acquiring but implicit lock releasing (FD close). It only explicitly releases the locks where this integrates more smoothly into the existing code.
# Testing
I tested - normal operation - state save/resume, - device hot plugging, - and live-migration with read/shared and write/exclusive locks.
One can use the `fcntl-tool` to test if locks are actually acquired or released [2].
# Links
[0] https://github.com/qemu/qemu/blob/825b96dbcee23d134b691fc75618b59c5f53da32/util/osdep.c#L266 [1] https://apenwarr.ca/log/20101213 [2] https://crates.io/crates/fcntl-tool
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
show more ...
|
3698b8e7 | 01-Apr-2025 |
Jinank Jain <jinankjain@microsoft.com> |
build: Centralize serde_json crate to workspace
`serde_json` crate is referenced by multiple components, centralize it to workspace to better manage this crate.
Signed-off-by: Jinank Jain <jinankja
build: Centralize serde_json crate to workspace
`serde_json` crate is referenced by multiple components, centralize it to workspace to better manage this crate.
Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
show more ...
|
c441bb29 | 19-Feb-2025 |
Ruoqing He <heruoqing@iscas.ac.cn> |
misc: Fix clippy - doc list item overindented
Reported by 1.86.0-beta.1 (f0cb41030 2025-02-17).
Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn> |
eeae63b4 | 02-Jan-2025 |
Rob Bradford <rbradford@rivosinc.com> |
build: Bump thiserror version
Signed-off-by: Rob Bradford <rbradford@rivosinc.com> |
0c2f2d3e | 04-Dec-2024 |
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
build: Bump anyhow from 1.0.87 to 1.0.94
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.87 to 1.0.94. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://gi
build: Bump anyhow from 1.0.87 to 1.0.94
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.87 to 1.0.94. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.87...1.0.94)
--- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ...
Signed-off-by: dependabot[bot] <support@github.com>
show more ...
|
88a9f799 | 29-Sep-2024 |
Rob Bradford <rbradford@rivosinc.com> |
misc: Adapt consistent import style formatting
Historically the Cloud Hypervisor coding style has been to ensure that all imports are ordered and placed in a single group. Unfortunately cargo fmt ha
misc: Adapt consistent import style formatting
Historically the Cloud Hypervisor coding style has been to ensure that all imports are ordered and placed in a single group. Unfortunately cargo fmt has no support for ensuring that all imports are in a single group so if whitespace lines were added as part of the import statements then they would only be odered correctly in the group.
By adopting "group_imports="StdExternalCrate" we can enforce a style where imports are placed in at most three groups for std, external crates and the crate itself. Choosing a style enforceable by the tooling reduces the reviewer burden.
Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
show more ...
|
5a70d7ec | 27-Sep-2024 |
Ruoqing He <heruoqing@iscas.ac.cn> |
build: Centralize rust-vmm crates to workspace
Modify `Cargo.toml` in each member crate to follow the dependencies specified in root `Cargo.toml` file.
Signed-off-by: Ruoqing He <heruoqing@iscas.ac
build: Centralize rust-vmm crates to workspace
Modify `Cargo.toml` in each member crate to follow the dependencies specified in root `Cargo.toml` file.
Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
show more ...
|
d90fa96b | 25-Sep-2024 |
Rob Bradford <rbradford@rivosinc.com> |
build: Bulk update vm-memory and related dependencies
Signed-off-by: Rob Bradford <rbradford@rivosinc.com> |
4e64df10 | 09-Sep-2024 |
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
build: Bump anyhow from 1.0.86 to 1.0.87
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.86 to 1.0.87. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://gi
build: Bump anyhow from 1.0.86 to 1.0.87
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.86 to 1.0.87. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.86...1.0.87)
--- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ...
Signed-off-by: dependabot[bot] <support@github.com>
show more ...
|
60c8a72e | 06-Sep-2024 |
Bo Chen <chen.bo@intel.com> |
misc: Fix various warnings from clippy 0.1.82
An example warning output is:
error: first doc comment paragraph is too long --> virtio-devices/src/lib.rs:158:1 | 158 | / /// Convert an absolu
misc: Fix various warnings from clippy 0.1.82
An example warning output is:
error: first doc comment paragraph is too long --> virtio-devices/src/lib.rs:158:1 | 158 | / /// Convert an absolute address into an address space (GuestMemory) 159 | | /// to a host pointer and verify that the provided size define a valid 160 | | /// range within a single memory region. 161 | | /// Return None if it is out of bounds or if addr+size overlaps a single region. | |_ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph = note: `-D clippy::too-long-first-doc-paragraph` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]`
Signed-off-by: Bo Chen <chen.bo@intel.com>
show more ...
|
a229afbc | 16-Aug-2024 |
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
build: Bump serde from 1.0.203 to 1.0.208
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.208. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://
build: Bump serde from 1.0.203 to 1.0.208
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.208. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.208)
--- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ...
Signed-off-by: dependabot[bot] <support@github.com>
show more ...
|
ddc3f194 | 25-Jul-2024 |
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
build: Bump anyhow from 1.0.81 to 1.0.86
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.81 to 1.0.86. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://gi
build: Bump anyhow from 1.0.81 to 1.0.86
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.81 to 1.0.86. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.81...1.0.86)
--- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ...
Signed-off-by: dependabot[bot] <support@github.com>
show more ...
|
0fbb3e2c | 24-Jul-2024 |
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
build: Bump serde_json from 1.0.115 to 1.0.120
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.115 to 1.0.120. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](
build: Bump serde_json from 1.0.115 to 1.0.120
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.115 to 1.0.120. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.115...v1.0.120)
--- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ...
Signed-off-by: dependabot[bot] <support@github.com>
show more ...
|
8803e4a2 | 16-Jul-2024 |
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
build: Bump thiserror from 1.0.61 to 1.0.62
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.61 to 1.0.62. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits
build: Bump thiserror from 1.0.61 to 1.0.62
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.61 to 1.0.62. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.61...1.0.62)
--- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ...
Signed-off-by: dependabot[bot] <support@github.com>
show more ...
|
e97cee99 | 05-Jul-2024 |
Rob Bradford <rbradford@rivosinc.com> |
vm-migration: Introduce Response::ok_or_abandon()
This method will return the existing Response if the status is successful (Status::Ok) otherwise issue a command to abandon the migration and return
vm-migration: Introduce Response::ok_or_abandon()
This method will return the existing Response if the status is successful (Status::Ok) otherwise issue a command to abandon the migration and return the desired error.
Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
show more ...
|
08cf983d | 18-Jun-2024 |
Rob Bradford <rbradford@rivosinc.com> |
build: Fix Cargo.toml formatting
In 42e9632c53d14cd0040db4952d40ba806c4b6ee9 a fix was made to address a typo in the taplo configuration file. Fixing this typo indicated that many Cargo.toml files w
build: Fix Cargo.toml formatting
In 42e9632c53d14cd0040db4952d40ba806c4b6ee9 a fix was made to address a typo in the taplo configuration file. Fixing this typo indicated that many Cargo.toml files were no longer adhering to the formatting rules. Fix the formatting by running `taplo fmt`.
Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
show more ...
|
3f8cd52f | 08-May-2024 |
Rob Bradford <rbradford@rivosinc.com> |
build: Format Cargo.toml files using taplo
Run the taplo formatter with the newly added configuration file
Signed-off-by: Rob Bradford <rbradford@rivosinc.com> |
a70808ba | 07-May-2024 |
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
build: Bump thiserror from 1.0.58 to 1.0.60
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.58 to 1.0.60. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits
build: Bump thiserror from 1.0.58 to 1.0.60
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.58 to 1.0.60. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.58...1.0.60)
--- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ...
Signed-off-by: dependabot[bot] <support@github.com>
show more ...
|
10ab87d6 | 07-Apr-2024 |
Rob Bradford <rbradford@rivosinc.com> |
misc: Migrate away from versionize
Replace with serde instead.
Fixes: #6370
Signed-off-by: Rob Bradford <rbradford@rivosinc.com> |
7966925c | 06-Apr-2024 |
Rob Bradford <rbradford@rivosinc.com> |
build: Bulk update dependencies
Signed-off-by: Rob Bradford <rbradford@rivosinc.com> |
fa7a000d | 02-Apr-2024 |
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
build: Bump vm-memory from 0.14.0 to 0.14.1
Bumps [vm-memory](https://github.com/rust-vmm/vm-memory) from 0.14.0 to 0.14.1. - [Release notes](https://github.com/rust-vmm/vm-memory/releases) - [Chang
build: Bump vm-memory from 0.14.0 to 0.14.1
Bumps [vm-memory](https://github.com/rust-vmm/vm-memory) from 0.14.0 to 0.14.1. - [Release notes](https://github.com/rust-vmm/vm-memory/releases) - [Changelog](https://github.com/rust-vmm/vm-memory/blob/v0.14.1/CHANGELOG.md) - [Commits](https://github.com/rust-vmm/vm-memory/compare/v0.14.0...v0.14.1)
--- updated-dependencies: - dependency-name: vm-memory dependency-type: direct:production update-type: version-update:semver-patch ...
Signed-off-by: dependabot[bot] <support@github.com>
show more ...
|
b072671e | 01-Mar-2024 |
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
build: Bump serde_json from 1.0.109 to 1.0.114
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.109 to 1.0.114. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](
build: Bump serde_json from 1.0.109 to 1.0.114
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.109 to 1.0.114. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.109...v1.0.114)
--- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ...
Signed-off-by: dependabot[bot] <support@github.com>
show more ...
|