[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 37/51] docs/devel: Rules on #include in headers
From: |
Michael S. Tsirkin |
Subject: |
[PULL 37/51] docs/devel: Rules on #include in headers |
Date: |
Thu, 5 Jan 2023 04:16:23 -0500 |
From: Markus Armbruster <armbru@redhat.com>
Rules for headers were proposed a long time ago, and generally liked:
Message-ID: <87h9g8j57d.fsf@blackfin.pond.sub.org>
https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
Wortk them into docs/devel/style.rst.
Suggested-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221222120813.727830-5-armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Bernhard Beschow <shentey@gmail.com>
---
docs/devel/style.rst | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/docs/devel/style.rst b/docs/devel/style.rst
index 7ddd42b6c2..68aa776930 100644
--- a/docs/devel/style.rst
+++ b/docs/devel/style.rst
@@ -293,6 +293,13 @@ that QEMU depends on.
Do not include "qemu/osdep.h" from header files since the .c file will have
already included it.
+Headers should normally include everything they need beyond osdep.h.
+If exceptions are needed for some reason, they must be documented in
+the header. If all that's needed from a header is typedefs, consider
+putting those into qemu/typedefs.h instead of including the header.
+
+Cyclic inclusion is forbidden.
+
C types
=======
--
MST
- [PULL 24/51] virtio-pci: add support for configure interrupt, (continued)
- [PULL 24/51] virtio-pci: add support for configure interrupt, Michael S. Tsirkin, 2023/01/05
- [PULL 26/51] hw/virtio: Extract QMP QOM-specific functions to virtio-qmp.c, Michael S. Tsirkin, 2023/01/05
- [PULL 25/51] hw/virtio: Rename virtio_device_find() -> qmp_find_virtio_device(), Michael S. Tsirkin, 2023/01/05
- [PULL 27/51] include/hw/pci: Break inclusion loop pci_bridge.h and cxl.h, Michael S. Tsirkin, 2023/01/05
- [PULL 30/51] include/hw/pci: Clean up a few things checkpatch.pl would flag, Michael S. Tsirkin, 2023/01/05
- [PULL 29/51] include/hw/cxl: Include hw/cxl/*.h where needed, Michael S. Tsirkin, 2023/01/05
- [PULL 31/51] include/hw/pci: Split pci_device.h off pci.h, Michael S. Tsirkin, 2023/01/05
- [PULL 34/51] include/hw/virtio: Break inclusion loop, Michael S. Tsirkin, 2023/01/05
- [PULL 35/51] include: Include headers where needed, Michael S. Tsirkin, 2023/01/05
- [PULL 36/51] include: Don't include qemu/osdep.h, Michael S. Tsirkin, 2023/01/05
- [PULL 37/51] docs/devel: Rules on #include in headers,
Michael S. Tsirkin <=
- [PULL 39/51] vdpa: harden the error path if get_iova_range failed, Michael S. Tsirkin, 2023/01/05
- [PULL 40/51] vhost: simplify vhost_dev_enable_notifiers, Michael S. Tsirkin, 2023/01/05
- [PULL 41/51] vhost: configure all host notifiers in a single MR transaction, Michael S. Tsirkin, 2023/01/05
- [PULL 43/51] virtio-pci: fix proxy->vector_irqfd leak in virtio_pci_set_guest_notifiers, Michael S. Tsirkin, 2023/01/05
- [PULL 38/51] vdpa-dev: get iova range explicitly, Michael S. Tsirkin, 2023/01/05
- [PULL 42/51] vdpa: commit all host notifier MRs in a single MR transaction, Michael S. Tsirkin, 2023/01/05
- [PULL 44/51] tests: virt: Allow changes to PPTT test table, Michael S. Tsirkin, 2023/01/05
- [PULL 45/51] hw/acpi/aml-build: Only generate cluster node in PPTT when specified, Michael S. Tsirkin, 2023/01/05
- [PULL 46/51] tests: virt: Update expected ACPI tables for virt test, Michael S. Tsirkin, 2023/01/05