microsoft/openvmm

Public

mirrored fromhttps://github.com/microsoft/openvmmAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
ef598e5dbee969896aec0c2a72b77800cbedaa14

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/copilot-instructions.md

29lines · modecode

1This is a Rust based repository. Please follow these guidelines when contributing:
2
3## Code Standards
4
5### Required Before Each Commit
6- Run `cargo xtask fmt --fix` before committing any changes to ensure proper code formatting.
7- This will ensure all source code and generated pipeline files maintain consistent style and content.
8- Cross-compile by targeting `x86_64` and `aarch64` processors, and Windows and Linux environments.
9
10## Key Guidelines
111. Follow Rust best practices and idiomatic patterns.
122. Maintain existing code structure and organization.
133. Write unit tests for new functionality.
144. Document public APIs and complex logic. Suggest changes to the `Guide/` folder when appropriate.
15
16## Domain-specific Guidelines
17Both OpenVMM and OpenHCL processes data from untrusted sources. OpenHCL runs in a constrained environment.
18
19When possible:
201. Avoid `unsafe` code.
212. Avoid taking new external dependencies, or those that can significantly increase binary size.
22
23## Testing
24The OpenVMM project contains several types of tests.
25- **Unit tests** are spread throughout crates, and are marked by a `#[cfg(test)]` code block.
26- **VMM tests** are integration tests. These are found in the `vmm_tests` folder, and use the code in `petri` as a framework to help create Hyper-V and OpenVMM based VMs.
27- **Fuzz tests** are nondeterminstic, and are used to ensure that the code does not panic across trust boundaries.
28
29Whenever possible, thoroughly test the code with unit tests. Add a test case to the VMM tests if there is an interesting integration point.
30