Skip to contentSkip to conversation

block: Clean up includes

PATCH Applied Peter Maydell 3 participants 5 messages Jan 18, 2016 – Jan 19, 2016 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: Clean up includes

Clean up includes so that osdep.h is included first and headers which it implies are not included manually.

This commit was created with scripts/clean-includes.

---
 block/accounting.c              |  1 +
 block/archipelago.c             |  2 +-
 block/backup.c                  |  4 +---
 block/blkdebug.c                |  1 +
 block/blkverify.c               |  2 +-
 block/block-backend.c           |  1 +
 block/bochs.c                   |  1 +
 block/cloop.c                   |  1 +
 block/commit.c                  |  1 +
 block/curl.c                    |  1 +
 block/dmg.c                     |  1 +
 block/gluster.c                 |  1 +
 block/io.c                      |  1 +
 block/iscsi.c                   |  2 +-
 block/linux-aio.c               |  1 +
 block/mirror.c                  |  1 +
 block/nbd-client.c              |  1 +
 block/nbd.c                     |  3 +--
 block/nfs.c                     |  2 +-
 block/null.c                    |  1 +
 block/parallels.c               |  1 +
 block/qapi.c                    |  1 +
 block/qcow.c                    |  1 +
 block/qcow2-cache.c             |  3 +--
 block/qcow2-cluster.c           |  1 +
 block/qcow2-refcount.c          |  1 +
 block/qcow2-snapshot.c          |  1 +
 block/qcow2.c                   |  1 +
 block/qed-check.c               |  1 +
 block/qed-cluster.c             |  1 +
 block/qed-gencb.c               |  1 +
 block/qed-l2-cache.c            |  1 +
 block/qed-table.c               |  1 +
 block/qed.c                     |  1 +
 block/quorum.c                  |  1 +
 block/raw-posix.c               |  3 +--
 block/raw-win32.c               |  1 +
 block/raw_bsd.c                 |  1 +
 block/rbd.c                     |  2 +-
 block/sheepdog.c                |  1 +
 block/snapshot.c                |  1 +
 block/ssh.c                     |  4 +---
 block/stream.c                  |  1 +
 block/throttle-groups.c         |  1 +
 block/vdi.c                     |  1 +
 block/vhdx-endian.c             |  1 +
 block/vhdx-log.c                |  1 +
 block/vhdx.c                    |  1 +
 block/vmdk.c                    |  1 +
 block/vpc.c                     |  1 +
 block/vvfat.c                   |  2 +-
 block/win32-aio.c               |  1 +
 block/write-threshold.c         |  1 +
 hw/block/block.c                |  1 +
 hw/block/cdrom.c                |  1 +
 hw/block/dataplane/virtio-blk.c |  1 +
 hw/block/ecc.c                  |  1 +
 hw/block/fdc.c                  |  1 +
 hw/block/hd-geometry.c          |  1 +
 hw/block/m25p80.c               |  1 +
 hw/block/nvme.c                 |  1 +
 hw/block/onenand.c              |  1 +
 hw/block/pflash_cfi01.c         |  1 +
 hw/block/pflash_cfi02.c         |  1 +
 hw/block/tc58128.c              |  1 +
 hw/block/virtio-blk.c           |  1 +
 hw/block/xen_disk.c             | 12 +-----------
 qemu-img.c                      |  2 +-
 qemu-io-cmds.c                  |  1 +
 qemu-io.c                       |  5 +----
 70 files changed, 70 insertions(+), 34 deletions(-)
block/accounting.c +1 -0
index 185025e..3f457c4 100644
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "block/accounting.h"
 #include "block/block_int.h"
 #include "qemu/timer.h"
block/archipelago.c +1 -1
index 855655c..0507589 100644
@@ -50,6 +50,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/error-report.h"
@@ -59,7 +60,6 @@
 #include "qapi/qmp/qjson.h"
 #include "qemu/atomic.h"
 
-#include <inttypes.h>
 #include <xseg/xseg.h>
 #include <xseg/protocol.h>
 
block/backup.c +1 -3
index 705bb77..00cafdb 100644
@@ -11,9 +11,7 @@
  *
  */
 
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
+#include "qemu/osdep.h"
 
 #include "trace.h"
 #include "block/block.h"
block/blkdebug.c +1 -0
index 86b143d..f85c54b 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/config-file.h"
 #include "block/block_int.h"
block/blkverify.c +1 -1
index 1d75449..2a885cc 100644
@@ -7,7 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <stdarg.h>
+#include "qemu/osdep.h"
 #include "qemu/sockets.h" /* for EINPROGRESS on Windows */
 #include "block/block_int.h"
 #include "qapi/qmp/qdict.h"
block/block-backend.c +1 -0
index e813759..efd6146 100644
@@ -10,6 +10,7 @@
  * or later.  See the COPYING.LIB file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/block-backend.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
block/bochs.c +1 -0
index 18949b9..8b953bb 100644
@@ -22,6 +22,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
block/cloop.c +1 -0
index 4190ae0..41bdee8 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
block/commit.c +1 -0
index a5d02aa..446a3ae 100644
@@ -12,6 +12,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "trace.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
block/curl.c +1 -0
index 8994182..1507e0a 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "block/block_int.h"
block/dmg.c +1 -0
index 546a6f5..1018fd1 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/bswap.h"
block/gluster.c +1 -0
index 0857c14..65077a0 100644
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  *
  */
+#include "qemu/osdep.h"
 #include <glusterfs/api/glfs.h>
 #include "block/block_int.h"
 #include "qemu/uri.h"
block/io.c +1 -0
index 63e3678..707c04b 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "trace.h"
 #include "sysemu/block-backend.h"
 #include "block/blockjob.h"
block/iscsi.c +1 -1
index 3acb052..bffd707 100644
@@ -23,7 +23,7 @@
  * THE SOFTWARE.
  */
 
-#include "config-host.h"
+#include "qemu/osdep.h"
 
 #include <poll.h>
 #include <math.h>
block/linux-aio.c +1 -0
index 88b0520..805757e 100644
@@ -7,6 +7,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/aio.h"
 #include "qemu/queue.h"
block/mirror.c +1 -0
index f201f2b..e9e151c 100644
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "trace.h"
 #include "block/blockjob.h"
 #include "block/block_int.h"
block/nbd-client.c +1 -0
index b7fd17a..568c56c 100644
@@ -26,6 +26,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "nbd-client.h"
 #include "qemu/sockets.h"
 
block/nbd.c +1 -2
index 416f42b..1a90bc7 100644
@@ -26,6 +26,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "block/nbd-client.h"
 #include "qemu/uri.h"
 #include "block/block_int.h"
@@ -36,8 +37,6 @@
 #include "qapi/qmp/qint.h"
 #include "qapi/qmp/qstring.h"
 
-#include <sys/types.h>
-#include <unistd.h>
 
 #define EN_OPTSTR ":exportname="
 
block/nfs.c +1 -1
index fd79f89..5eb8c13 100644
@@ -22,7 +22,7 @@
  * THE SOFTWARE.
  */
 
-#include "config-host.h"
+#include "qemu/osdep.h"
 
 #include <poll.h>
 #include "qemu-common.h"
block/null.c +1 -0
index 7d08323..d90165d 100644
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "block/block_int.h"
 
 #define NULL_OPT_LATENCY "latency-ns"
block/parallels.c +1 -0
index e4a56a5..ee39081 100644
@@ -27,6 +27,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
block/qapi.c +1 -0
index 58d3975..a49c118 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "block/qapi.h"
 #include "block/block_int.h"
 #include "block/throttle-groups.h"
block/qcow.c +1 -0
index 635085e..afed18f 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
block/qcow2-cache.c +1 -2
index 86dd7f2..0fe8eda 100644
@@ -23,7 +23,7 @@
  */
 
 /* Needed for CONFIG_MADVISE */
-#include "config-host.h"
+#include "qemu/osdep.h"
 
 #if defined(CONFIG_MADVISE) || defined(CONFIG_POSIX_MADVISE)
 #include <sys/mman.h>
@@ -31,7 +31,6 @@
 
 #include "block/block_int.h"
 #include "qemu-common.h"
-#include "qemu/osdep.h"
 #include "qcow2.h"
 #include "trace.h"
 
block/qcow2-cluster.c +1 -0
index 34112c3..3e887e9 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include <zlib.h>
 
 #include "qemu-common.h"
block/qcow2-refcount.c +1 -0
index af493f8..52a0a9f 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "block/qcow2.h"
block/qcow2-snapshot.c +1 -0
index def7201..13f88d1 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "block/qcow2.h"
block/qcow2.c +1 -0
index d992e7f..e4e2754 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
block/qed-check.c +1 -0
index 36ecd29..622f308 100644
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qed.h"
 
 typedef struct {
block/qed-cluster.c +1 -0
index f64b2af..c24e756 100644
@@ -12,6 +12,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qed.h"
 
 /**
block/qed-gencb.c +1 -0
index b817a8b..faf8ecc 100644
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qed.h"
 
 void *gencb_alloc(size_t len, BlockCompletionFunc *cb, void *opaque)
block/qed-l2-cache.c +1 -0
index e9b2aae..5cba794 100644
@@ -50,6 +50,7 @@
  * table will be deleted in favor of the existing cache entry.
  */
 
+#include "qemu/osdep.h"
 #include "trace.h"
 #include "qed.h"
 
block/qed-table.c +1 -0
index f4219b8..802945f 100644
@@ -12,6 +12,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "trace.h"
 #include "qemu/sockets.h" /* for EINPROGRESS on Windows */
 #include "qed.h"
block/qed.c +1 -0
index 31f4cc9..093d6e5 100644
@@ -12,6 +12,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu/timer.h"
 #include "trace.h"
 #include "qed.h"
block/quorum.c +1 -0
index 6793f12..a5ae4b8 100644
@@ -13,6 +13,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "block/block_int.h"
 #include "qapi/qmp/qbool.h"
 #include "qapi/qmp/qdict.h"
block/raw-posix.c +1 -2
index 076d070..609d677 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
@@ -51,8 +52,6 @@
 #include <sys/dkio.h>
 #endif
 #ifdef __linux__
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/param.h>
 #include <linux/cdrom.h>
block/raw-win32.c +1 -0
index 2d0907a..21a6cb8 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
 #include "block/block_int.h"
block/raw_bsd.c +1 -0
index 915d6fd..bcaee11 100644
@@ -26,6 +26,7 @@
  * IN THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "block/block_int.h"
 #include "qemu/option.h"
 
block/rbd.c +1 -1
index a60a19d..51b64f3 100644
@@ -11,7 +11,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
-#include <inttypes.h>
+#include "qemu/osdep.h"
 
 #include "qemu-common.h"
 #include "qemu/error-report.h"
block/sheepdog.c +1 -0
index 6986be8..ff89298 100644
@@ -12,6 +12,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/uri.h"
 #include "qemu/error-report.h"
block/snapshot.c +1 -0
index 2d86b88..17a27b5 100644
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "block/snapshot.h"
 #include "block/block_int.h"
 #include "qapi/qmp/qerror.h"
block/ssh.c +1 -3
index af025c0..04deeba 100644
@@ -22,9 +22,7 @@
  * THE SOFTWARE.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
+#include "qemu/osdep.h"
 
 #include <libssh2.h>
 #include <libssh2_sftp.h>
block/stream.c +1 -0
index 25af7ef..cafaa07 100644
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "trace.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
block/throttle-groups.c +1 -0
index 13b5baa..4920e09 100644
@@ -22,6 +22,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "block/throttle-groups.h"
 #include "qemu/queue.h"
 #include "qemu/thread.h"
block/vdi.c +1 -0
index 17f435f..61bcd54 100644
@@ -49,6 +49,7 @@
  * so this seems to be reasonable.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
block/vhdx-endian.c +1 -0
index 0640d3f..da33cd3 100644
@@ -15,6 +15,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "block/vhdx.h"
block/vhdx-log.c +1 -0
index ab86416..3690761 100644
@@ -17,6 +17,7 @@
  * See the COPYING.LIB file in the top-level directory.
  *
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/error-report.h"
block/vhdx.c +1 -0
index 2fe9a5e..72042e9 100644
@@ -15,6 +15,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
block/vmdk.c +1 -0
index 2b5cb00..6b8596c 100644
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qapi/qmp/qerror.h"
block/vpc.c +1 -0
index 299d373..d852f96 100644
@@ -22,6 +22,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
block/vvfat.c +1 -1
index b184eca..2ea5a4a 100644
@@ -22,7 +22,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <sys/stat.h>
+#include "qemu/osdep.h"
 #include <dirent.h>
 #include "qemu-common.h"
 #include "block/block_int.h"
block/win32-aio.c +1 -0
index bbf2f01..2d509a9 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
 #include "block/block_int.h"
block/write-threshold.c +1 -0
index 0fe3891..cc2ca71 100644
@@ -10,6 +10,7 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "block/block_int.h"
 #include "qemu/coroutine.h"
 #include "block/write-threshold.h"
hw/block/block.c +1 -0
index f7243e5..960df2b 100644
@@ -7,6 +7,7 @@
  * later.  See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/block-backend.h"
 #include "hw/block/block.h"
hw/block/cdrom.c +1 -0
index 4e1019c..da937fe 100644
@@ -25,6 +25,7 @@
 /* ??? Most of the ATAPI emulation is still in ide.c.  It should be moved
    here.  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/scsi/scsi.h"
 
hw/block/dataplane/virtio-blk.c +1 -0
index b8ce6cd..bc34046 100644
@@ -12,6 +12,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "trace.h"
 #include "qemu/iov.h"
 #include "qemu/thread.h"
hw/block/ecc.c +1 -0
index 10bb233..48311d2 100644
@@ -11,6 +11,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/block/flash.h"
 
hw/block/fdc.c +1 -0
index 858f5f7..6711c6a 100644
@@ -27,6 +27,7 @@
  * way. There are changes in DOR register and DMA is not available.
  */
 
+#include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/block/fdc.h"
 #include "qemu/error-report.h"
hw/block/hd-geometry.c +1 -0
index b187878..6d02192 100644
@@ -30,6 +30,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/block-backend.h"
 #include "hw/block/block.h"
 #include "trace.h"
hw/block/m25p80.c +1 -0
index efc43dd..4bbf90d 100644
@@ -21,6 +21,7 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
hw/block/nvme.c +1 -0
index 169e4fa..a5fedb2 100644
@@ -20,6 +20,7 @@
  *      -device nvme,drive=<drive_id>,serial=<serial>,id=<id[optional]>
  */
 
+#include "qemu/osdep.h"
 #include <hw/block/block.h>
 #include <hw/hw.h>
 #include <hw/pci/msix.h>
hw/block/onenand.c +1 -0
index 58eff50..9189685 100644
@@ -18,6 +18,7 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/block/flash.h"
hw/block/pflash_cfi01.c +1 -0
index 2ba6c77..a4c4fa1 100644
@@ -36,6 +36,7 @@
  * It does not implement much more ...
  */
 
+#include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/block/flash.h"
 #include "sysemu/block-backend.h"
hw/block/pflash_cfi02.c +1 -0
index 074a005..aaa697a 100644
@@ -35,6 +35,7 @@
  * It does not implement multiple sectors erase
  */
 
+#include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/block/flash.h"
 #include "qemu/timer.h"
hw/block/tc58128.c +1 -0
index 728f1c3..7909d50 100644
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/sh4/sh.h"
 #include "hw/loader.h"
hw/block/virtio-blk.c +1 -0
index 51f867b..11bedff 100644
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/iov.h"
 #include "qemu/error-report.h"
hw/block/xen_disk.c +1 -11
index a48e726..571f651 100644
@@ -19,18 +19,8 @@
  *  GNU GPL, version 2 or (at your option) any later version.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <unistd.h>
-#include <inttypes.h>
-#include <time.h>
-#include <fcntl.h>
-#include <errno.h>
+#include "qemu/osdep.h"
 #include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <sys/mman.h>
 #include <sys/uio.h>
 
qemu-img.c +1 -1
index a5949e6..3110e37 100644
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "qapi-visit.h"
 #include "qapi/qmp-output-visitor.h"
 #include "qapi/qmp/qerror.h"
@@ -28,7 +29,6 @@
 #include "qemu-common.h"
 #include "qemu/option.h"
 #include "qemu/error-report.h"
-#include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/block-backend.h"
 #include "block/block_int.h"
qemu-io-cmds.c +1 -0
index 18fc2bd..e929d24 100644
@@ -8,6 +8,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-io.h"
 #include "sysemu/block-backend.h"
 #include "block/block.h"
qemu-io.c +1 -4
index d47228a..d593f19 100644
@@ -7,10 +7,7 @@
  * This work is licensed under the terms of the GNU GPL, version 2 or later.
  * See the COPYING file in the top-level directory.
  */
-#include <sys/time.h>
-#include <sys/types.h>
-#include <stdarg.h>
-#include <stdio.h>
+#include "qemu/osdep.h"
 #include <getopt.h>
 #include <libgen.h>
 
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Peter Maydell

Clean up includes so that osdep.h is included first and headers which it implies are not included manually.

This commit was created with scripts/clean-includes.

---

 70 files changed, 70 insertions(+), 34 deletions(-)

Mechanical, and I didn't spot any problems.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#2 lore raw
In reply to Peter Maydell

Am 18.01.2016 um 19:01 hat Peter Maydell geschrieben:

Quoted 10 lines

Clean up includes so that osdep.h is included first and headers which it implies are not included manually.

This commit was created with scripts/clean-includes.

block/archipelago.c line 56

Quoted 7 lines
block/archipelago.c +1 -0
@@ -50,6 +50,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/error-report.h"

qemu/osdep.h is already included by qemu-common.h. Do you intend to remove all qemu/osdep.h includes from all header files (and possibly error out if it hasn't been included before) as soon as most/all .c files include it explicitly?

This is what git grep says on include/:

include/exec/cpu-defs.h:#include "qemu/osdep.h" include/exec/helper-head.h:#include "qemu/osdep.h" include/fpu/softfloat.h:#include "qemu/osdep.h" include/qemu-common.h:#include "qemu/osdep.h" include/qemu/bitmap.h:#include "qemu/osdep.h" include/qemu/module.h:#include "qemu/osdep.h" include/sysemu/seccomp.h:#include "qemu/osdep.h"

Kevin

#3 lore raw
Quoted 14 lines · Kevin Wolf

Am 18.01.2016 um 19:01 hat Peter Maydell geschrieben:

Quoted 13 lines

Clean up includes so that osdep.h is included first and headers which it implies are not included manually.

This commit was created with scripts/clean-includes.

block/archipelago.c +0 -0
@@ -50,6 +50,7 @@
  *
  */
 
Quoted 9 lines

block/archipelago.c line 56

Quoted 4 lines
block/archipelago.c +1 -0
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/error-report.h"

qemu/osdep.h is already included by qemu-common.h. Do you intend to remove all qemu/osdep.h includes from all header files (and possibly error out if it hasn't been included before) as soon as most/all .c files include it explicitly?

Yes, for suitable values of "as soon as".

Quoted 9 lines

This is what git grep says on include/:

include/exec/cpu-defs.h:#include "qemu/osdep.h" include/exec/helper-head.h:#include "qemu/osdep.h" include/fpu/softfloat.h:#include "qemu/osdep.h" include/qemu-common.h:#include "qemu/osdep.h" include/qemu/bitmap.h:#include "qemu/osdep.h" include/qemu/module.h:#include "qemu/osdep.h" include/sysemu/seccomp.h:#include "qemu/osdep.h"

We can't get rid of these until all C files include osdep.h as their first include. Hence these patches...

thanks
-- PMM

Applied
#4 lore raw
In reply to Peter Maydell

Am 18.01.2016 um 19:01 hat Peter Maydell geschrieben:

Quoted 6 lines

Clean up includes so that osdep.h is included first and headers which it implies are not included manually.

This commit was created with scripts/clean-includes.

Thanks, applied to the block branch.

Kevin