xref: /qemu/docs/devel/submitting-a-patch.rst (revision 0e3aff9ec34059512d597eacfcf4d1b5d4570c50)
1cd6b1674SKashyap Chamarthy.. _submitting-a-patch:
2cd6b1674SKashyap Chamarthy
39f73de8dSKashyap ChamarthySubmitting a Patch
49f73de8dSKashyap Chamarthy==================
59f73de8dSKashyap Chamarthy
6115847f6SAlex BennéeQEMU welcomes contributions to fix bugs, add functionality or improve
7115847f6SAlex Bennéethe documentation. However, we get a lot of patches, and so we have
8115847f6SAlex Bennéesome guidelines about submitting them. If you follow these, you'll
9115847f6SAlex Bennéehelp make our task of contribution review easier and your change is
10115847f6SAlex Bennéelikely to be accepted and committed faster.
119f73de8dSKashyap Chamarthy
129f73de8dSKashyap ChamarthyThis page seems very long, so if you are only trying to post a quick
139f73de8dSKashyap Chamarthyone-shot fix, the bare minimum we ask is that:
149f73de8dSKashyap Chamarthy
15ca127fe9SAlex Bennée.. list-table:: Minimal Checklist for Patches
16ca127fe9SAlex Bennée   :widths: 35 65
17ca127fe9SAlex Bennée   :header-rows: 1
18ca127fe9SAlex Bennée
19ca127fe9SAlex Bennée   * - Check
20ca127fe9SAlex Bennée     - Reason
21270c81b7SDaniel P. Berrangé   * - Patches contain Signed-off-by: Your Name <author@email>
22ca127fe9SAlex Bennée     - States you are legally able to contribute the code. See :ref:`patch_emails_must_include_a_signed_off_by_line`
23ca127fe9SAlex Bennée   * - Sent as patch emails to ``qemu-devel@nongnu.org``
24ca127fe9SAlex Bennée     - The project uses an email list based workflow. See :ref:`submitting_your_patches`
25ca127fe9SAlex Bennée   * - Be prepared to respond to review comments
26ca127fe9SAlex Bennée     - Code that doesn't pass review will not get merged. See :ref:`participating_in_code_review`
279f73de8dSKashyap Chamarthy
289f73de8dSKashyap ChamarthyYou do not have to subscribe to post (list policy is to reply-to-all to
299f73de8dSKashyap Chamarthypreserve CCs and keep non-subscribers in the loop on the threads they
309f73de8dSKashyap Chamarthystart), although you may find it easier as a subscriber to pick up good
319f73de8dSKashyap Chamarthyideas from other posts. If you do subscribe, be prepared for a high
329f73de8dSKashyap Chamarthyvolume of email, often over one thousand messages in a week. The list is
339f73de8dSKashyap Chamarthymoderated; first-time posts from an email address (whether or not you
349f73de8dSKashyap Chamarthysubscribed) may be subject to some delay while waiting for a moderator
352d2e4843SThomas Huthto allow your address.
369f73de8dSKashyap Chamarthy
379f73de8dSKashyap ChamarthyThe larger your contribution is, or if you plan on becoming a long-term
389f73de8dSKashyap Chamarthycontributor, then the more important the rest of this page becomes.
399f73de8dSKashyap ChamarthyReading the table of contents below should already give you an idea of
409f73de8dSKashyap Chamarthythe basic requirements. Use the table of contents as a reference, and
419f73de8dSKashyap Chamarthyread the parts that you have doubts about.
429f73de8dSKashyap Chamarthy
43cd6b1674SKashyap Chamarthy.. contents:: Table of Contents
44cd6b1674SKashyap Chamarthy
459f73de8dSKashyap Chamarthy.. _writing_your_patches:
469f73de8dSKashyap Chamarthy
479f73de8dSKashyap ChamarthyWriting your Patches
489f73de8dSKashyap Chamarthy--------------------
499f73de8dSKashyap Chamarthy
509f73de8dSKashyap Chamarthy.. _use_the_qemu_coding_style:
519f73de8dSKashyap Chamarthy
529f73de8dSKashyap ChamarthyUse the QEMU coding style
539f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~
549f73de8dSKashyap Chamarthy
559f73de8dSKashyap ChamarthyYou can run run *scripts/checkpatch.pl <patchfile>* before submitting to
569f73de8dSKashyap Chamarthycheck that you are in compliance with our coding standards. Be aware
579f73de8dSKashyap Chamarthythat ``checkpatch.pl`` is not infallible, though, especially where C
589f73de8dSKashyap Chamarthypreprocessor macros are involved; use some common sense too. See also:
599f73de8dSKashyap Chamarthy
60cd6b1674SKashyap Chamarthy-  :ref:`coding-style`
619f73de8dSKashyap Chamarthy-  `Automate a checkpatch run on
62cd6b1674SKashyap Chamarthy   commit <https://blog.vmsplice.net/2011/03/how-to-automatically-run-checkpatchpl.html>`__
639f73de8dSKashyap Chamarthy
649f73de8dSKashyap Chamarthy.. _base_patches_against_current_git_master:
659f73de8dSKashyap Chamarthy
669f73de8dSKashyap ChamarthyBase patches against current git master
679f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
689f73de8dSKashyap Chamarthy
699f73de8dSKashyap ChamarthyThere's no point submitting a patch which is based on a released version
709f73de8dSKashyap Chamarthyof QEMU because development will have moved on from then and it probably
719f73de8dSKashyap Chamarthywon't even apply to master. We only apply selected bugfixes to release
729f73de8dSKashyap Chamarthybranches and then only as backports once the code has gone into master.
739f73de8dSKashyap Chamarthy
74cd6b1674SKashyap ChamarthyIt is also okay to base patches on top of other on-going work that is
75cd6b1674SKashyap Chamarthynot yet part of the git master branch. To aid continuous integration
76cd6b1674SKashyap Chamarthytools, such as `patchew <http://patchew.org/QEMU/>`__, you should `add a
77cd6b1674SKashyap Chamarthytag <https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg01288.html>`__
78cd6b1674SKashyap Chamarthyline ``Based-on: $MESSAGE_ID`` to your cover letter to make the series
79cd6b1674SKashyap Chamarthydependency obvious.
80cd6b1674SKashyap Chamarthy
819f73de8dSKashyap Chamarthy.. _split_up_long_patches:
829f73de8dSKashyap Chamarthy
839f73de8dSKashyap ChamarthySplit up long patches
849f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~
859f73de8dSKashyap Chamarthy
869f73de8dSKashyap ChamarthySplit up longer patches into a patch series of logical code changes.
879f73de8dSKashyap ChamarthyEach change should compile and execute successfully. For instance, don't
889f73de8dSKashyap Chamarthyadd a file to the makefile in patch one and then add the file itself in
899f73de8dSKashyap Chamarthypatch two. (This rule is here so that people can later use tools like
909f73de8dSKashyap Chamarthy`git bisect <http://git-scm.com/docs/git-bisect>`__ without hitting
919f73de8dSKashyap Chamarthypoints in the commit history where QEMU doesn't work for reasons
929f73de8dSKashyap Chamarthyunrelated to the bug they're chasing.) Put documentation first, not
939f73de8dSKashyap Chamarthylast, so that someone reading the series can do a clean-room evaluation
949f73de8dSKashyap Chamarthyof the documentation, then validate that the code matched the
959f73de8dSKashyap Chamarthydocumentation. A commit message that mentions "Also, ..." is often a
969f73de8dSKashyap Chamarthygood candidate for splitting into multiple patches. For more thoughts on
979f73de8dSKashyap Chamarthyproperly splitting patches and writing good commit messages, see `this
989f73de8dSKashyap Chamarthyadvice from
999f73de8dSKashyap ChamarthyOpenStack <https://wiki.openstack.org/wiki/GitCommitMessages>`__.
1009f73de8dSKashyap Chamarthy
1019f73de8dSKashyap Chamarthy.. _make_code_motion_patches_easy_to_review:
1029f73de8dSKashyap Chamarthy
1039f73de8dSKashyap ChamarthyMake code motion patches easy to review
1049f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1059f73de8dSKashyap Chamarthy
1069f73de8dSKashyap ChamarthyIf a series requires large blocks of code motion, there are tricks for
1079f73de8dSKashyap Chamarthymaking the refactoring easier to review. Split up the series so that
1089f73de8dSKashyap Chamarthysemantic changes (or even function renames) are done in a separate patch
109cd6b1674SKashyap Chamarthyfrom the raw code motion. Use a one-time setup of ``git config
110cd6b1674SKashyap Chamarthydiff.renames true;`` ``git config diff.algorithm patience`` (refer to
111cd6b1674SKashyap Chamarthy`git-config <http://git-scm.com/docs/git-config>`__). The 'diff.renames'
112cd6b1674SKashyap Chamarthyproperty ensures file rename patches will be given in a more compact
113cd6b1674SKashyap Chamarthyrepresentation that focuses only on the differences across the file
114cd6b1674SKashyap Chamarthyrename, instead of showing the entire old file as a deletion and the new
115cd6b1674SKashyap Chamarthyfile as an insertion. Meanwhile, the 'diff.algorithm' property ensures
116cd6b1674SKashyap Chamarthythat extracting a non-contiguous subset of one file into a new file, but
117cd6b1674SKashyap Chamarthywhere all extracted parts occur in the same order both before and after
118cd6b1674SKashyap Chamarthythe patch, will reduce churn in trying to treat unrelated ``}`` lines in
119cd6b1674SKashyap Chamarthythe original file as separating hunks of changes.
1209f73de8dSKashyap Chamarthy
1219f73de8dSKashyap ChamarthyIdeally, a code motion patch can be reviewed by doing::
1229f73de8dSKashyap Chamarthy
1239f73de8dSKashyap Chamarthy    git format-patch --stdout -1 > patch;
1249f73de8dSKashyap Chamarthy    diff -u <(sed -n 's/^-//p' patch) <(sed -n 's/^\+//p' patch)
1259f73de8dSKashyap Chamarthy
1269f73de8dSKashyap Chamarthyto focus on the few changes that weren't wholesale code motion.
1279f73de8dSKashyap Chamarthy
1289f73de8dSKashyap Chamarthy.. _dont_include_irrelevant_changes:
1299f73de8dSKashyap Chamarthy
1309f73de8dSKashyap ChamarthyDon't include irrelevant changes
1319f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1329f73de8dSKashyap Chamarthy
1339f73de8dSKashyap ChamarthyIn particular, don't include formatting, coding style or whitespace
1349f73de8dSKashyap Chamarthychanges to bits of code that would otherwise not be touched by the
1359f73de8dSKashyap Chamarthypatch. (It's OK to fix coding style issues in the immediate area (few
1369f73de8dSKashyap Chamarthylines) of the lines you're changing.) If you think a section of code
1379f73de8dSKashyap Chamarthyreally does need a reindent or other large-scale style fix, submit this
1389f73de8dSKashyap Chamarthyas a separate patch which makes no semantic changes; don't put it in the
1399f73de8dSKashyap Chamarthysame patch as your bug fix.
1409f73de8dSKashyap Chamarthy
1419f73de8dSKashyap ChamarthyFor smaller patches in less frequently changed areas of QEMU, consider
142cd6b1674SKashyap Chamarthyusing the :ref:`trivial-patches` process.
1439f73de8dSKashyap Chamarthy
1449f73de8dSKashyap Chamarthy.. _write_a_meaningful_commit_message:
1459f73de8dSKashyap Chamarthy
1469f73de8dSKashyap ChamarthyWrite a meaningful commit message
1479f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1489f73de8dSKashyap Chamarthy
1499f73de8dSKashyap ChamarthyCommit messages should be meaningful and should stand on their own as a
1509f73de8dSKashyap Chamarthyhistorical record of why the changes you applied were necessary or
1519f73de8dSKashyap Chamarthyuseful.
1529f73de8dSKashyap Chamarthy
1539f73de8dSKashyap ChamarthyQEMU follows the usual standard for git commit messages: the first line
1549f73de8dSKashyap Chamarthy(which becomes the email subject line) is "subsystem: single line
1559f73de8dSKashyap Chamarthysummary of change". Whether the "single line summary of change" starts
1569f73de8dSKashyap Chamarthywith a capital is a matter of taste, but we prefer that the summary does
157cd6b1674SKashyap Chamarthynot end in a dot. Look at ``git shortlog -30`` for an idea of sample
1589f73de8dSKashyap Chamarthysubject lines. Then there is a blank line and a more detailed
1599f73de8dSKashyap Chamarthydescription of the patch, another blank and your Signed-off-by: line.
1609f73de8dSKashyap ChamarthyPlease do not use lines that are longer than 76 characters in your
1619f73de8dSKashyap Chamarthycommit message (so that the text still shows up nicely with "git show"
1629f73de8dSKashyap Chamarthyin a 80-columns terminal window).
1639f73de8dSKashyap Chamarthy
1649f73de8dSKashyap ChamarthyThe body of the commit message is a good place to document why your
1659f73de8dSKashyap Chamarthychange is important. Don't include comments like "This is a suggestion
1669f73de8dSKashyap Chamarthyfor fixing this bug" (they can go below the ``---`` line in the email so
1679f73de8dSKashyap Chamarthythey don't go into the final commit message). Make sure the body of the
1689f73de8dSKashyap Chamarthycommit message can be read in isolation even if the reader's mailer
1699f73de8dSKashyap Chamarthydisplays the subject line some distance apart (that is, a body that
1709f73de8dSKashyap Chamarthystarts with "... so that" as a continuation of the subject line is
1719f73de8dSKashyap Chamarthyharder to follow).
1729f73de8dSKashyap Chamarthy
173cd6b1674SKashyap ChamarthyIf your patch fixes a commit that is already in the repository, please
174cd6b1674SKashyap Chamarthyadd an additional line with "Fixes: <at-least-12-digits-of-SHA-commit-id>
175cd6b1674SKashyap Chamarthy("Fixed commit subject")" below the patch description / before your
176cd6b1674SKashyap Chamarthy"Signed-off-by:" line in the commit message.
177cd6b1674SKashyap Chamarthy
178cd6b1674SKashyap ChamarthyIf your patch fixes a bug in the gitlab bug tracker, please add a line
179cd6b1674SKashyap Chamarthywith "Resolves: <URL-of-the-bug>" to the commit message, too. Gitlab can
180b1f8536cSManos Pitsidianakisclose bugs automatically once commits with the "Resolves:" keyword get
181cd6b1674SKashyap Chamarthymerged into the master branch of the project. And if your patch addresses
182cd6b1674SKashyap Chamarthya bug in another public bug tracker, you can also use a line with
183cd6b1674SKashyap Chamarthy"Buglink: <URL-of-the-bug>" for reference here, too.
184cd6b1674SKashyap Chamarthy
185cd6b1674SKashyap ChamarthyExample::
186cd6b1674SKashyap Chamarthy
187cd6b1674SKashyap Chamarthy Fixes: 14055ce53c2d ("s390x/tcg: avoid overflows in time2tod/tod2time")
188cd6b1674SKashyap Chamarthy Resolves: https://gitlab.com/qemu-project/qemu/-/issues/42
189cd6b1674SKashyap Chamarthy Buglink: https://bugs.launchpad.net/qemu/+bug/1804323``
190cd6b1674SKashyap Chamarthy
19193e86b16SKashyap ChamarthySome other tags that are used in commit messages include "Message-Id:"
19293e86b16SKashyap Chamarthy"Tested-by:", "Acked-by:", "Reported-by:", "Suggested-by:".  See ``git
19393e86b16SKashyap Chamarthylog`` for these keywords for example usage.
19493e86b16SKashyap Chamarthy
195cd6b1674SKashyap Chamarthy.. _test_your_patches:
196cd6b1674SKashyap Chamarthy
197cd6b1674SKashyap ChamarthyTest your patches
198cd6b1674SKashyap Chamarthy~~~~~~~~~~~~~~~~~
199cd6b1674SKashyap Chamarthy
2007266ecceSAlex BennéeAlthough QEMU uses various :ref:`ci` services that attempt to test
2017266ecceSAlex Bennéepatches submitted to the list, it still saves everyone time if you
2027266ecceSAlex Bennéehave already tested that your patch compiles and works. Because QEMU
2037266ecceSAlex Bennéeis such a large project the default configuration won't create a
2047266ecceSAlex Bennéetesting pipeline on GitLab when a branch is pushed. See the :ref:`CI
2057266ecceSAlex Bennéevariable documentation<ci_var>` for details on how to control the
2067266ecceSAlex Bennéerunning of tests; but it is still wise to also check that your patches
2077266ecceSAlex Bennéework with a full build before submitting a series, especially if your
2087266ecceSAlex Bennéechanges might have an unintended effect on other areas of the code you
2097266ecceSAlex Bennéedon't normally experiment with. See :ref:`testing` for more details on
2107266ecceSAlex Bennéewhat tests are available.
2117266ecceSAlex Bennée
2127266ecceSAlex BennéeAlso, it is a wise idea to include a testsuite addition as part of
2137266ecceSAlex Bennéeyour patches - either to ensure that future changes won't regress your
2147266ecceSAlex Bennéenew feature, or to add a test which exposes the bug that the rest of
2157266ecceSAlex Bennéeyour series fixes. Keeping separate commits for the test and the fix
2167266ecceSAlex Bennéeallows reviewers to rebase the test to occur first to prove it catches
2177266ecceSAlex Bennéethe problem, then again to place it last in the series so that
2187266ecceSAlex Bennéebisection doesn't land on a known-broken state.
219cd6b1674SKashyap Chamarthy
2209f73de8dSKashyap Chamarthy.. _submitting_your_patches:
2219f73de8dSKashyap Chamarthy
2229f73de8dSKashyap ChamarthySubmitting your Patches
2239f73de8dSKashyap Chamarthy-----------------------
2249f73de8dSKashyap Chamarthy
225ca127fe9SAlex BennéeThe QEMU project uses a public email based workflow for reviewing and
226ca127fe9SAlex Bennéemerging patches. As a result all contributions to QEMU must be **sent
227ca127fe9SAlex Bennéeas patches** to the qemu-devel `mailing list
228ca127fe9SAlex Bennée<https://wiki.qemu.org/Contribute/MailingLists>`__. Patch
229ca127fe9SAlex Bennéecontributions should not be posted on the bug tracker, posted on
230ca127fe9SAlex Bennéeforums, or externally hosted and linked to. (We have other mailing
231ca127fe9SAlex Bennéelists too, but all patches must go to qemu-devel, possibly with a Cc:
232ca127fe9SAlex Bennéeto another list.) ``git send-email`` (`step-by-step setup guide
233ca127fe9SAlex Bennée<https://git-send-email.io/>`__ and `hints and tips
234ca127fe9SAlex Bennée<https://elixir.bootlin.com/linux/latest/source/Documentation/process/email-clients.rst>`__)
235ca127fe9SAlex Bennéeworks best for delivering the patch without mangling it, but
236ca127fe9SAlex Bennéeattachments can be used as a last resort on a first-time submission.
237ca127fe9SAlex Bennée
238f4ac443eSPierrick Bouvier.. _use_git_publish:
239f4ac443eSPierrick Bouvier
240f4ac443eSPierrick BouvierUse git-publish
241f4ac443eSPierrick Bouvier~~~~~~~~~~~~~~~
242f4ac443eSPierrick Bouvier
243f4ac443eSPierrick BouvierIf you already configured git send-email, you can simply use `git-publish
244f4ac443eSPierrick Bouvier<https://github.com/stefanha/git-publish>`__ to send series.
245f4ac443eSPierrick Bouvier
246f4ac443eSPierrick Bouvier::
247f4ac443eSPierrick Bouvier
248f4ac443eSPierrick Bouvier    $ git checkout master -b my-feature
249f4ac443eSPierrick Bouvier    $ # work on new commits, add your 'Signed-off-by' lines to each
250f4ac443eSPierrick Bouvier    $ git publish
251f4ac443eSPierrick Bouvier    $ ... more work, rebase on master, ...
252f4ac443eSPierrick Bouvier    $ git publish # will send a v2
253f4ac443eSPierrick Bouvier
254f4ac443eSPierrick BouvierEach time you post a series, git-publish will create a local tag with the format
255f4ac443eSPierrick Bouvier``<branchname>-v<version>`` to record the patch series.
256f4ac443eSPierrick Bouvier
257f4ac443eSPierrick BouvierWhen sending patch emails, 'git publish' will consult the output of
258f4ac443eSPierrick Bouvier'scripts/get_maintainers.pl' and automatically CC anyone listed as maintainers
259f4ac443eSPierrick Bouvierof the affected code. Generally you should accept the suggested CC list, but
260f4ac443eSPierrick Bouvierthere may sometimes be scenarios where it is appropriate to cut it down (eg on
261f4ac443eSPierrick Bouviercertain large tree-wide cleanups), or augment it with other interested people.
262f4ac443eSPierrick Bouvier
263cd6b1674SKashyap Chamarthy.. _if_you_cannot_send_patch_emails:
264cd6b1674SKashyap Chamarthy
265cd6b1674SKashyap ChamarthyIf you cannot send patch emails
266cd6b1674SKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267cd6b1674SKashyap Chamarthy
268cd6b1674SKashyap ChamarthyIn rare cases it may not be possible to send properly formatted patch
269cd6b1674SKashyap Chamarthyemails. You can use `sourcehut <https://sourcehut.org/>`__ to send your
270cd6b1674SKashyap Chamarthypatches to the QEMU mailing list by following these steps:
271cd6b1674SKashyap Chamarthy
272cd6b1674SKashyap Chamarthy#. Register or sign in to your account
273cd6b1674SKashyap Chamarthy#. Add your SSH public key in `meta \|
274cd6b1674SKashyap Chamarthy   keys <https://meta.sr.ht/keys>`__.
275cd6b1674SKashyap Chamarthy#. Publish your git branch using **git push git@git.sr.ht:~USERNAME/qemu
276cd6b1674SKashyap Chamarthy   HEAD**
277cd6b1674SKashyap Chamarthy#. Send your patches to the QEMU mailing list using the web-based
278cd6b1674SKashyap Chamarthy   ``git-send-email`` UI at https://git.sr.ht/~USERNAME/qemu/send-email
279cd6b1674SKashyap Chamarthy
2806a4fa294SPierrick BouvierDocumentation for sourcehut is available `here
281cd6b1674SKashyap Chamarthy<https://man.sr.ht/git.sr.ht/#sending-patches-upstream>`__.
282cd6b1674SKashyap Chamarthy
2839f73de8dSKashyap Chamarthy.. _cc_the_relevant_maintainer:
2849f73de8dSKashyap Chamarthy
2859f73de8dSKashyap ChamarthyCC the relevant maintainer
2869f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~
2879f73de8dSKashyap Chamarthy
2889f73de8dSKashyap ChamarthySend patches both to the mailing list and CC the maintainer(s) of the
2899f73de8dSKashyap Chamarthyfiles you are modifying. look in the MAINTAINERS file to find out who
2909f73de8dSKashyap Chamarthythat is. Also try using scripts/get_maintainer.pl from the repository
2919f73de8dSKashyap Chamarthyfor learning the most common committers for the files you touched.
2929f73de8dSKashyap Chamarthy
2939f73de8dSKashyap ChamarthyExample::
2949f73de8dSKashyap Chamarthy
2959f73de8dSKashyap Chamarthy    ~/src/qemu/scripts/get_maintainer.pl -f hw/ide/core.c
2969f73de8dSKashyap Chamarthy
2979f73de8dSKashyap ChamarthyIn fact, you can automate this, via a one-time setup of ``git config
2989f73de8dSKashyap Chamarthysendemail.cccmd 'scripts/get_maintainer.pl --nogit-fallback'`` (Refer to
2999f73de8dSKashyap Chamarthy`git-config <http://git-scm.com/docs/git-config>`__.)
3009f73de8dSKashyap Chamarthy
3019f73de8dSKashyap Chamarthy.. _do_not_send_as_an_attachment:
3029f73de8dSKashyap Chamarthy
3039f73de8dSKashyap ChamarthyDo not send as an attachment
3049f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3059f73de8dSKashyap Chamarthy
3069f73de8dSKashyap ChamarthySend patches inline so they are easy to reply to with review comments.
3079f73de8dSKashyap ChamarthyDo not put patches in attachments.
3089f73de8dSKashyap Chamarthy
3099f73de8dSKashyap Chamarthy.. _use_git_format_patch:
3109f73de8dSKashyap Chamarthy
3119f73de8dSKashyap ChamarthyUse ``git format-patch``
3129f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~
3139f73de8dSKashyap Chamarthy
3149f73de8dSKashyap ChamarthyUse the right diff format.
3159f73de8dSKashyap Chamarthy`git format-patch <http://git-scm.com/docs/git-format-patch>`__ will
3169f73de8dSKashyap Chamarthyproduce patch emails in the right format (check the documentation to
3179f73de8dSKashyap Chamarthyfind out how to drive it). You can then edit the cover letter before
3189f73de8dSKashyap Chamarthyusing ``git send-email`` to mail the files to the mailing list. (We
3199f73de8dSKashyap Chamarthyrecommend `git send-email <http://git-scm.com/docs/git-send-email>`__
3209f73de8dSKashyap Chamarthybecause mail clients often mangle patches by wrapping long lines or
3219f73de8dSKashyap Chamarthymessing up whitespace. Some distributions do not include send-email in a
3229f73de8dSKashyap Chamarthydefault install of git; you may need to download additional packages,
3239f73de8dSKashyap Chamarthysuch as 'git-email' on Fedora-based systems.) Patch series need a cover
3249f73de8dSKashyap Chamarthyletter, with shallow threading (all patches in the series are
3259f73de8dSKashyap Chamarthyin-reply-to the cover letter, but not to each other); single unrelated
3269f73de8dSKashyap Chamarthypatches do not need a cover letter (but if you do send a cover letter,
327cd6b1674SKashyap Chamarthyuse ``--numbered`` so the cover and the patch have distinct subject lines).
3289f73de8dSKashyap ChamarthyPatches are easier to find if they start a new top-level thread, rather
3299f73de8dSKashyap Chamarthythan being buried in-reply-to another existing thread.
3309f73de8dSKashyap Chamarthy
331cd6b1674SKashyap Chamarthy.. _avoid_posting_large_binary_blob:
332cd6b1674SKashyap Chamarthy
333cd6b1674SKashyap ChamarthyAvoid posting large binary blob
334cd6b1674SKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
335cd6b1674SKashyap Chamarthy
336cd6b1674SKashyap ChamarthyIf you added binaries to the repository, consider producing the patch
337cd6b1674SKashyap Chamarthyemails using ``git format-patch --no-binary`` and include a link to a
338cd6b1674SKashyap Chamarthygit repository to fetch the original commit.
339cd6b1674SKashyap Chamarthy
3409f73de8dSKashyap Chamarthy.. _patch_emails_must_include_a_signed_off_by_line:
3419f73de8dSKashyap Chamarthy
3429f73de8dSKashyap ChamarthyPatch emails must include a ``Signed-off-by:`` line
3439f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3449f73de8dSKashyap Chamarthy
345ca127fe9SAlex BennéeYour patches **must** include a Signed-off-by: line. This is a hard
346ca127fe9SAlex Bennéerequirement because it's how you say "I'm legally okay to contribute
347ca127fe9SAlex Bennéethis and happy for it to go into QEMU". The process is modelled after
348ca127fe9SAlex Bennéethe `Linux kernel
349ca127fe9SAlex Bennée<http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches?id=f6f94e2ab1b33f0082ac22d71f66385a60d8157f#n297>`__
350ca127fe9SAlex Bennéepolicy.
3519f73de8dSKashyap Chamarthy
3529f73de8dSKashyap ChamarthyIf you wrote the patch, make sure your "From:" and "Signed-off-by:"
3539f73de8dSKashyap Chamarthylines use the same spelling. It's okay if you subscribe or contribute to
3549f73de8dSKashyap Chamarthythe list via more than one address, but using multiple addresses in one
3559f73de8dSKashyap Chamarthycommit just confuses things. If someone else wrote the patch, git will
3569f73de8dSKashyap Chamarthyinclude a "From:" line in the body of the email (different from your
3579f73de8dSKashyap Chamarthyenvelope From:) that will give credit to the correct author; but again,
3589f73de8dSKashyap Chamarthythat author's Signed-off-by: line is mandatory, with the same spelling.
3599f73de8dSKashyap Chamarthy
360270c81b7SDaniel P. BerrangéThe name used with "Signed-off-by" does not need to be your legal name,
361270c81b7SDaniel P. Berrangénor birth name, nor appear on any government ID. It is the identity you
362270c81b7SDaniel P. Berrangéchoose to be known by in the community, but should not be anonymous,
363270c81b7SDaniel P. Berrangénor misrepresent whom you are.
364270c81b7SDaniel P. Berrangé
365ca127fe9SAlex BennéeThere are various tooling options for automatically adding these tags
366ca127fe9SAlex Bennéeinclude using ``git commit -s`` or ``git format-patch -s``. For more
367ca127fe9SAlex Bennéeinformation see `SubmittingPatches 1.12
368ca127fe9SAlex Bennée<http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches?id=f6f94e2ab1b33f0082ac22d71f66385a60d8157f#n297>`__.
369ca127fe9SAlex Bennée
3709f73de8dSKashyap Chamarthy.. _include_a_meaningful_cover_letter:
3719f73de8dSKashyap Chamarthy
3729f73de8dSKashyap ChamarthyInclude a meaningful cover letter
3739f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3749f73de8dSKashyap Chamarthy
375cd6b1674SKashyap ChamarthyThis is a requirement for any series with multiple patches (as it aids
376cd6b1674SKashyap Chamarthycontinuous integration), but optional for an isolated patch. The cover
377cd6b1674SKashyap Chamarthyletter explains the overall goal of such a series, and also provides a
378cd6b1674SKashyap Chamarthyconvenient 0/N email for others to reply to the series as a whole. A
379cd6b1674SKashyap Chamarthyone-time setup of ``git config format.coverletter auto`` (refer to
380cd6b1674SKashyap Chamarthy`git-config <http://git-scm.com/docs/git-config>`__) will generate the
381cd6b1674SKashyap Chamarthycover letter as needed.
3829f73de8dSKashyap Chamarthy
3839f73de8dSKashyap ChamarthyWhen reviewers don't know your goal at the start of their review, they
3849f73de8dSKashyap Chamarthymay object to early changes that don't make sense until the end of the
3859f73de8dSKashyap Chamarthyseries, because they do not have enough context yet at that point of
3869f73de8dSKashyap Chamarthytheir review. A series where the goal is unclear also risks a higher
3879f73de8dSKashyap Chamarthynumber of review-fix cycles because the reviewers haven't bought into
3889f73de8dSKashyap Chamarthythe idea yet. If the cover letter can explain these points to the
3899f73de8dSKashyap Chamarthyreviewer, the process will be smoother patches will get merged faster.
3909f73de8dSKashyap ChamarthyMake sure your cover letter includes a diffstat of changes made over the
3919f73de8dSKashyap Chamarthyentire series; potential reviewers know what files they are interested
3929f73de8dSKashyap Chamarthyin, and they need an easy way determine if your series touches them.
3939f73de8dSKashyap Chamarthy
3949f73de8dSKashyap Chamarthy.. _use_the_rfc_tag_if_needed:
3959f73de8dSKashyap Chamarthy
3969f73de8dSKashyap ChamarthyUse the RFC tag if needed
3979f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~
3989f73de8dSKashyap Chamarthy
3999f73de8dSKashyap ChamarthyFor example, "[PATCH RFC v2]". ``git format-patch --subject-prefix=RFC``
4009f73de8dSKashyap Chamarthycan help.
4019f73de8dSKashyap Chamarthy
4029f73de8dSKashyap Chamarthy"RFC" means "Request For Comments" and is a statement that you don't
4039f73de8dSKashyap Chamarthyintend for your patchset to be applied to master, but would like some
4049f73de8dSKashyap Chamarthyreview on it anyway. Reasons for doing this include:
4059f73de8dSKashyap Chamarthy
4069f73de8dSKashyap Chamarthy-  the patch depends on some pending kernel changes which haven't yet
4079f73de8dSKashyap Chamarthy   been accepted, so the QEMU patch series is blocked until that
4089f73de8dSKashyap Chamarthy   dependency has been dealt with, but is worth reviewing anyway
4099f73de8dSKashyap Chamarthy-  the patch set is not finished yet (perhaps it doesn't cover all use
4109f73de8dSKashyap Chamarthy   cases or work with all targets) but you want early review of a major
4119f73de8dSKashyap Chamarthy   API change or design structure before continuing
4129f73de8dSKashyap Chamarthy
4139f73de8dSKashyap ChamarthyIn general, since it's asking other people to do review work on a
4149f73de8dSKashyap Chamarthypatchset that the submitter themselves is saying shouldn't be applied,
4159f73de8dSKashyap Chamarthyit's best to:
4169f73de8dSKashyap Chamarthy
4179f73de8dSKashyap Chamarthy-  use it sparingly
4189f73de8dSKashyap Chamarthy-  in the cover letter, be clear about why a patch is an RFC, what areas
4199f73de8dSKashyap Chamarthy   of the patchset you're looking for review on, and why reviewers
4209f73de8dSKashyap Chamarthy   should care
4219f73de8dSKashyap Chamarthy
422cd6b1674SKashyap Chamarthy.. _consider_whether_your_patch_is_applicable_for_stable:
423cd6b1674SKashyap Chamarthy
424cd6b1674SKashyap ChamarthyConsider whether your patch is applicable for stable
425cd6b1674SKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
426cd6b1674SKashyap Chamarthy
427cd6b1674SKashyap ChamarthyIf your patch fixes a severe issue or a regression, it may be applicable
428cd6b1674SKashyap Chamarthyfor stable. In that case, consider adding ``Cc: qemu-stable@nongnu.org``
429cd6b1674SKashyap Chamarthyto your patch to notify the stable maintainers.
430cd6b1674SKashyap Chamarthy
431cd6b1674SKashyap ChamarthyFor more details on how QEMU's stable process works, refer to the
432cd6b1674SKashyap Chamarthy:ref:`stable-process` page.
433cd6b1674SKashyap Chamarthy
4349f73de8dSKashyap Chamarthy.. _participating_in_code_review:
4359f73de8dSKashyap Chamarthy
436*ca494c9bSPierrick BouvierRetrieve an existing series
437*ca494c9bSPierrick Bouvier---------------------------
438*ca494c9bSPierrick Bouvier
439*ca494c9bSPierrick BouvierIf you want to apply an existing series on top of your tree, you can simply use
440*ca494c9bSPierrick Bouvier`b4 <https://github.com/mricon/b4>`__.
441*ca494c9bSPierrick Bouvier
442*ca494c9bSPierrick Bouvier::
443*ca494c9bSPierrick Bouvier
444*ca494c9bSPierrick Bouvier    b4 shazam $msg-id
445*ca494c9bSPierrick Bouvier
446*ca494c9bSPierrick BouvierThe message id is related to the patch series that has been sent to the mailing
447*ca494c9bSPierrick Bouvierlist. You need to retrieve the "Message-Id:" header from one of the patches. Any
448*ca494c9bSPierrick Bouvierof them can be used and b4 will apply the whole series.
449*ca494c9bSPierrick Bouvier
4509f73de8dSKashyap ChamarthyParticipating in Code Review
4519f73de8dSKashyap Chamarthy----------------------------
4529f73de8dSKashyap Chamarthy
4539f73de8dSKashyap ChamarthyAll patches submitted to the QEMU project go through a code review
454ca127fe9SAlex Bennéeprocess before they are accepted. This will often mean a series will
455ca127fe9SAlex Bennéego through a number of iterations before being picked up by
456ca127fe9SAlex Bennée:ref:`maintainers<maintainers>`. You therefore should be prepared to
457ca127fe9SAlex Bennéeread replies to your messages and be willing to act on them.
458ca127fe9SAlex Bennée
459ca127fe9SAlex BennéeMaintainers are often willing to manually fix up first-time
460ca127fe9SAlex Bennéecontributions, since there is a learning curve involved in making an
461ca127fe9SAlex Bennéeideal patch submission. However for the best results you should
462ca127fe9SAlex Bennéeproactively respond to suggestions with changes or justifications for
463ca127fe9SAlex Bennéeyour current approach.
464ca127fe9SAlex Bennée
465ca127fe9SAlex BennéeSome areas of code that are well maintained may review patches
466ca127fe9SAlex Bennéequickly, lesser-loved areas of code may have a longer delay.
4679f73de8dSKashyap Chamarthy
4689f73de8dSKashyap Chamarthy.. _stay_around_to_fix_problems_raised_in_code_review:
4699f73de8dSKashyap Chamarthy
4709f73de8dSKashyap ChamarthyStay around to fix problems raised in code review
4719f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4729f73de8dSKashyap Chamarthy
4739f73de8dSKashyap ChamarthyNot many patches get into QEMU straight away -- it is quite common that
4749f73de8dSKashyap Chamarthydevelopers will identify bugs, or suggest a cleaner approach, or even
4759f73de8dSKashyap Chamarthyjust point out code style issues or commit message typos. You'll need to
4769f73de8dSKashyap Chamarthyrespond to these, and then send a second version of your patches with
4779f73de8dSKashyap Chamarthythe issues fixed. This takes a little time and effort on your part, but
47873ee4c55SAlex Bennéeif you don't do it then your changes will never get into QEMU.
47973ee4c55SAlex Bennée
48073ee4c55SAlex BennéeRemember that a maintainer is under no obligation to take your
48173ee4c55SAlex Bennéepatches. If someone has spent the time reviewing your code and
48273ee4c55SAlex Bennéesuggesting improvements and you simply re-post without either
48373ee4c55SAlex Bennéeaddressing the comment directly or providing additional justification
48473ee4c55SAlex Bennéefor the change then it becomes wasted effort. You cannot demand others
48573ee4c55SAlex Bennéemerge and then fix up your code after the fact.
4869f73de8dSKashyap Chamarthy
4879f73de8dSKashyap ChamarthyWhen replying to comments on your patches **reply to all and not just
4889f73de8dSKashyap Chamarthythe sender** -- keeping discussion on the mailing list means everybody
48973ee4c55SAlex Bennéecan follow it. Remember the spirit of the :ref:`code_of_conduct` and
49073ee4c55SAlex Bennéekeep discussions respectful and collaborative and avoid making
49173ee4c55SAlex Bennéepersonal comments.
4929f73de8dSKashyap Chamarthy
4939f73de8dSKashyap Chamarthy.. _pay_attention_to_review_comments:
4949f73de8dSKashyap Chamarthy
4959f73de8dSKashyap ChamarthyPay attention to review comments
4969f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4979f73de8dSKashyap Chamarthy
4989f73de8dSKashyap ChamarthySomeone took their time to review your work, and it pays to respect that
4999f73de8dSKashyap Chamarthyeffort; repeatedly submitting a series without addressing all comments
5009f73de8dSKashyap Chamarthyfrom the previous round tends to alienate reviewers and stall your
5019f73de8dSKashyap Chamarthypatch. Reviewers aren't always perfect, so it is okay if you want to
5029f73de8dSKashyap Chamarthyargue that your code was correct in the first place instead of blindly
5039f73de8dSKashyap Chamarthydoing everything the reviewer asked. On the other hand, if someone
5049f73de8dSKashyap Chamarthypointed out a potential issue during review, then even if your code
5059f73de8dSKashyap Chamarthyturns out to be correct, it's probably a sign that you should improve
5069f73de8dSKashyap Chamarthyyour commit message and/or comments in the code explaining why the code
5079f73de8dSKashyap Chamarthyis correct.
5089f73de8dSKashyap Chamarthy
5099f73de8dSKashyap ChamarthyIf you fix issues that are raised during review **resend the entire
5109f73de8dSKashyap Chamarthypatch series** not just the one patch that was changed. This allows
5119f73de8dSKashyap Chamarthymaintainers to easily apply the fixed series without having to manually
5129f73de8dSKashyap Chamarthyidentify which patches are relevant. Send the new version as a complete
5139f73de8dSKashyap Chamarthyfresh email or series of emails -- don't try to make it a followup to
5149f73de8dSKashyap Chamarthyversion 1. (This helps automatic patch email handling tools distinguish
5159f73de8dSKashyap Chamarthybetween v1 and v2 emails.)
5169f73de8dSKashyap Chamarthy
5179f73de8dSKashyap Chamarthy.. _when_resending_patches_add_a_version_tag:
5189f73de8dSKashyap Chamarthy
5199f73de8dSKashyap ChamarthyWhen resending patches add a version tag
5209f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5219f73de8dSKashyap Chamarthy
5229f73de8dSKashyap ChamarthyAll patches beyond the first version should include a version tag -- for
5239f73de8dSKashyap Chamarthyexample, "[PATCH v2]". This means people can easily identify whether
5249f73de8dSKashyap Chamarthythey're looking at the most recent version. (The first version of a
5259f73de8dSKashyap Chamarthypatch need not say "v1", just [PATCH] is sufficient.) For patch series,
5269f73de8dSKashyap Chamarthythe version applies to the whole series -- even if you only change one
5279f73de8dSKashyap Chamarthypatch, you resend the entire series and mark it as "v2". Don't try to
5289f73de8dSKashyap Chamarthytrack versions of different patches in the series separately.  `git
5299f73de8dSKashyap Chamarthyformat-patch <http://git-scm.com/docs/git-format-patch>`__ and `git
5309f73de8dSKashyap Chamarthysend-email <http://git-scm.com/docs/git-send-email>`__ both understand
5319f73de8dSKashyap Chamarthythe ``-v2`` option to make this easier. Send each new revision as a new
5329f73de8dSKashyap Chamarthytop-level thread, rather than burying it in-reply-to an earlier
5339f73de8dSKashyap Chamarthyrevision, as many reviewers are not looking inside deep threads for new
5349f73de8dSKashyap Chamarthypatches.
5359f73de8dSKashyap Chamarthy
5369f73de8dSKashyap Chamarthy.. _include_version_history_in_patchset_revisions:
5379f73de8dSKashyap Chamarthy
5389f73de8dSKashyap ChamarthyInclude version history in patchset revisions
5399f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5409f73de8dSKashyap Chamarthy
5419f73de8dSKashyap ChamarthyFor later versions of patches, include a summary of changes from
5429f73de8dSKashyap Chamarthyprevious versions, but not in the commit message itself. In an email
543cd6b1674SKashyap Chamarthyformatted as a git patch, the commit message is the part above the ``---``
5449f73de8dSKashyap Chamarthyline, and this will go into the git changelog when the patch is
5459f73de8dSKashyap Chamarthycommitted. This part should be a self-contained description of what this
5469f73de8dSKashyap Chamarthyversion of the patch does, written to make sense to anybody who comes
5479f73de8dSKashyap Chamarthyback to look at this commit in git in six months' time. The part below
548cd6b1674SKashyap Chamarthythe ``---`` line and above the patch proper (git format-patch puts the
5499f73de8dSKashyap Chamarthydiffstat here) is a good place to put remarks for people reading the
5509f73de8dSKashyap Chamarthypatch email, and this is where the "changes since previous version"
551cd6b1674SKashyap Chamarthysummary belongs. The `git-publish
552cd6b1674SKashyap Chamarthy<https://github.com/stefanha/git-publish>`__ script can help with
553cd6b1674SKashyap Chamarthytracking a good summary across versions. Also, the `git-backport-diff
554cd6b1674SKashyap Chamarthy<https://github.com/codyprime/git-scripts>`__ script can help focus
555cd6b1674SKashyap Chamarthyreviewers on what changed between revisions.
5569f73de8dSKashyap Chamarthy
5579f73de8dSKashyap Chamarthy.. _tips_and_tricks:
5589f73de8dSKashyap Chamarthy
5599f73de8dSKashyap ChamarthyTips and Tricks
5609f73de8dSKashyap Chamarthy---------------
5619f73de8dSKashyap Chamarthy
5629f73de8dSKashyap Chamarthy.. _proper_use_of_reviewed_by_tags_can_aid_review:
5639f73de8dSKashyap Chamarthy
5649f73de8dSKashyap ChamarthyProper use of Reviewed-by: tags can aid review
5659f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5669f73de8dSKashyap Chamarthy
5679f73de8dSKashyap ChamarthyWhen reviewing a large series, a reviewer can reply to some of the
5689f73de8dSKashyap Chamarthypatches with a Reviewed-by tag, stating that they are happy with that
5699f73de8dSKashyap Chamarthypatch in isolation (sometimes conditional on minor cleanup, like fixing
5709f73de8dSKashyap Chamarthywhitespace, that doesn't affect code content). You should then update
5719f73de8dSKashyap Chamarthythose commit messages by hand to include the Reviewed-by tag, so that in
5729f73de8dSKashyap Chamarthythe next revision, reviewers can spot which patches were already clean
5739f73de8dSKashyap Chamarthyfrom the previous round. Conversely, if you significantly modify a patch
5749f73de8dSKashyap Chamarthythat was previously reviewed, remove the reviewed-by tag out of the
5759f73de8dSKashyap Chamarthycommit message, as well as listing the changes from the previous
5769f73de8dSKashyap Chamarthyversion, to make it easier to focus a reviewer's attention to your
5779f73de8dSKashyap Chamarthychanges.
5789f73de8dSKashyap Chamarthy
5799f73de8dSKashyap Chamarthy.. _if_your_patch_seems_to_have_been_ignored:
5809f73de8dSKashyap Chamarthy
5819f73de8dSKashyap ChamarthyIf your patch seems to have been ignored
5829f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5839f73de8dSKashyap Chamarthy
5849f73de8dSKashyap ChamarthyIf your patchset has received no replies you should "ping" it after a
5859f73de8dSKashyap Chamarthyweek or two, by sending an email as a reply-to-all to the patch mail,
5869f73de8dSKashyap Chamarthyincluding the word "ping" and ideally also a link to the page for the
587cd6b1674SKashyap Chamarthypatch on `patchew <https://patchew.org/QEMU/>`__ or
588cd6b1674SKashyap Chamarthy`lore.kernel.org <https://lore.kernel.org/qemu-devel/>`__. It's worth
589cd6b1674SKashyap Chamarthydouble-checking for reasons why your patch might have been ignored
590cd6b1674SKashyap Chamarthy(forgot to CC the maintainer? annoyed people by failing to respond to
591cd6b1674SKashyap Chamarthyreview comments on an earlier version?), but often for less-maintained
592cd6b1674SKashyap Chamarthyareas of QEMU patches do just slip through the cracks. If your ping is
593cd6b1674SKashyap Chamarthyalso ignored, ping again after another week or so. As the submitter, you
594cd6b1674SKashyap Chamarthyare the person with the most motivation to get your patch applied, so
595cd6b1674SKashyap Chamarthyyou have to be persistent.
5969f73de8dSKashyap Chamarthy
5979f73de8dSKashyap Chamarthy.. _is_my_patch_in:
5989f73de8dSKashyap Chamarthy
5999f73de8dSKashyap ChamarthyIs my patch in?
6009f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~
6019f73de8dSKashyap Chamarthy
602cd6b1674SKashyap ChamarthyQEMU has some Continuous Integration machines that try to catch patch
603cd6b1674SKashyap Chamarthysubmission problems as soon as possible.  `patchew
604cd6b1674SKashyap Chamarthy<http://patchew.org/QEMU/>`__ includes a web interface for tracking the
605cd6b1674SKashyap Chamarthystatus of various threads that have been posted to the list, and may
606cd6b1674SKashyap Chamarthysend you an automated mail if it detected a problem with your patch.
607cd6b1674SKashyap Chamarthy
6089f73de8dSKashyap ChamarthyOnce your patch has had enough review on list, the maintainer for that
6099f73de8dSKashyap Chamarthyarea of code will send notification to the list that they are including
6109f73de8dSKashyap Chamarthyyour patch in a particular staging branch. Periodically, the maintainer
611cd6b1674SKashyap Chamarthythen takes care of :ref:`submitting-a-pull-request`
612cd6b1674SKashyap Chamarthyfor aggregating topic branches into mainline QEMU. Generally, you do not
6139f73de8dSKashyap Chamarthyneed to send a pull request unless you have contributed enough patches
6149f73de8dSKashyap Chamarthyto become a maintainer over a particular section of code. Maintainers
6159f73de8dSKashyap Chamarthymay further modify your commit, by resolving simple merge conflicts or
6169f73de8dSKashyap Chamarthyfixing minor typos pointed out during review, but will always add a
6179f73de8dSKashyap ChamarthySigned-off-by line in addition to yours, indicating that it went through
6189f73de8dSKashyap Chamarthytheir tree. Occasionally, the maintainer's pull request may hit more
6199f73de8dSKashyap Chamarthydifficult merge conflicts, where you may be requested to help rebase and
6209f73de8dSKashyap Chamarthyresolve the problems. It may take a couple of weeks between when your
6219f73de8dSKashyap Chamarthypatch first had a positive review to when it finally lands in qemu.git;
6229f73de8dSKashyap Chamarthyrelease cycle freezes may extend that time even longer.
6239f73de8dSKashyap Chamarthy
6249f73de8dSKashyap Chamarthy.. _return_the_favor:
6259f73de8dSKashyap Chamarthy
6269f73de8dSKashyap ChamarthyReturn the favor
6279f73de8dSKashyap Chamarthy~~~~~~~~~~~~~~~~
6289f73de8dSKashyap Chamarthy
6299f73de8dSKashyap ChamarthyPeer review only works if everyone chips in a bit of review time. If
6309f73de8dSKashyap Chamarthyeveryone submitted more patches than they reviewed, we would have a
6319f73de8dSKashyap Chamarthypatch backlog. A good goal is to try to review at least as many patches
6329f73de8dSKashyap Chamarthyfrom others as what you submit. Don't worry if you don't know the code
6339f73de8dSKashyap Chamarthybase as well as a maintainer; it's perfectly fine to admit when your
6349f73de8dSKashyap Chamarthyreview is weak because you are unfamiliar with the code.
635