History log of /cloud-hypervisor/src/main.rs (Results 1 – 25 of 399)
Revision Date Author Comments
# 190a11f2 10-Jun-2025 Philipp Schuster <philipp.schuster@cyberus-technology.de>

ch-remote: also pretty-print remote server errors

Remote server errors are transferred as raw HTTP body. This way,
we lose the nested structured error information.

This is an attempt to retrieve th

ch-remote: also pretty-print remote server errors

Remote server errors are transferred as raw HTTP body. This way,
we lose the nested structured error information.

This is an attempt to retrieve the errors from the HTTP response
and to align the output with the normal error output.

For example, this produces the following chain of errors. Note
that everything after level 0 was retrieved from the HTTP server
response:

```
Error: ch-remote exited with the following chain of errors:
0: http client error
1: Server responded with InternalServerError
2: Error from API
3: The disk could not be added to the VM
4: Failed to validate config
5: Identifier disk1 is not unique

Debug Info: HttpApiClient(ServerResponse(InternalServerError, Some("Error from API<br>The disk could not be added to the VM<br>Failed to validate config<br>Identifier disk1 is not unique")))
```

In case the JSON can't be parsed properly, ch-remote will print:

```
Error: ch-remote exited with the following chain of errors:
0: http client error
X: Can't get remote's error messages from JSON response: EOF while parsing a value at line 1 column 0: body=''

Debug Info: HttpApiClient(ServerResponse(InternalServerError, Some("")))
```

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com

show more ...


# 060c9de0 19-May-2025 Philipp Schuster <philipp.schuster@cyberus-technology.de>

vmm: introduce nice error messages on exit (CHV and ch-remote)

With the foundations of each error type implementing std::error::Error,
we can now nicely walk the `.source()` chain and print an error

vmm: introduce nice error messages on exit (CHV and ch-remote)

With the foundations of each error type implementing std::error::Error,
we can now nicely walk the `.source()` chain and print an error trace.

This commit introduces improved user-facing error printing when:
- Cloud Hypervisor fails with an error
- ch-remote fails (client error)
- ch-remote fails (remote error)

The additional context is a clear improvement in UX for both users and
developers. In the following example, the new behaviour is shown for
a direct invocation of Cloud Hypervisor leading to a failure. This
looks similar for ch-remote.

```
Old Style
`target/release/cloud-hypervisor --api-socket /tmp/chv2.sock --kernel /etc/bootitems/linux/kernel_minimal/stable.bzImage --cmdline console=ttyS0 --serial tty --console off --disk path=img.raw --initramfs /etc/bootitems/linux/initrd_minimal/default`

Error booting VM: VmBoot(LockingError(BlockError(LockDiskImage(AlreadyLocked)))
```

```
`target/release/cloud-hypervisor --api-socket /tmp/chv2.sock --kernel /etc/bootitems/linux/kernel_minimal/stable.bzImage --cmdline console=ttyS0 --serial tty --console off --disk path=img.raw --initramfs
/etc/bootitems/linux/initrd_minimal/default`

Error: Cloud Hypervisor exited with the following chain of errors:
0: Error booting VM
1: The VM could not boot
2: Error locking disk images: Another instance likely holds a lock
3: Cannot lock images of all block devices
4: Failed to get Write lock for disk image: ./img.raw
5: The file is already locked

Debug Info: VmBoot(VmBoot(LockingError(DiskLockError(LockDiskImage { error: AlreadyLocked, lock_type: Write, path: "./raw_disk.bin" })))
```

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com

show more ...


# 1b03e591 21-May-2025 Philipp Schuster <philipp.schuster@cyberus-technology.de>

misc: 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.sc

misc: 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 ...


# 53e9c94e 13-Jun-2025 Philipp Schuster <philipp.schuster@cyberus-technology.de>

tests: cleanup test_util module

We can remove the `tests` module as the entire file is only
available when running tests.

Follow-up of #7130 / 1f13165faed29e0eca1a38358bd7356b322f6f55.

Signed-off-

tests: cleanup test_util module

We can remove the `tests` module as the entire file is only
available when running tests.

Follow-up of #7130 / 1f13165faed29e0eca1a38358bd7356b322f6f55.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com

show more ...


# 1f13165f 11-Jun-2025 Philipp Schuster <philipp.schuster@cyberus-technology.de>

tests: prepare common test infrastructure for CLI args

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com


# fff62d93 19-May-2025 Philipp Schuster <philipp.schuster@cyberus-technology.de>

misc: vmm: streamline #[source] and Error

This streamlines the code base to follow best practices for
error handling in Rust: Each error struct implements
std::error::Error (most due via thiserror::

misc: vmm: streamline #[source] and Error

This streamlines the code base to follow best practices for
error handling in Rust: Each error struct implements
std::error::Error (most due via thiserror::Error derive macro)
and sets its source accordingly.

This allows future work that nicely prints the error chains,
for example.

So far, the convention is that each error prints its
sub error as part of its Display::fmt() impl.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com

show more ...


# a2123439 19-May-2025 Philipp Schuster <philipp.schuster@cyberus-technology.de>

misc: arch/riscv64: streamline #[source] and Error

This streamlines the code base to follow best practices for
error handling in Rust: Each error struct implements
std::error::Error (most due via th

misc: arch/riscv64: streamline #[source] and Error

This streamlines the code base to follow best practices for
error handling in Rust: Each error struct implements
std::error::Error (most due via thiserror::Error derive macro)
and sets its source accordingly.

This allows future work that nicely prints the error chains,
for example.

So far, the convention is that each error prints its
sub error as part of its Display::fmt() impl.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com

show more ...


# fa58b725 18-Mar-2025 Philipp Schuster <philipp.schuster@cyberus-technology.de>

vmm: alphabetically sort CLI options in --help output

The CLI has grown to a big variety of options. clap prints them in the
help message (--help) in the order they were defined. We now are at a
poi

vmm: alphabetically sort CLI options in --help output

The CLI has grown to a big variety of options. clap prints them in the
help message (--help) in the order they were defined. We now are at a
point where grouping things logically together doesn't work well.
Further, there is no support by clap for logical grouping and the
current code base wasn't consistent. Therefore, this commit introduces
two changes:

- a new structure to define arguments (all in an array)
- an alphabetical ordering of the arguments

No other changes have been made. No options have been altered.

This significantly improves:
- code maintainability and extensibility
- readability of the --help output

A unit test ensures they stay sorted. A better approach to check if the
list of arguments (known at build time) is sorted would be a compile
time check (`const`), but this currently isn't possible in stable Rust.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com

show more ...


# 74ca38f7 08-Jan-2025 Nikolay Edigaryev <edigaryev@gmail.com>

vmm: introduce platform option to limit maximum IOMMU address width

Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>


# 2ef04671 07-Nov-2024 Rob Bradford <rbradford@rivosinc.com>

main: Place `--tpm` in the correct argument group

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>


# 453bc319 07-Nov-2024 Rob Bradford <rbradford@rivosinc.com>

main: Require a payload to boot when any VM argument provided

If any VM argument (e.g. --disk) is provided require some payload (e.g.
--kernel or --firmware) when parsing the command line arguments.

main: Require a payload to boot when any VM argument provided

If any VM argument (e.g. --disk) is provided require some payload (e.g.
--kernel or --firmware) when parsing the command line arguments.

See: #6831

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>

show more ...


# 33c15ca2 30-Sep-2024 Songqian Li <sionli@tencent.com>

vmm: remove pub use vm_config in config

This patch removes pub import vm_config in config.rs to eliminate
the ambiguity of vm_comfig reference.

Signed-off-by: Songqian Li <sionli@tencent.com>


# 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 ...


# cc9899e0 18-Sep-2024 Songqian Li <sionli@tencent.com>

vmm: remove unused mutex in api

This patch removes locks in VmCreate request and VmInfo response
since we needn't use a lock here and should ensure that internal
implementation is transparent to the

vmm: remove unused mutex in api

This patch removes locks in VmCreate request and VmInfo response
since we needn't use a lock here and should ensure that internal
implementation is transparent to the runtime.

Signed-off-by: Songqian Li <sionli@tencent.com>

show more ...


# 5f18ac3b 25-Oct-2023 Yuanchu Xie <yuanchu@google.com>

devices: Add pvmemcontrol device

Pvmemcontrol provides a way for the guest to control its physical memory
properties, and enables optimizations and security features. For
example, the guest can prov

devices: Add pvmemcontrol device

Pvmemcontrol provides a way for the guest to control its physical memory
properties, and enables optimizations and security features. For
example, the guest can provide information to the host where parts of a
hugepage may be unbacked, or sensitive data may not be swapped out, etc.

Pvmemcontrol allows guests to manipulate its gPTE entries in the SLAT,
and also some other properties of the memory map the back's host memory.
This is achieved by using the KVM_CAP_SYNC_MMU capability. When this
capability is available, the changes in the backing of the memory region
on the host are automatically reflected into the guest. For example, an
mmap() or madvise() that affects the region will be made visible
immediately.

There are two components of the implementation: the guest Linux driver
and Virtual Machine Monitor (VMM) device. A guest-allocated shared
buffer is negotiated per-cpu through a few PCI MMIO registers, the VMM
device assigns a unique command for each per-cpu buffer. The guest
writes its pvmemcontrol request in the per-cpu buffer, then writes the
corresponding command into the command register, calling into the VMM
device to perform the pvmemcontrol request.

The synchronous per-cpu shared buffer approach avoids the kick and busy
waiting that the guest would have to do with virtio virtqueue transport.

The Cloud Hypervisor component can be enabled with --pvmemcontrol.

Co-developed-by: Stanko Novakovic <stanko@google.com>
Co-developed-by: Pasha Tatashin <tatashin@google.com>
Signed-off-by: Yuanchu Xie <yuanchu@google.com>

show more ...


# bd180bc3 01-Aug-2024 Praveen K Paladugu <prapal@linux.microsoft.com>

main: rename landlock_config to landlock_rules

To keep the naming consistent, rename all uses of landlock_config
to landlock_rules.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>


# d2f0e8ae 30-Jul-2024 Praveen K Paladugu <prapal@linux.microsoft.com>

Revert "vmm: make landlock configs VMM-level config"

This reverts commit 94929889ac2489015d60ca1480a5d412e2792c57.
This revert moves landlock config back to VMConfig.

Signed-off-by: Praveen K Palad

Revert "vmm: make landlock configs VMM-level config"

This reverts commit 94929889ac2489015d60ca1480a5d412e2792c57.
This revert moves landlock config back to VMConfig.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>

show more ...


# 94929889 02-Jul-2024 Wei Liu <liuwe@microsoft.com>

vmm: make landlock configs VMM-level config

This requires stashing the config values in `struct Vmm`. The configs
should be validated before before creating the VMM thread. Refactor the
code and upd

vmm: make landlock configs VMM-level config

This requires stashing the config values in `struct Vmm`. The configs
should be validated before before creating the VMM thread. Refactor the
code and update documentation where necessary.

The place where the rules are applied remain the same.

Signed-off-by: Wei Liu <liuwe@microsoft.com>

show more ...


# 11c17ca3 09-Apr-2024 Praveen K Paladugu <prapal@linux.microsoft.com>

main: Enable landlock on main thread

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>


# 130c9883 13-Feb-2024 Praveen K Paladugu <prapal@linux.microsoft.com>

vmm: Enable Landlock on signal-handler thread

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>


# 8c76a3e4 12-Feb-2024 Praveen K Paladugu <prapal@linux.microsoft.com>

vmm: Enable Landlock on event-monitor thread

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>


# 1d89f98e 15-Feb-2024 Praveen K Paladugu <prapal@linux.microsoft.com>

vmm: Introduce landlock-rules cmdline param

Users can use this parameter to pass extra paths that 'vmm' and its
child threads can use at runtime. Hotplug is the primary usecase for
this parameter.

vmm: Introduce landlock-rules cmdline param

Users can use this parameter to pass extra paths that 'vmm' and its
child threads can use at runtime. Hotplug is the primary usecase for
this parameter.

In order to hotplug devices that use local files: disks, memory zones,
pmem devices etc, users can use this option to pass the path/s that will
be used during hotplug while starting cloud-hypervisor. Doing this will
allow landlock to add required rules to grant access to these paths when
cloud-hypervisor process starts.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Wei Liu <liuwe@microsoft.com>

show more ...


# 287dbd4f 13-Feb-2024 Praveen K Paladugu <prapal@linux.microsoft.com>

vmm: Introduce landlock cmdline parameter

Users can use this cmdline option to enable/disable Landlock based
sandboxing while running cloud-hypervisor.

Signed-off-by: Praveen K Paladugu <prapal@lin

vmm: Introduce landlock cmdline parameter

Users can use this cmdline option to enable/disable Landlock based
sandboxing while running cloud-hypervisor.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>

show more ...


# 42e9632c 07-Jun-2024 Josh Soref <2119212+jsoref@users.noreply.github.com>

misc: Fix spelling issues

Misspellings were identified by:
https://github.com/marketplace/actions/check-spelling

* Initial corrections based on forbidden patterns from the action
* Additional cor

misc: Fix spelling issues

Misspellings were identified by:
https://github.com/marketplace/actions/check-spelling

* Initial corrections based on forbidden patterns from the action
* Additional corrections by Google Chrome auto-suggest
* Some manual corrections
* Adding markdown bullets to readme credits section

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

show more ...


# 091ce854 28-May-2024 Alexandru Matei <alexandru.matei@uipath.com>

main: update expand_fdtable comment

Updated the comment so it is sync with the code

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>


12345678910>>...16