1# Contributing to Cloud Hypervisor 2 3Cloud Hypervisor is an open source project licensed under the [Apache v2 4License](https://opensource.org/licenses/Apache-2.0) and the [BSD 3 5Clause](https://opensource.org/licenses/BSD-3-Clause) license. Contributions 6can be made under either license or both. Individual files contain details of 7their licensing and changes to that file are under the same license unless the 8contribution changes the license of the file. When importing code from a third 9party project (e.g. Firecracker or CrosVM) please respect the license of those 10projects. 11 12## Coding Style 13 14We follow the [Rust Style](https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/guide.md) 15convention and enforce it through the Continuous Integration (CI) process calling into `rustfmt` 16for each submitted Pull Request (PR). 17 18## Certificate of Origin 19 20In order to get a clear contribution chain of trust we use the [signed-off-by language](https://01.org/community/signed-process) 21used by the Linux kernel project. 22 23## Patch format 24 25Beside the signed-off-by footer, we expect each patch to comply with the following format: 26 27``` 28<component>: Change summary 29 30More detailed explanation of your changes: Why and how. 31Wrap it to 72 characters. 32See http://chris.beams.io/posts/git-commit/ 33for some more good pieces of advice. 34 35Signed-off-by: <contributor@foo.com> 36``` 37 38For example: 39 40``` 41vm-virtio: Reset underlying device on driver request 42 43If the driver triggers a reset by writing zero into the status register 44then reset the underlying device if supported. A device reset also 45requires resetting various aspects of the queue. 46 47In order to be able to do a subsequent reactivate it is required to 48reclaim certain resources (interrupt and queue EventFDs.) If a device 49reset is requested by the driver but the underlying device does not 50support it then generate an error as the driver would not be able to 51configure it anyway. 52 53Signed-off-by: Rob Bradford <robert.bradford@intel.com> 54``` 55 56## Pull requests 57 58Cloud Hypervisor uses the “fork-and-pull” development model. Follow these steps if 59you want to merge your changes to `cloud-hypervisor`: 60 611. Fork the [cloud-hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor) project 62 into your github organization. 632. Within your fork, create a branch for your contribution. 643. [Create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) 65 against the main branch of the Cloud Hypervisor repository. 664. Add reviewers to your pull request and then work with your reviewers to address 67 any comments and obtain minimum of 2 [maintainers](MAINTAINERS.md) approvals. 68 To update your pull request amend existing commits whenever applicable and 69 then push the new changes to your pull request branch. 705. Once the pull request is approved, one of the maintainers will merge it. 71 72## Issue tracking 73 74If you have a problem, please let us know. We recommend using 75[github issues](https://github.com/cloud-hypervisor/cloud-hypervisor/issues/new) for formally 76reporting and documenting them. 77 78To quickly and informally bring something up to us, you can also reach out on [Slack](https://cloud-hypervisor.slack.com). 79 80## Closing issues 81 82You can either close issues manually by adding the fixing commit SHA1 to the issue 83comments or by adding the `Fixes` keyword to your commit message: 84 85``` 86serial: Set terminal in raw mode 87 88In order to have proper output from the serial, we need to setup the 89terminal in raw mode. When the VM is shutting down, it is also the 90VMM responsibility to set the terminal back into canonical mode if we 91don't want to get any weird behavior from the shell. 92 93Fixes #88 94 95Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> 96``` 97 98Then, after the corresponding PR is merged, Github will automatically close that issue when parsing the 99[commit message](https://help.github.com/articles/closing-issues-via-commit-messages/). 100