[PATCH 2/2] src: More cleanup of some system headers already contained in internal.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All of the ones being removed are pulled in by internal.h. The only
exception is sanlock which expects the application to include <stdint.h>
before sanlock's headers, because sanlock prototypes use fixed width
int, but they don't include stdint.h themselves, so we have to leave
that one in place.

Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx>
---
 src/conf/capabilities.c                   | 3 ---
 src/conf/network_conf.c                   | 1 -
 src/conf/node_device_conf.c               | 1 -
 src/conf/storage_conf.c                   | 3 ---
 src/cpu/cpu_ppc64.c                       | 1 -
 src/cpu/cpu_ppc64_data.h                  | 1 -
 src/cpu/cpu_x86.c                         | 1 -
 src/cpu/cpu_x86_data.h                    | 1 -
 src/esx/esx_storage_backend_iscsi.c       | 1 -
 src/esx/esx_storage_backend_vmfs.c        | 1 -
 src/esx/esx_vi_types.c                    | 1 -
 src/interface/interface_backend_udev.c    | 1 -
 src/libvirt.c                             | 2 --
 src/libxl/libxl_logger.c                  | 1 -
 src/locking/lock_daemon.c                 | 1 -
 src/locking/lock_driver_sanlock.c         | 3 ---
 src/locking/lock_manager.c                | 1 -
 src/locking/sanlock_helper.c              | 1 -
 src/logging/log_daemon.c                  | 1 -
 src/lxc/lxc_container.c                   | 2 --
 src/lxc/lxc_controller.c                  | 1 -
 src/lxc/lxc_driver.c                      | 1 -
 src/lxc/lxc_fuse.c                        | 2 --
 src/network/bridge_driver.c               | 4 ----
 src/network/leaseshelper.c                | 1 -
 src/node_device/node_device_driver.c      | 1 -
 src/node_device/node_device_hal.c         | 1 -
 src/node_device/node_device_udev.h        | 1 -
 src/nwfilter/nwfilter_ebiptables_driver.c | 1 -
 src/openvz/openvz_conf.c                  | 4 ----
 src/openvz/openvz_driver.c                | 4 ----
 src/phyp/phyp_driver.c                    | 4 ----
 src/qemu/qemu_agent.c                     | 1 -
 src/qemu/qemu_conf.c                      | 4 ----
 src/qemu/qemu_driver.c                    | 4 ----
 src/qemu/qemu_hostdev.c                   | 1 -
 src/qemu/qemu_monitor_json.c              | 1 -
 src/qemu/qemu_monitor_text.c              | 1 -
 src/qemu/qemu_security.h                  | 1 -
 src/remote/remote_daemon.c                | 1 -
 src/rpc/virnetdaemon.c                    | 1 -
 src/rpc/virnetmessage.c                   | 1 -
 src/rpc/virnetservermdns.c                | 1 -
 src/rpc/virnettlscontext.c                | 1 -
 src/secret/secret_driver.c                | 1 -
 src/security/security_apparmor.c          | 1 -
 src/security/security_driver.c            | 1 -
 src/security/virt-aa-helper.c             | 3 ---
 src/storage/parthelper.c                  | 1 -
 src/storage/storage_backend.c             | 1 -
 src/storage/storage_backend_disk.c        | 1 -
 src/storage/storage_backend_fs.c          | 2 --
 src/storage/storage_backend_iscsi.c       | 1 -
 src/storage/storage_backend_logical.c     | 1 -
 src/storage/storage_driver.c              | 2 --
 src/storage/storage_file_fs.c             | 1 -
 src/storage/storage_util.c                | 1 -
 src/test/test_driver.c                    | 1 -
 src/uml/uml_conf.c                        | 4 ----
 src/uml/uml_driver.c                      | 4 ----
 src/util/iohelper.c                       | 1 -
 src/util/viralloc.c                       | 1 -
 src/util/virarptable.c                    | 1 -
 src/util/virauth.c                        | 1 -
 src/util/virbitmap.c                      | 4 ----
 src/util/virbuffer.c                      | 2 --
 src/util/vircgroup.c                      | 3 ---
 src/util/vircommand.c                     | 1 -
 src/util/virconf.c                        | 1 -
 src/util/virdnsmasq.c                     | 4 ----
 src/util/virerror.c                       | 2 --
 src/util/virevent.c                       | 1 -
 src/util/vireventpoll.c                   | 3 ---
 src/util/virfile.c                        | 1 -
 src/util/virhash.c                        | 2 --
 src/util/virhash.h                        | 2 --
 src/util/virhook.c                        | 1 -
 src/util/virhostcpu.c                     | 4 ----
 src/util/virhostdev.c                     | 1 -
 src/util/virhostmem.c                     | 4 ----
 src/util/viriptables.c                    | 4 ----
 src/util/virkeycode.c                     | 1 -
 src/util/virlog.c                         | 1 -
 src/util/virmacaddr.c                     | 1 -
 src/util/virnetdevmacvlan.c               | 2 --
 src/util/virnetdevtap.c                   | 2 --
 src/util/virnetdevvportprofile.c          | 2 --
 src/util/virnetlink.c                     | 1 -
 src/util/virpci.c                         | 3 ---
 src/util/virprocess.c                     | 2 --
 src/util/virrandom.c                      | 1 -
 src/util/virscsi.c                        | 2 --
 src/util/virsexpr.c                       | 3 ---
 src/util/virstoragefile.c                 | 1 -
 src/util/virstoragefilebackend.c          | 1 -
 src/util/virstring.c                      | 1 -
 src/util/virsysinfo.c                     | 1 -
 src/util/virusb.c                         | 2 --
 src/util/virutil.c                        | 3 ---
 src/util/viruuid.c                        | 3 ---
 src/util/virxml.c                         | 3 ---
 src/vbox/vbox_XPCOMCGlue.c                | 1 -
 src/vmware/vmware_conf.c                  | 1 -
 src/vz/vz_driver.c                        | 4 ----
 src/xenapi/xenapi_driver.c                | 2 --
 src/xenapi/xenapi_utils.c                 | 1 -
 tests/commandhelper.c                     | 2 --
 tests/commandtest.c                       | 2 --
 tests/cputest.c                           | 2 --
 tests/domaincapsmock.c                    | 1 -
 tests/domaincapstest.c                    | 1 -
 tests/domainsnapshotxml2xmltest.c         | 2 --
 tests/esxutilstest.c                      | 1 -
 tests/eventtest.c                         | 1 -
 tests/fdstreamtest.c                      | 1 -
 tests/genericxml2xmltest.c                | 2 --
 tests/interfacexml2xmltest.c              | 2 --
 tests/libxlxml2domconfigtest.c            | 2 --
 tests/lxcxml2xmltest.c                    | 2 --
 tests/networkxml2conftest.c               | 2 --
 tests/networkxml2xmltest.c                | 2 --
 tests/networkxml2xmlupdatetest.c          | 2 --
 tests/nodedevxml2xmltest.c                | 2 --
 tests/nsstest.c                           | 1 -
 tests/nwfilterxml2xmltest.c               | 2 --
 tests/openvzutilstest.c                   | 1 -
 tests/qemuargv2xmltest.c                  | 2 --
 tests/qemublocktest.c                     | 1 -
 tests/qemucpumock.c                       | 1 -
 tests/qemumemlocktest.c                   | 2 --
 tests/qemumonitortestutils.c              | 2 --
 tests/qemuxml2argvtest.c                  | 2 --
 tests/qemuxml2xmltest.c                   | 2 --
 tests/seclabeltest.c                      | 3 ---
 tests/secretxml2xmltest.c                 | 1 -
 tests/securityselinuxhelper.c             | 2 --
 tests/securityselinuxlabeltest.c          | 2 --
 tests/securityselinuxtest.c               | 2 --
 tests/sexpr2xmltest.c                     | 1 -
 tests/shunloadhelper.c                    | 1 -
 tests/shunloadtest.c                      | 1 -
 tests/sockettest.c                        | 2 --
 tests/storagebackendsheepdogtest.c        | 2 --
 tests/storagepoolxml2xmltest.c            | 2 --
 tests/storagevolxml2xmltest.c             | 2 --
 tests/sysinfotest.c                       | 2 --
 tests/testutils.c                         | 3 ---
 tests/testutilslxc.c                      | 1 -
 tests/testutilsqemu.c                     | 1 -
 tests/testutilsxen.c                      | 1 -
 tests/utiltest.c                          | 2 --
 tests/vboxsnapshotxmltest.c               | 1 -
 tests/virauthconfigtest.c                 | 1 -
 tests/virbuftest.c                        | 2 --
 tests/vircaps2xmltest.c                   | 1 -
 tests/vircapstest.c                       | 1 -
 tests/vircgroupmock.c                     | 1 -
 tests/vircgrouptest.c                     | 1 -
 tests/virconftest.c                       | 3 ---
 tests/virdbustest.c                       | 1 -
 tests/virfiletest.c                       | 1 -
 tests/virfilewrapper.c                    | 1 -
 tests/virhashtest.c                       | 2 --
 tests/virhostcputest.c                    | 2 --
 tests/virhostdevtest.c                    | 1 -
 tests/viridentitytest.c                   | 1 -
 tests/virjsontest.c                       | 2 --
 tests/virkeycodetest.c                    | 1 -
 tests/virkeyfiletest.c                    | 1 -
 tests/virkmodtest.c                       | 1 -
 tests/virlockspacetest.c                  | 1 -
 tests/virmock.h                           | 1 -
 tests/virnetdevmock.c                     | 1 -
 tests/virnetmessagetest.c                 | 1 -
 tests/virnetsockettest.c                  | 1 -
 tests/virnettlscontexttest.c              | 1 -
 tests/virnettlshelpers.c                  | 1 -
 tests/virnettlssessiontest.c              | 1 -
 tests/virnwfilterbindingxml2xmltest.c     | 2 --
 tests/virpcimock.c                        | 1 -
 tests/virpcitest.c                        | 1 -
 tests/virpolkittest.c                     | 1 -
 tests/virportallocatormock.c              | 2 --
 tests/virportallocatortest.c              | 1 -
 tests/virresctrltest.c                    | 1 -
 tests/virschematest.c                     | 1 -
 tests/virscsitest.c                       | 1 -
 tests/virshtest.c                         | 1 -
 tests/virstoragetest.c                    | 1 -
 tests/virstorageutiltest.c                | 1 -
 tests/virstringtest.c                     | 1 -
 tests/virsystemdtest.c                    | 1 -
 tests/virtimetest.c                       | 1 -
 tests/viruritest.c                        | 1 -
 tests/virusbmock.c                        | 1 -
 tests/virusbtest.c                        | 1 -
 tests/vmwarevertest.c                     | 1 -
 tests/vmx2xmltest.c                       | 1 -
 tests/vshtabletest.c                      | 1 -
 tests/xlconfigtest.c                      | 1 -
 tests/xmconfigtest.c                      | 1 -
 tests/xml2sexprtest.c                     | 2 --
 tests/xml2vmxtest.c                       | 1 -
 tools/virsh-console.c                     | 2 --
 tools/virsh.c                             | 4 ----
 tools/virsh.h                             | 2 --
 tools/virt-admin.c                        | 1 -
 tools/virt-host-validate-common.c         | 1 -
 tools/virt-host-validate.c                | 1 -
 tools/virt-login-shell.c                  | 2 --
 tools/vsh-table.c                         | 1 -
 tools/vsh.c                               | 4 ----
 tools/vsh.h                               | 2 --
 tools/wireshark/src/packet-libvirt.c      | 1 -
 214 files changed, 344 deletions(-)

diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index ed988369ef..8a30d08f9b 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -23,10 +23,7 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <strings.h>
-#include <stdlib.h>
-#include <stdint.h>
 #include <unistd.h>
 
 #include "capabilities.h"
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 5372aff82a..39a13b433d 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -28,7 +28,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <string.h>
 
 #include "virerror.h"
 #include "datatypes.h"
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index fd8f4e4a94..03bd794dc0 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -25,7 +25,6 @@
 #include <config.h>
 
 #include <unistd.h>
-#include <errno.h>
 
 #include "virerror.h"
 #include "datatypes.h"
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index eebbb46102..bf3ca2b87b 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -23,13 +23,10 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include <errno.h>
 #include <fcntl.h>
-#include <string.h>
 
 #include "virerror.h"
 #include "datatypes.h"
diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index fcba7e9b37..858f40e0f0 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -25,7 +25,6 @@
  */
 
 #include <config.h>
-#include <stdint.h>
 
 #include "virlog.h"
 #include "viralloc.h"
diff --git a/src/cpu/cpu_ppc64_data.h b/src/cpu/cpu_ppc64_data.h
index 6c069ebe61..ddbffaef05 100644
--- a/src/cpu/cpu_ppc64_data.h
+++ b/src/cpu/cpu_ppc64_data.h
@@ -24,7 +24,6 @@
 #ifndef __VIR_CPU_PPC64_DATA_H__
 # define __VIR_CPU_PPC64_DATA_H__
 
-# include <stdint.h>
 
 typedef struct _virCPUppc64PVR virCPUppc64PVR;
 struct _virCPUppc64PVR {
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 4770850693..69a0c8db28 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -23,7 +23,6 @@
 
 #include <config.h>
 
-#include <stdint.h>
 
 #include "virlog.h"
 #include "viralloc.h"
diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h
index 090a21156f..e75b3a2d0d 100644
--- a/src/cpu/cpu_x86_data.h
+++ b/src/cpu/cpu_x86_data.h
@@ -24,7 +24,6 @@
 #ifndef __VIR_CPU_X86_DATA_H__
 # define __VIR_CPU_X86_DATA_H__
 
-# include <stdint.h>
 
 typedef struct _virCPUx86CPUID virCPUx86CPUID;
 struct _virCPUx86CPUID {
diff --git a/src/esx/esx_storage_backend_iscsi.c b/src/esx/esx_storage_backend_iscsi.c
index 0897c9cb25..49edf70284 100644
--- a/src/esx/esx_storage_backend_iscsi.c
+++ b/src/esx/esx_storage_backend_iscsi.c
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <unistd.h>
 
 #include "internal.h"
diff --git a/src/esx/esx_storage_backend_vmfs.c b/src/esx/esx_storage_backend_vmfs.c
index 58ee753403..8458d4e95c 100644
--- a/src/esx/esx_storage_backend_vmfs.c
+++ b/src/esx/esx_storage_backend_vmfs.c
@@ -24,7 +24,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <unistd.h>
 
 #include "internal.h"
diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c
index a21a32973a..c77e759de2 100644
--- a/src/esx/esx_vi_types.c
+++ b/src/esx/esx_vi_types.c
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#include <stdint.h>
 #include <libxml/parser.h>
 #include <libxml/xpathInternals.h>
 
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
index 4b975ae4b4..1373356246 100644
--- a/src/interface/interface_backend_udev.c
+++ b/src/interface/interface_backend_udev.c
@@ -20,7 +20,6 @@
  */
 #include <config.h>
 
-#include <errno.h>
 #include <dirent.h>
 #include <libudev.h>
 
diff --git a/src/libvirt.c b/src/libvirt.c
index 48856b2803..0a738aefb1 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -23,8 +23,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
diff --git a/src/libxl/libxl_logger.c b/src/libxl/libxl_logger.c
index 40404826fc..9e6e504445 100644
--- a/src/libxl/libxl_logger.c
+++ b/src/libxl/libxl_logger.c
@@ -22,7 +22,6 @@
  */
 #include <config.h>
 
-#include <string.h>
 #include <libxl.h>
 
 #include "internal.h"
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index 1438345c6d..5bd7c4600a 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -27,7 +27,6 @@
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <getopt.h>
-#include <stdlib.h>
 
 
 #include "lock_daemon.h"
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index daa11728a7..3ad0dc9bed 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
@@ -21,11 +21,8 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <stdint.h>
 #include <unistd.h>
-#include <string.h>
-#include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c
index 84d0c30d37..9067f5a01a 100644
--- a/src/locking/lock_manager.c
+++ b/src/locking/lock_manager.c
@@ -33,7 +33,6 @@
 #if HAVE_DLFCN_H
 # include <dlfcn.h>
 #endif
-#include <stdlib.h>
 #include <unistd.h>
 
 #include "configmake.h"
diff --git a/src/locking/sanlock_helper.c b/src/locking/sanlock_helper.c
index 267c108964..d589576f04 100644
--- a/src/locking/sanlock_helper.c
+++ b/src/locking/sanlock_helper.c
@@ -1,5 +1,4 @@
 #include <config.h>
-#include <stdlib.h>
 
 #include "internal.h"
 #include "virconf.h"
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index 4415a61d03..edf93ad712 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -27,7 +27,6 @@
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <getopt.h>
-#include <stdlib.h>
 
 
 #include "log_daemon.h"
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index f949785f7d..918194dacd 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -27,8 +27,6 @@
 #include <config.h>
 
 #include <fcntl.h>
-#include <limits.h>
-#include <stdlib.h>
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 #include <sys/wait.h>
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 78556a3d08..d81c8e946d 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -38,7 +38,6 @@
 #include <sys/un.h>
 #include <sys/personality.h>
 #include <unistd.h>
-#include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
 #include <getopt.h>
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 0991845248..d95ed63c18 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -27,7 +27,6 @@
 #include <fcntl.h>
 #include <sched.h>
 #include <sys/utsname.h>
-#include <string.h>
 
 #ifdef MAJOR_IN_MKDEV
 # include <sys/mkdev.h>
diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c
index 5a5091659e..9b889c4b27 100644
--- a/src/lxc/lxc_fuse.c
+++ b/src/lxc/lxc_fuse.c
@@ -24,8 +24,6 @@
 
 #include <config.h>
 #include <fcntl.h>
-#include <errno.h>
-#include <string.h>
 #include <sys/mount.h>
 #include <mntent.h>
 
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 4d0c9b13d1..4bbc4f5a6d 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -25,12 +25,8 @@
 
 #include <sys/types.h>
 #include <sys/poll.h>
-#include <limits.h>
-#include <string.h>
 #include <stdarg.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <errno.h>
 #include <sys/utsname.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c
index ad7e0903f0..40b89ac939 100644
--- a/src/network/leaseshelper.c
+++ b/src/network/leaseshelper.c
@@ -25,7 +25,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "virthread.h"
 #include "virfile.h"
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index d04a31747a..c46d0fbe12 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -25,7 +25,6 @@
 #include <config.h>
 
 #include <unistd.h>
-#include <errno.h>
 #include <fcntl.h>
 #include <time.h>
 
diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index f36888a525..298c08ccb6 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -24,7 +24,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <libhal.h>
 
 #include "node_device_conf.h"
diff --git a/src/node_device/node_device_udev.h b/src/node_device/node_device_udev.h
index f15e5204c3..adbdaf27a8 100644
--- a/src/node_device/node_device_udev.h
+++ b/src/node_device/node_device_udev.h
@@ -21,7 +21,6 @@
  */
 
 #include <libudev.h>
-#include <stdint.h>
 
 #define SYSFS_DATA_SIZE 4096
 #define DMI_DEVPATH "/sys/devices/virtual/dmi/id"
diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c
index c1feabe494..5be1c9b07a 100644
--- a/src/nwfilter/nwfilter_ebiptables_driver.c
+++ b/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -24,7 +24,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/utsname.h>
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 9c90433a41..75d094fcfa 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -28,16 +28,12 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
 #include <dirent.h>
 #include <time.h>
 #include <sys/stat.h>
-#include <limits.h>
-#include <errno.h>
-#include <string.h>
 #include <sys/wait.h>
 
 #include "virerror.h"
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 86e00c422b..0dbd7be0e6 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -30,12 +30,8 @@
 
 #include <sys/types.h>
 #include <sys/poll.h>
-#include <limits.h>
-#include <string.h>
 #include <stdarg.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <errno.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <pwd.h>
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 821a9f2f05..05bf6df7cb 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -26,12 +26,8 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <limits.h>
-#include <string.h>
 #include <stdarg.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <errno.h>
 #include <libssh2.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 313362ac0f..97ad0e7bcb 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -29,7 +29,6 @@
 #include <poll.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <string.h>
 #include <sys/time.h>
 
 #include "qemu_agent.h"
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 8c5f9021f9..33508174cb 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -23,13 +23,9 @@
 
 #include <config.h>
 
-#include <string.h>
-#include <limits.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <errno.h>
 #include <fcntl.h>
 #include <sys/wait.h>
 #include <arpa/inet.h>
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d1cef92739..ae82c7ba7f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -27,12 +27,8 @@
 #include <sys/poll.h>
 #include <sys/time.h>
 #include <dirent.h>
-#include <limits.h>
-#include <string.h>
 #include <stdarg.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <errno.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <signal.h>
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 1e040f98b7..bba141c9ee 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -25,7 +25,6 @@
 
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include <errno.h>
 
 #include "qemu_hostdev.h"
 #include "virlog.h"
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 38c30d1b15..3de298c9e2 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -28,7 +28,6 @@
 #include <sys/un.h>
 #include <poll.h>
 #include <unistd.h>
-#include <string.h>
 #include <sys/time.h>
 
 #include "qemu_monitor_text.h"
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 90a58cd86b..f98c7d1421 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -23,7 +23,6 @@
 
 #include <config.h>
 
-#include <string.h>
 
 #include "qemu_monitor_text.h"
 #include "viralloc.h"
diff --git a/src/qemu/qemu_security.h b/src/qemu/qemu_security.h
index ba12eb3caf..13fc05152c 100644
--- a/src/qemu/qemu_security.h
+++ b/src/qemu/qemu_security.h
@@ -24,7 +24,6 @@
 #ifndef __QEMU_SECURITY_H__
 # define __QEMU_SECURITY_H__
 
-# include <stdbool.h>
 
 # include "qemu_conf.h"
 # include "domain_conf.h"
diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c
index 9f3a5f38ad..c14a561618 100644
--- a/src/remote/remote_daemon.c
+++ b/src/remote/remote_daemon.c
@@ -28,7 +28,6 @@
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <getopt.h>
-#include <stdlib.h>
 #include <grp.h>
 
 #include "libvirt_internal.h"
diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c
index 31b687de12..08ce9c2cd2 100644
--- a/src/rpc/virnetdaemon.c
+++ b/src/rpc/virnetdaemon.c
@@ -23,7 +23,6 @@
 #include <config.h>
 
 #include <unistd.h>
-#include <string.h>
 #include <fcntl.h>
 
 #include "virnetdaemon.h"
diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c
index 94c4c89e4f..bb6ef9a9ae 100644
--- a/src/rpc/virnetmessage.c
+++ b/src/rpc/virnetmessage.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
 
 #include "virnetmessage.h"
diff --git a/src/rpc/virnetservermdns.c b/src/rpc/virnetservermdns.c
index 692675162f..e0a9aefc06 100644
--- a/src/rpc/virnetservermdns.c
+++ b/src/rpc/virnetservermdns.c
@@ -26,7 +26,6 @@
 #include <config.h>
 
 #include <time.h>
-#include <stdlib.h>
 
 #if WITH_AVAHI
 # include <avahi-client/client.h>
diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
index 97b74de89e..7bc6540641 100644
--- a/src/rpc/virnettlscontext.c
+++ b/src/rpc/virnettlscontext.c
@@ -22,7 +22,6 @@
 
 #include <unistd.h>
 #include <fnmatch.h>
-#include <stdlib.h>
 
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 3c3557947e..110117c359 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -23,7 +23,6 @@
 #include <config.h>
 
 #include <fcntl.h>
-#include <string.h>
 #include <sys/stat.h>
 #include <unistd.h>
 
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 802ca0f14d..4ddf2a160b 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -31,7 +31,6 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/apparmor.h>
-#include <errno.h>
 #include <unistd.h>
 #include <wait.h>
 
diff --git a/src/security/security_driver.c b/src/security/security_driver.c
index a845dc7995..ac2e2544b6 100644
--- a/src/security/security_driver.c
+++ b/src/security/security_driver.c
@@ -21,7 +21,6 @@
  *
  */
 #include <config.h>
-#include <string.h>
 
 #include "virerror.h"
 #include "virlog.h"
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index addfb4a48b..03cc15c9d3 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -25,11 +25,8 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <errno.h>
 #include <sys/types.h>
 #include <fcntl.h>
 #include <getopt.h>
diff --git a/src/storage/parthelper.c b/src/storage/parthelper.c
index 9025c7e04a..cf05e63111 100644
--- a/src/storage/parthelper.c
+++ b/src/storage/parthelper.c
@@ -33,7 +33,6 @@
 #include <config.h>
 
 #include <parted/parted.h>
-#include <string.h>
 #include <libdevmapper.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index e7fbc37eb1..a8877548e6 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -23,7 +23,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <sys/stat.h>
 
 #include "datatypes.h"
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index a11dc96d46..10df071322 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -22,7 +22,6 @@
  */
 
 #include <config.h>
-#include <string.h>
 #include <unistd.h>
 
 #include "dirname.h"
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index beaf254295..0837443391 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -25,9 +25,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <errno.h>
 #include <fcntl.h>
-#include <string.h>
 
 #include "virerror.h"
 #include "storage_backend_fs.h"
diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index 55fe47f5e1..fc21fbc5a2 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -25,7 +25,6 @@
 
 #include <dirent.h>
 #include <sys/wait.h>
-#include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/stat.h>
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index 355eeec4cc..cad88756cb 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -26,7 +26,6 @@
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <regex.h>
-#include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
 
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 8f5f9f61dc..e0023cf035 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -32,8 +32,6 @@
 #if HAVE_PWD_H
 # include <pwd.h>
 #endif
-#include <errno.h>
-#include <string.h>
 
 #include "virerror.h"
 #include "datatypes.h"
diff --git a/src/storage/storage_file_fs.c b/src/storage/storage_file_fs.c
index 750bdb9090..7e6a682c0f 100644
--- a/src/storage/storage_file_fs.c
+++ b/src/storage/storage_file_fs.c
@@ -25,7 +25,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <string.h>
 
 #include "virerror.h"
 #include "storage_file_fs.h"
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index b896a0b723..318a556656 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -18,7 +18,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <regex.h>
 #include <sys/types.h>
 #include <sys/wait.h>
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 2156a3e1cf..31d0da744c 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -23,7 +23,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <sys/time.h>
 #include <fcntl.h>
 #include <unistd.h>
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index f116e619ef..52087bcf7c 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -23,13 +23,9 @@
 
 #include <config.h>
 
-#include <string.h>
-#include <limits.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <errno.h>
 #include <fcntl.h>
 #include <sys/wait.h>
 #include <arpa/inet.h>
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 23491bc69d..fcd468243e 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -25,12 +25,8 @@
 
 #include <sys/types.h>
 #include <sys/poll.h>
-#include <limits.h>
-#include <string.h>
 #include <stdarg.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <errno.h>
 #include <sys/utsname.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/src/util/iohelper.c b/src/util/iohelper.c
index 11948e158e..056f7bb3fc 100644
--- a/src/util/iohelper.c
+++ b/src/util/iohelper.c
@@ -29,7 +29,6 @@
 
 #include <unistd.h>
 #include <fcntl.h>
-#include <stdlib.h>
 
 #include "virutil.h"
 #include "virthread.h"
diff --git a/src/util/viralloc.c b/src/util/viralloc.c
index 81f99d9e1f..1646b25fe8 100644
--- a/src/util/viralloc.c
+++ b/src/util/viralloc.c
@@ -21,7 +21,6 @@
  */
 
 #include <config.h>
-#include <stdlib.h>
 
 #include "viralloc.h"
 #include "virlog.h"
diff --git a/src/util/virarptable.c b/src/util/virarptable.c
index 0426c0b15f..3861409811 100644
--- a/src/util/virarptable.c
+++ b/src/util/virarptable.c
@@ -23,7 +23,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <arpa/inet.h>
 #ifdef __linux__
 # include <linux/rtnetlink.h>
diff --git a/src/util/virauth.c b/src/util/virauth.c
index 5f1515e113..9c95332e76 100644
--- a/src/util/virauth.c
+++ b/src/util/virauth.c
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "virauth.h"
 #include "virutil.h"
diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index 73f0b59cee..21c484e1f3 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -23,10 +23,6 @@
 
 #include <config.h>
 
-#include <limits.h>
-#include <stdint.h>
-#include <string.h>
-#include <stdlib.h>
 #include <sys/types.h>
 
 #include "virbitmap.h"
diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c
index 3f400f44db..8a2108f2f2 100644
--- a/src/util/virbuffer.c
+++ b/src/util/virbuffer.c
@@ -22,8 +22,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <stdarg.h>
 #include "c-ctype.h"
 
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 4e541ce300..c825f7c77e 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -29,9 +29,6 @@
 # include <sys/mount.h>
 #endif
 #include <fcntl.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
 #include <sys/stat.h>
 
 #ifdef MAJOR_IN_MKDEV
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index 9a9927566c..de937f6f9a 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -25,7 +25,6 @@
 #include <regex.h>
 #include <signal.h>
 #include <stdarg.h>
-#include <stdlib.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <fcntl.h>
diff --git a/src/util/virconf.c b/src/util/virconf.c
index 5981e0ae98..d38d3f725a 100644
--- a/src/util/virconf.c
+++ b/src/util/virconf.c
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index 2df732a15b..1a1d8eaea6 100644
--- a/src/util/virdnsmasq.c
+++ b/src/util/virdnsmasq.c
@@ -23,11 +23,7 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
diff --git a/src/util/virerror.c b/src/util/virerror.c
index 8bb0382812..c11cba39ab 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -22,8 +22,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <stdarg.h>
 
 #include "virerror.h"
diff --git a/src/util/virevent.c b/src/util/virevent.c
index 87069e35b9..feb6756486 100644
--- a/src/util/virevent.c
+++ b/src/util/virevent.c
@@ -28,7 +28,6 @@
 #include "virlog.h"
 #include "virerror.h"
 
-#include <stdlib.h>
 
 VIR_LOG_INIT("util.event");
 
diff --git a/src/util/vireventpoll.c b/src/util/vireventpoll.c
index 2fe58c7c12..ad1c3cf25c 100644
--- a/src/util/vireventpoll.c
+++ b/src/util/vireventpoll.c
@@ -23,11 +23,8 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <poll.h>
 #include <sys/time.h>
-#include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
 
diff --git a/src/util/virfile.c b/src/util/virfile.c
index af45a51b7f..7fa0c90f76 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -41,7 +41,6 @@
 #if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R
 # include <mntent.h>
 #endif
-#include <stdlib.h>
 #if HAVE_MMAP
 # include <sys/mman.h>
 #endif
diff --git a/src/util/virhash.c b/src/util/virhash.c
index 006ffd8d7f..c20724169c 100644
--- a/src/util/virhash.c
+++ b/src/util/virhash.c
@@ -21,8 +21,6 @@
 
 #include <config.h>
 
-#include <string.h>
-#include <stdlib.h>
 
 #include "virerror.h"
 #include "virhash.h"
diff --git a/src/util/virhash.h b/src/util/virhash.h
index dd789c6e51..8137b4d27b 100644
--- a/src/util/virhash.h
+++ b/src/util/virhash.h
@@ -13,8 +13,6 @@
 #ifndef __VIR_HASH_H__
 # define __VIR_HASH_H__
 
-# include <stdint.h>
-# include <stdbool.h>
 
 # include "viralloc.h"
 
diff --git a/src/util/virhook.c b/src/util/virhook.c
index e5ac4040e5..db4cd7953f 100644
--- a/src/util/virhook.c
+++ b/src/util/virhook.c
@@ -27,7 +27,6 @@
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include <stdlib.h>
 
 #include "virerror.h"
 #include "virhook.h"
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index 2906777928..0fce47d970 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -23,10 +23,6 @@
 
 #include <config.h>
 
-#include <string.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <errno.h>
 #include <dirent.h>
 #include <sys/utsname.h>
 #include <fcntl.h>
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index beb491428d..da7ae99c34 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -29,7 +29,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include <stdlib.h>
 
 #include "virhostdev.h"
 #include "viralloc.h"
diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c
index f64cba28e4..3edc037bb0 100644
--- a/src/util/virhostmem.c
+++ b/src/util/virhostmem.c
@@ -23,10 +23,6 @@
 
 #include <config.h>
 
-#include <string.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <errno.h>
 #include <sys/utsname.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
diff --git a/src/util/viriptables.c b/src/util/viriptables.c
index 2366525f18..5dbea8cf57 100644
--- a/src/util/viriptables.c
+++ b/src/util/viriptables.c
@@ -23,11 +23,7 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
diff --git a/src/util/virkeycode.c b/src/util/virkeycode.c
index 8976bbf376..b148e317e4 100644
--- a/src/util/virkeycode.c
+++ b/src/util/virkeycode.c
@@ -19,7 +19,6 @@
 
 #include <config.h>
 #include "virkeycode.h"
-#include <string.h>
 #include <stddef.h>
 
 #include "virkeycodetable_atset1.h"
diff --git a/src/util/virlog.c b/src/util/virlog.c
index f8d24d845a..e2702da7f8 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -22,7 +22,6 @@
 #include <config.h>
 
 #include <stdarg.h>
-#include <stdlib.h>
 #include <time.h>
 #include <sys/time.h>
 #include <sys/types.h>
diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c
index 237e43f916..db4fa86612 100644
--- a/src/util/virmacaddr.c
+++ b/src/util/virmacaddr.c
@@ -23,7 +23,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "c-ctype.h"
 #include "virmacaddr.h"
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index ddb4c3ad07..d87191ac1f 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -42,8 +42,6 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode, VIR_NETDEV_MACVLAN_MODE_LAST,
               "passthrough")
 
 #if WITH_MACVTAP
-# include <stdint.h>
-# include <errno.h>
 # include <fcntl.h>
 # include <sys/socket.h>
 # include <sys/ioctl.h>
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 8a9e2df43a..c4d843e8ff 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -35,8 +35,6 @@
 #include "virstring.h"
 #include "datatypes.h"
 
-#include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
 #include <regex.h>
 #include <sys/types.h>
diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c
index 14b79da893..0543332427 100644
--- a/src/util/virnetdevvportprofile.c
+++ b/src/util/virnetdevvportprofile.c
@@ -48,8 +48,6 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp, VIR_NETDEV_VPORT_PROFILE_OP_LAST,
 
 #if WITH_VIRTUALPORT
 
-# include <stdint.h>
-# include <errno.h>
 # include <fcntl.h>
 # include <c-ctype.h>
 # include <sys/socket.h>
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index e473ccbe86..f2bcc1eece 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -30,7 +30,6 @@
 
 #include <config.h>
 
-#include <errno.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/socket.h>
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 7676bcf0d3..28a93de98d 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -29,12 +29,9 @@
 #include <dirent.h>
 #include <fcntl.h>
 #include <inttypes.h>
-#include <limits.h>
-#include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include <stdlib.h>
 
 #include "dirname.h"
 #include "virlog.h"
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 3988f5546c..8ad12c29ba 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -24,8 +24,6 @@
 
 #include <fcntl.h>
 #include <signal.h>
-#include <errno.h>
-#include <stdlib.h>
 #include <sys/wait.h>
 #include <unistd.h>
 #if HAVE_SYS_MOUNT_H
diff --git a/src/util/virrandom.c b/src/util/virrandom.c
index 7915f6531e..1f616f73d5 100644
--- a/src/util/virrandom.c
+++ b/src/util/virrandom.c
@@ -21,7 +21,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <inttypes.h>
 #include <math.h>
 #include <strings.h>
diff --git a/src/util/virscsi.c b/src/util/virscsi.c
index 1e661f651e..e731e59cfe 100644
--- a/src/util/virscsi.c
+++ b/src/util/virscsi.c
@@ -28,8 +28,6 @@
 #include <dirent.h>
 #include <fcntl.h>
 #include <inttypes.h>
-#include <limits.h>
-#include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
diff --git a/src/util/virsexpr.c b/src/util/virsexpr.c
index 1755109505..bfac747f63 100644
--- a/src/util/virsexpr.c
+++ b/src/util/virsexpr.c
@@ -22,10 +22,7 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include "c-ctype.h"
-#include <errno.h>
 
 #include "virerror.h"
 #include "virsexpr.h"
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 927223eca8..b878718b11 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -26,7 +26,6 @@
 
 #include <unistd.h>
 #include <fcntl.h>
-#include <stdlib.h>
 #include "viralloc.h"
 #include "virxml.h"
 #include "viruuid.h"
diff --git a/src/util/virstoragefilebackend.c b/src/util/virstoragefilebackend.c
index eb3055ed67..7086747029 100644
--- a/src/util/virstoragefilebackend.c
+++ b/src/util/virstoragefilebackend.c
@@ -23,7 +23,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <sys/stat.h>
 
 #include "datatypes.h"
diff --git a/src/util/virstring.c b/src/util/virstring.c
index e407ed845b..270e747acf 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -21,7 +21,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <regex.h>
 #include <locale.h>
 
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index a3337bfbf6..4b8160355f 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -27,7 +27,6 @@
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include <stdlib.h>
 
 #include "virerror.h"
 #include "virsysinfo.h"
diff --git a/src/util/virusb.c b/src/util/virusb.c
index 3e5e2db5b4..45f635baaf 100644
--- a/src/util/virusb.c
+++ b/src/util/virusb.c
@@ -26,8 +26,6 @@
 #include <dirent.h>
 #include <fcntl.h>
 #include <inttypes.h>
-#include <limits.h>
-#include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
diff --git a/src/util/virutil.c b/src/util/virutil.c
index 1c74a4b78d..35f22be111 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -26,10 +26,8 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <errno.h>
 #include <poll.h>
 #include <sys/stat.h>
 
@@ -40,7 +38,6 @@
 #endif
 
 #include <sys/types.h>
-#include <string.h>
 #include <termios.h>
 
 #if WITH_DEVMAPPER
diff --git a/src/util/viruuid.c b/src/util/viruuid.c
index 187c533d4d..ff44e8efb7 100644
--- a/src/util/viruuid.c
+++ b/src/util/viruuid.c
@@ -25,10 +25,7 @@
 
 #include "viruuid.h"
 
-#include <errno.h>
 #include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <time.h>
diff --git a/src/util/virxml.c b/src/util/virxml.c
index b383c3d3e9..dd932fadab 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -22,10 +22,7 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <stdarg.h>
-#include <limits.h>
 #include <math.h>               /* for isnan() */
 #include <sys/stat.h>
 
diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c
index cae6d0c626..2a054f02d6 100644
--- a/src/vbox/vbox_XPCOMCGlue.c
+++ b/src/vbox/vbox_XPCOMCGlue.c
@@ -29,7 +29,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <dlfcn.h>
 
 #include "vbox_XPCOMCGlue.h"
diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index e1d6956df0..89ed6394da 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -21,7 +21,6 @@
 
 #include <config.h>
 
-#include <string.h>
 
 #include "vircommand.h"
 #include "cpu/cpu.h"
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 95411bda8f..bedc6316db 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -25,12 +25,8 @@
 
 #include <sys/types.h>
 #include <sys/poll.h>
-#include <limits.h>
-#include <string.h>
 #include <stdarg.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <errno.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <pwd.h>
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index f7519cbaa7..556382577c 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -22,8 +22,6 @@
 
 #include <config.h>
 
-#include <limits.h>
-#include <string.h>
 #include <curl/curl.h>
 #include <xen/api/xen_all.h>
 #include "internal.h"
diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c
index 5796bca893..723f348b64 100644
--- a/src/xenapi/xenapi_utils.c
+++ b/src/xenapi/xenapi_utils.c
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <xen/api/xen_all.h>
 #include "internal.h"
 #include "domain_conf.h"
diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index 7b53a8e199..32ebeeaef2 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -21,9 +21,7 @@
 #include <config.h>
 
 #include <unistd.h>
-#include <stdlib.h>
 #include <fcntl.h>
-#include <string.h>
 #include <sys/stat.h>
 
 #include "internal.h"
diff --git a/tests/commandtest.c b/tests/commandtest.c
index 4c23b79787..8aa1fdc84e 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -20,8 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
 #include <signal.h>
 #include <sys/stat.h>
diff --git a/tests/cputest.c b/tests/cputest.c
index e5d3403600..339119c63f 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -22,9 +22,7 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c
index 838bc6f3cb..d8cf61685e 100644
--- a/tests/domaincapsmock.c
+++ b/tests/domaincapsmock.c
@@ -15,7 +15,6 @@
  */
 
 #include <config.h>
-#include <limits.h>
 
 #include "virhostcpu.h"
 
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index 3b94cad223..85431e397a 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -20,7 +20,6 @@
  */
 
 #include <config.h>
-#include <stdlib.h>
 
 #include "testutils.h"
 #include "domain_capabilities.h"
diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c
index 9ec4882389..2a07fe0789 100644
--- a/tests/domainsnapshotxml2xmltest.c
+++ b/tests/domainsnapshotxml2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/esxutilstest.c b/tests/esxutilstest.c
index 68cfe63d77..872987a7d7 100644
--- a/tests/esxutilstest.c
+++ b/tests/esxutilstest.c
@@ -4,7 +4,6 @@
 
 #ifdef WITH_ESX
 
-# include <string.h>
 # include <unistd.h>
 
 # include "internal.h"
diff --git a/tests/eventtest.c b/tests/eventtest.c
index 0c1ec719f4..e3ad1e8784 100644
--- a/tests/eventtest.c
+++ b/tests/eventtest.c
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <signal.h>
 #include <time.h>
 
diff --git a/tests/fdstreamtest.c b/tests/fdstreamtest.c
index 68a5bc354d..3c4fcdefaf 100644
--- a/tests/fdstreamtest.c
+++ b/tests/fdstreamtest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <fcntl.h>
 
 #include "testutils.h"
diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c
index bcc2e9d62e..fa941f0091 100644
--- a/tests/genericxml2xmltest.c
+++ b/tests/genericxml2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/interfacexml2xmltest.c b/tests/interfacexml2xmltest.c
index d71bc76ed1..1fc61e3853 100644
--- a/tests/interfacexml2xmltest.c
+++ b/tests/interfacexml2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c
index 611cc5c9e7..c4ac2bbdb9 100644
--- a/tests/libxlxml2domconfigtest.c
+++ b/tests/libxlxml2domconfigtest.c
@@ -23,9 +23,7 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c
index 9fed462dc9..e871700d1d 100644
--- a/tests/lxcxml2xmltest.c
+++ b/tests/lxcxml2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c
index ab0bedd56f..367e30b994 100644
--- a/tests/networkxml2conftest.c
+++ b/tests/networkxml2conftest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c
index cce7e2159c..4e4c7d20a6 100644
--- a/tests/networkxml2xmltest.c
+++ b/tests/networkxml2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/networkxml2xmlupdatetest.c b/tests/networkxml2xmlupdatetest.c
index e7c728acaa..46cb4c2f0b 100644
--- a/tests/networkxml2xmlupdatetest.c
+++ b/tests/networkxml2xmlupdatetest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c
index d6fb9902fb..9248a60fbf 100644
--- a/tests/nodedevxml2xmltest.c
+++ b/tests/nodedevxml2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/nsstest.c b/tests/nsstest.c
index 720ffc487b..fe0a16c3c4 100644
--- a/tests/nsstest.c
+++ b/tests/nsstest.c
@@ -24,7 +24,6 @@
 
 #ifdef NSS
 
-# include <stdbool.h>
 # include <arpa/inet.h>
 # include "libvirt_nss.h"
 # include "virsocketaddr.h"
diff --git a/tests/nwfilterxml2xmltest.c b/tests/nwfilterxml2xmltest.c
index c213b850c7..5fc9d19d47 100644
--- a/tests/nwfilterxml2xmltest.c
+++ b/tests/nwfilterxml2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/openvzutilstest.c b/tests/openvzutilstest.c
index 54e729de8b..283ba03b21 100644
--- a/tests/openvzutilstest.c
+++ b/tests/openvzutilstest.c
@@ -4,7 +4,6 @@
 
 #ifdef WITH_OPENVZ
 
-# include <string.h>
 # include <unistd.h>
 
 # include "internal.h"
diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
index 8a30b8c640..29c80a0471 100644
--- a/tests/qemuargv2xmltest.c
+++ b/tests/qemuargv2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
index 8e8773e6a8..6d85718d92 100644
--- a/tests/qemublocktest.c
+++ b/tests/qemublocktest.c
@@ -16,7 +16,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "testutils.h"
 
diff --git a/tests/qemucpumock.c b/tests/qemucpumock.c
index 74dcfa6291..7752e3157c 100644
--- a/tests/qemucpumock.c
+++ b/tests/qemucpumock.c
@@ -16,7 +16,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "conf/cpu_conf.h"
 #include "cpu/cpu.h"
diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c
index d7747c4353..786f647cf0 100644
--- a/tests/qemumemlocktest.c
+++ b/tests/qemumemlocktest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index 3fe6a8ba8c..9cee0082fa 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -19,8 +19,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <time.h>
 
 #include "testutils.h"
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index d6a8e4791b..c1ea24b8b0 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 3b7c928400..ada7744955 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/seclabeltest.c b/tests/seclabeltest.c
index 5290e7e54f..7cddf96e82 100644
--- a/tests/seclabeltest.c
+++ b/tests/seclabeltest.c
@@ -1,9 +1,6 @@
 #include <config.h>
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
 #include "security/security_driver.h"
 #include "virrandom.h"
 #include "testutils.h"
diff --git a/tests/secretxml2xmltest.c b/tests/secretxml2xmltest.c
index 306f64c236..fd93703424 100644
--- a/tests/secretxml2xmltest.c
+++ b/tests/secretxml2xmltest.c
@@ -1,6 +1,5 @@
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "internal.h"
 #include "testutils.h"
diff --git a/tests/securityselinuxhelper.c b/tests/securityselinuxhelper.c
index fe6f2b5fd9..6391f67360 100644
--- a/tests/securityselinuxhelper.c
+++ b/tests/securityselinuxhelper.c
@@ -23,7 +23,6 @@
  * detected. */
 
 #include "virmock.h"
-#include <errno.h>
 #if HAVE_LINUX_MAGIC_H
 # include <linux/magic.h>
 #endif
@@ -31,7 +30,6 @@
 #if HAVE_SELINUX_LABEL_H
 # include <selinux/label.h>
 #endif
-#include <string.h>
 #include <sys/vfs.h>
 #include <unistd.h>
 #include <sys/xattr.h>
diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index b69a33eee3..aa9fae7d32 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -21,8 +21,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <time.h>
 
 #include <selinux/selinux.h>
diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c
index 1df6129046..f1ea51b1ac 100644
--- a/tests/securityselinuxtest.c
+++ b/tests/securityselinuxtest.c
@@ -20,8 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <time.h>
 
 #include <selinux/selinux.h>
diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c
index 39ac6c5e8e..b2fc4d42fe 100644
--- a/tests/sexpr2xmltest.c
+++ b/tests/sexpr2xmltest.c
@@ -1,6 +1,5 @@
 #include <config.h>
 
-#include <string.h>
 #include <unistd.h>
 
 #include "internal.h"
diff --git a/tests/shunloadhelper.c b/tests/shunloadhelper.c
index 128adcec1d..952cade741 100644
--- a/tests/shunloadhelper.c
+++ b/tests/shunloadhelper.c
@@ -27,7 +27,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "internal.h"
 
diff --git a/tests/shunloadtest.c b/tests/shunloadtest.c
index 1636e27a11..c5561175b9 100644
--- a/tests/shunloadtest.c
+++ b/tests/shunloadtest.c
@@ -47,7 +47,6 @@
 
 # include <dlfcn.h>
 # include <pthread.h>
-# include <stdbool.h>
 # include <unistd.h>
 # include <signal.h>
 
diff --git a/tests/sockettest.c b/tests/sockettest.c
index 21a28ae9fb..0c6c79f2a9 100644
--- a/tests/sockettest.c
+++ b/tests/sockettest.c
@@ -21,8 +21,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 
 #include "virsocketaddr.h"
 #include "testutils.h"
diff --git a/tests/storagebackendsheepdogtest.c b/tests/storagebackendsheepdogtest.c
index 00d7ae483a..1d64096130 100644
--- a/tests/storagebackendsheepdogtest.c
+++ b/tests/storagebackendsheepdogtest.c
@@ -23,9 +23,7 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <fcntl.h>
 
diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c
index 583c910db6..8230dc8ddc 100644
--- a/tests/storagepoolxml2xmltest.c
+++ b/tests/storagepoolxml2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c
index 5c46e4cf68..040bbc7585 100644
--- a/tests/storagevolxml2xmltest.c
+++ b/tests/storagevolxml2xmltest.c
@@ -1,8 +1,6 @@
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c
index e8e7502eda..2c1c450a78 100644
--- a/tests/sysinfotest.c
+++ b/tests/sysinfotest.c
@@ -24,8 +24,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
 
 #include "internal.h"
diff --git a/tests/testutils.c b/tests/testutils.c
index ecaa000a2d..4fe95bda8b 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <stdarg.h>
 #include <sys/time.h>
 #include <sys/types.h>
@@ -30,9 +29,7 @@
 #include <sys/wait.h>
 #include <regex.h>
 #include <unistd.h>
-#include <string.h>
 #include <fcntl.h>
-#include <limits.h>
 #include "testutils.h"
 #include "internal.h"
 #include "viralloc.h"
diff --git a/tests/testutilslxc.c b/tests/testutilslxc.c
index e4489f33d2..eed18304c4 100644
--- a/tests/testutilslxc.c
+++ b/tests/testutilslxc.c
@@ -1,6 +1,5 @@
 #include <config.h>
 #ifdef WITH_LXC
-# include <stdlib.h>
 
 # include "testutilslxc.h"
 # include "testutils.h"
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index c50d05a312..332885eb77 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -1,6 +1,5 @@
 #include <config.h>
 #ifdef WITH_QEMU
-# include <stdlib.h>
 
 # include "testutilsqemu.h"
 # include "testutilshostcpus.h"
diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c
index c08ec4a6ec..d34be72296 100644
--- a/tests/testutilsxen.c
+++ b/tests/testutilsxen.c
@@ -1,7 +1,6 @@
 #include <config.h>
 
 #include <sys/utsname.h>
-#include <stdlib.h>
 
 #include "testutilsxen.h"
 #include "testutilshostcpus.h"
diff --git a/tests/utiltest.c b/tests/utiltest.c
index 602b5dd3d3..5e4920e3ca 100644
--- a/tests/utiltest.c
+++ b/tests/utiltest.c
@@ -1,7 +1,5 @@
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
 
 #include "internal.h"
diff --git a/tests/vboxsnapshotxmltest.c b/tests/vboxsnapshotxmltest.c
index 0f28711a04..c70d7ab100 100644
--- a/tests/vboxsnapshotxmltest.c
+++ b/tests/vboxsnapshotxmltest.c
@@ -4,7 +4,6 @@
 
 #ifdef WITH_VBOX
 
-# include <stdlib.h>
 # include <regex.h>
 # include "vbox/vbox_snapshot_conf.h"
 
diff --git a/tests/virauthconfigtest.c b/tests/virauthconfigtest.c
index 1209aa0e30..8cfd68dff3 100644
--- a/tests/virauthconfigtest.c
+++ b/tests/virauthconfigtest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <signal.h>
 
 #include "testutils.h"
diff --git a/tests/virbuftest.c b/tests/virbuftest.c
index f5aaed32a3..5bffe94c95 100644
--- a/tests/virbuftest.c
+++ b/tests/virbuftest.c
@@ -1,7 +1,5 @@
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 
 #include "internal.h"
 #include "testutils.h"
diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c
index 1fb8861d8a..0a72bb77eb 100644
--- a/tests/vircaps2xmltest.c
+++ b/tests/vircaps2xmltest.c
@@ -20,7 +20,6 @@
  */
 
 #include <config.h>
-#include <stdlib.h>
 
 #include "testutils.h"
 #include "capabilities.h"
diff --git a/tests/vircapstest.c b/tests/vircapstest.c
index 0df453f403..7fc0ebe4f6 100644
--- a/tests/vircapstest.c
+++ b/tests/vircapstest.c
@@ -18,7 +18,6 @@
  */
 
 #include <config.h>
-#include <stdlib.h>
 
 #include "testutils.h"
 #include "testutilslxc.h"
diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c
index d8b7d7ec7c..d512417789 100644
--- a/tests/vircgroupmock.c
+++ b/tests/vircgroupmock.c
@@ -22,7 +22,6 @@
 
 #ifdef __linux__
 # include "virmock.h"
-# include <stdlib.h>
 # include <unistd.h>
 # include <fcntl.h>
 # include <sys/stat.h>
diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c
index be50f3e73c..6ab67dca78 100644
--- a/tests/vircgrouptest.c
+++ b/tests/vircgrouptest.c
@@ -24,7 +24,6 @@
 
 #ifdef __linux__
 
-# include <stdlib.h>
 
 # define __VIR_CGROUP_ALLOW_INCLUDE_PRIV_H__
 # include "vircgrouppriv.h"
diff --git a/tests/virconftest.c b/tests/virconftest.c
index d5581fe66b..cc2b26687c 100644
--- a/tests/virconftest.c
+++ b/tests/virconftest.c
@@ -22,9 +22,6 @@
 #include <config.h>
 
 #include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
 #include "virconf.h"
 #include "viralloc.h"
 #include "testutils.h"
diff --git a/tests/virdbustest.c b/tests/virdbustest.c
index af58cfaf4b..c900d17b79 100644
--- a/tests/virdbustest.c
+++ b/tests/virdbustest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "virdbuspriv.h"
 #include "virlog.h"
diff --git a/tests/virfiletest.c b/tests/virfiletest.c
index a15495e9e8..efe15485eb 100644
--- a/tests/virfiletest.c
+++ b/tests/virfiletest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <fcntl.h>
 
 #include "testutils.h"
diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c
index bd2708e3e1..f7a7a931e1 100644
--- a/tests/virfilewrapper.c
+++ b/tests/virfilewrapper.c
@@ -20,7 +20,6 @@
 
 #ifndef WIN32
 
-# include <stdlib.h>
 # include <fcntl.h>
 
 # include "viralloc.h"
diff --git a/tests/virhashtest.c b/tests/virhashtest.c
index aee534181f..4e6b6f3fef 100644
--- a/tests/virhashtest.c
+++ b/tests/virhashtest.c
@@ -1,7 +1,5 @@
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <time.h>
 
 #include "internal.h"
diff --git a/tests/virhostcputest.c b/tests/virhostcputest.c
index ea92f4a0e8..8cbc302cae 100644
--- a/tests/virhostcputest.c
+++ b/tests/virhostcputest.c
@@ -1,7 +1,5 @@
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
 
 #include "testutils.h"
diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c
index 557aa75d96..bc73362a6b 100644
--- a/tests/virhostdevtest.c
+++ b/tests/virhostdevtest.c
@@ -25,7 +25,6 @@
 
 #ifdef __linux__
 
-# include <stdlib.h>
 # include <sys/types.h>
 # include <sys/stat.h>
 # include <sys/ioctl.h>
diff --git a/tests/viridentitytest.c b/tests/viridentitytest.c
index dfa29478e0..e390512147 100644
--- a/tests/viridentitytest.c
+++ b/tests/viridentitytest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #if WITH_SELINUX
 # include <selinux/selinux.h>
diff --git a/tests/virjsontest.c b/tests/virjsontest.c
index 97136a0561..a4bd4fb07b 100644
--- a/tests/virjsontest.c
+++ b/tests/virjsontest.c
@@ -1,7 +1,5 @@
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <time.h>
 
 #include "internal.h"
diff --git a/tests/virkeycodetest.c b/tests/virkeycodetest.c
index 399a13fcae..8d541dcba3 100644
--- a/tests/virkeycodetest.c
+++ b/tests/virkeycodetest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "testutils.h"
 
diff --git a/tests/virkeyfiletest.c b/tests/virkeyfiletest.c
index aec692468f..196c022b1c 100644
--- a/tests/virkeyfiletest.c
+++ b/tests/virkeyfiletest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <signal.h>
 
 #include "testutils.h"
diff --git a/tests/virkmodtest.c b/tests/virkmodtest.c
index b153e071d7..879ed54036 100644
--- a/tests/virkmodtest.c
+++ b/tests/virkmodtest.c
@@ -22,7 +22,6 @@
 
 #ifdef __linux__
 
-# include <stdlib.h>
 # define __VIR_COMMAND_PRIV_H_ALLOW__
 # include "vircommandpriv.h"
 # include "virkmod.h"
diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c
index 2409809353..3c621e7eb0 100644
--- a/tests/virlockspacetest.c
+++ b/tests/virlockspacetest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <signal.h>
 #include <sys/stat.h>
 
diff --git a/tests/virmock.h b/tests/virmock.h
index 4bf7dc8e09..aaefb802e0 100644
--- a/tests/virmock.h
+++ b/tests/virmock.h
@@ -25,7 +25,6 @@
 # if HAVE_DLFCN_H
 #  include <dlfcn.h>
 # endif
-# include <stdlib.h>
 
 # include "internal.h"
 
diff --git a/tests/virnetdevmock.c b/tests/virnetdevmock.c
index edbb392e8e..b005f1644c 100644
--- a/tests/virnetdevmock.c
+++ b/tests/virnetdevmock.c
@@ -22,7 +22,6 @@
 
 #ifdef __linux__
 # include "internal.h"
-# include <stdlib.h>
 # include "virstring.h"
 # include "virnetdev.h"
 
diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c
index be7d019c31..eb6fc4c407 100644
--- a/tests/virnetmessagetest.c
+++ b/tests/virnetmessagetest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <signal.h>
 
 #include "testutils.h"
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 5927be1f80..a96a53dcad 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <signal.h>
 #ifdef HAVE_IFADDRS_H
 # include <ifaddrs.h>
diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c
index 86647f3014..49b33e354a 100644
--- a/tests/virnettlscontexttest.c
+++ b/tests/virnettlscontexttest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 
diff --git a/tests/virnettlshelpers.c b/tests/virnettlshelpers.c
index 8cb8c3ee2a..36c29cf9c0 100644
--- a/tests/virnettlshelpers.c
+++ b/tests/virnettlshelpers.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 
diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c
index 375cc1bb02..fb2efd7594 100644
--- a/tests/virnettlssessiontest.c
+++ b/tests/virnettlssessiontest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 
diff --git a/tests/virnwfilterbindingxml2xmltest.c b/tests/virnwfilterbindingxml2xmltest.c
index 072eb329fc..bba63e9564 100644
--- a/tests/virnwfilterbindingxml2xmltest.c
+++ b/tests/virnwfilterbindingxml2xmltest.c
@@ -21,9 +21,7 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index 46a447f381..9eb5eb3a1e 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -22,7 +22,6 @@
 
 #if defined(__linux__) || defined(__FreeBSD__)
 # include "virmock.h"
-# include <stdlib.h>
 # include <unistd.h>
 # include <fcntl.h>
 # include <sys/stat.h>
diff --git a/tests/virpcitest.c b/tests/virpcitest.c
index a58a51d950..384ff055e0 100644
--- a/tests/virpcitest.c
+++ b/tests/virpcitest.c
@@ -24,7 +24,6 @@
 
 #ifdef __linux__
 
-# include <stdlib.h>
 # include <sys/types.h>
 # include <sys/stat.h>
 # include <fcntl.h>
diff --git a/tests/virpolkittest.c b/tests/virpolkittest.c
index fe7666bd35..f7589dba00 100644
--- a/tests/virpolkittest.c
+++ b/tests/virpolkittest.c
@@ -24,7 +24,6 @@
 
 #if defined(__ELF__)
 
-# include <stdlib.h>
 # include <dbus/dbus.h>
 
 # include "virpolkit.h"
diff --git a/tests/virportallocatormock.c b/tests/virportallocatormock.c
index ddb891ac90..9de0335601 100644
--- a/tests/virportallocatormock.c
+++ b/tests/virportallocatormock.c
@@ -19,7 +19,6 @@
  */
 
 #include <config.h>
-#include <stdlib.h>
 
 #if HAVE_DLFCN_H
 # include <dlfcn.h>
@@ -28,7 +27,6 @@
 #if defined(__linux__) && defined(RTLD_NEXT)
 # include "internal.h"
 # include <sys/socket.h>
-# include <errno.h>
 # include <arpa/inet.h>
 # include <netinet/in.h>
 # include <unistd.h>
diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c
index 5e30b415e0..29da9a7c01 100644
--- a/tests/virportallocatortest.c
+++ b/tests/virportallocatortest.c
@@ -19,7 +19,6 @@
  */
 
 #include <config.h>
-#include <stdlib.h>
 #include "virfile.h"
 #include "testutils.h"
 
diff --git a/tests/virresctrltest.c b/tests/virresctrltest.c
index 99e20d5dec..d2a290035f 100644
--- a/tests/virresctrltest.c
+++ b/tests/virresctrltest.c
@@ -1,5 +1,4 @@
 #include <config.h>
-#include <stdlib.h>
 
 #include "testutils.h"
 #include "virfilewrapper.h"
diff --git a/tests/virschematest.c b/tests/virschematest.c
index 3614fb1c68..7dda14e336 100644
--- a/tests/virschematest.c
+++ b/tests/virschematest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "testutils.h"
 
diff --git a/tests/virscsitest.c b/tests/virscsitest.c
index 1215adbfab..eff488641b 100644
--- a/tests/virscsitest.c
+++ b/tests/virscsitest.c
@@ -21,7 +21,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "virscsi.h"
 #include "testutils.h"
diff --git a/tests/virshtest.c b/tests/virshtest.c
index 7b9b6779b5..250efb7734 100644
--- a/tests/virshtest.c
+++ b/tests/virshtest.c
@@ -1,6 +1,5 @@
 #include <config.h>
 
-#include <string.h>
 #include <unistd.h>
 
 #include "internal.h"
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index 68d0307d5c..83680a63a0 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "testutils.h"
 #include "vircommand.h"
diff --git a/tests/virstorageutiltest.c b/tests/virstorageutiltest.c
index b76ee202a8..d91c5d4d6f 100644
--- a/tests/virstorageutiltest.c
+++ b/tests/virstorageutiltest.c
@@ -16,7 +16,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "testutils.h"
 #include "virerror.h"
diff --git a/tests/virstringtest.c b/tests/virstringtest.c
index 1a1e6364d1..d1a593cb9a 100644
--- a/tests/virstringtest.c
+++ b/tests/virstringtest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 
 #include "testutils.h"
 #include "verify.h"
diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c
index 5b6ef12a70..7d15c0f37d 100644
--- a/tests/virsystemdtest.c
+++ b/tests/virsystemdtest.c
@@ -24,7 +24,6 @@
 
 #if defined(WITH_DBUS) && defined(__linux__)
 
-# include <stdlib.h>
 # include <dbus/dbus.h>
 
 # define __VIR_SYSTEMD_PRIV_H_ALLOW__ 1
diff --git a/tests/virtimetest.c b/tests/virtimetest.c
index d4f6d8e15d..79a1e153da 100644
--- a/tests/virtimetest.c
+++ b/tests/virtimetest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <signal.h>
 
 #include "testutils.h"
diff --git a/tests/viruritest.c b/tests/viruritest.c
index 838f050980..8ccfba71b3 100644
--- a/tests/viruritest.c
+++ b/tests/viruritest.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <signal.h>
 
 #include "testutils.h"
diff --git a/tests/virusbmock.c b/tests/virusbmock.c
index 12083e2362..fbab6e48be 100644
--- a/tests/virusbmock.c
+++ b/tests/virusbmock.c
@@ -19,7 +19,6 @@
  */
 
 #include <config.h>
-#include <stdlib.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/tests/virusbtest.c b/tests/virusbtest.c
index 05bba2b9ba..d1f3e9c239 100644
--- a/tests/virusbtest.c
+++ b/tests/virusbtest.c
@@ -19,7 +19,6 @@
  */
 
 #include <config.h>
-#include <stdlib.h>
 
 #include "viralloc.h"
 #include "virerror.h"
diff --git a/tests/vmwarevertest.c b/tests/vmwarevertest.c
index 8e75b214e0..c19c6cc302 100644
--- a/tests/vmwarevertest.c
+++ b/tests/vmwarevertest.c
@@ -22,7 +22,6 @@
 
 #ifdef WITH_VMWARE
 
-# include <stdlib.h>
 
 # include "vmware/vmware_conf.h"
 
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c
index e6ad822f3f..b70e8191d1 100644
--- a/tests/vmx2xmltest.c
+++ b/tests/vmx2xmltest.c
@@ -4,7 +4,6 @@
 
 #ifdef WITH_VMX
 
-# include <string.h>
 # include <unistd.h>
 
 # include "internal.h"
diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c
index 06da9ae6fb..ff394f65ca 100644
--- a/tests/vshtabletest.c
+++ b/tests/vshtabletest.c
@@ -18,7 +18,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #include <locale.h>
 #include <wctype.h>
 
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
index 3f2773a791..b2e4591c3b 100644
--- a/tests/xlconfigtest.c
+++ b/tests/xlconfigtest.c
@@ -24,7 +24,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <unistd.h>
 
 #include "internal.h"
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index 76c01f8e82..35cef16629 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -23,7 +23,6 @@
 
 #include <config.h>
 
-#include <string.h>
 #include <unistd.h>
 
 #include "internal.h"
diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c
index 93d05f87cb..de68ea1f05 100644
--- a/tests/xml2sexprtest.c
+++ b/tests/xml2sexprtest.c
@@ -1,7 +1,5 @@
 #include <config.h>
 
-#include <stdlib.h>
-#include <string.h>
 #include <sys/types.h>
 #include <fcntl.h>
 #include <unistd.h>
diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c
index 87ca6d43ca..0143c05b19 100644
--- a/tests/xml2vmxtest.c
+++ b/tests/xml2vmxtest.c
@@ -4,7 +4,6 @@
 
 #ifdef WITH_VMX
 
-# include <string.h>
 # include <unistd.h>
 
 # include "internal.h"
diff --git a/tools/virsh-console.c b/tools/virsh-console.c
index e767c8e42d..05e3ebd04a 100644
--- a/tools/virsh-console.c
+++ b/tools/virsh-console.c
@@ -30,8 +30,6 @@
 # include <fcntl.h>
 # include <termios.h>
 # include <poll.h>
-# include <string.h>
-# include <errno.h>
 # include <unistd.h>
 # include <signal.h>
 # include <c-ctype.h>
diff --git a/tools/virsh.c b/tools/virsh.c
index ed1554f185..eb4f9caa7f 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -25,16 +25,12 @@
 #include <config.h>
 #include "virsh.h"
 
-#include <stdlib.h>
-#include <string.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <errno.h>
 #include <getopt.h>
 #include <sys/time.h>
 #include <fcntl.h>
 #include <time.h>
-#include <limits.h>
 #include <sys/stat.h>
 #include <inttypes.h>
 #include <signal.h>
diff --git a/tools/virsh.h b/tools/virsh.h
index 5399cd143e..af0d6ce686 100644
--- a/tools/virsh.h
+++ b/tools/virsh.h
@@ -25,8 +25,6 @@
 #ifndef VIRSH_H
 # define VIRSH_H
 
-# include <stdlib.h>
-# include <string.h>
 # include <stdarg.h>
 # include <unistd.h>
 # include <sys/stat.h>
diff --git a/tools/virt-admin.c b/tools/virt-admin.c
index 63822bc13e..3bd3259201 100644
--- a/tools/virt-admin.c
+++ b/tools/virt-admin.c
@@ -23,7 +23,6 @@
 #include <config.h>
 #include "virt-admin.h"
 
-#include <errno.h>
 #include <getopt.h>
 
 #if WITH_READLINE
diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c
index b12a32b052..ccbd764c84 100644
--- a/tools/virt-host-validate-common.c
+++ b/tools/virt-host-validate-common.c
@@ -22,7 +22,6 @@
 #include <config.h>
 
 #include <stdarg.h>
-#include <stdlib.h>
 #include <unistd.h>
 #include <sys/utsname.h>
 #ifdef HAVE_MNTENT_H
diff --git a/tools/virt-host-validate.c b/tools/virt-host-validate.c
index 1c0ec8c92e..e797e63475 100644
--- a/tools/virt-host-validate.c
+++ b/tools/virt-host-validate.c
@@ -21,7 +21,6 @@
 
 #include <config.h>
 
-#include <stdlib.h>
 #ifdef HAVE_LIBINTL_H
 # include <libintl.h>
 #endif /* HAVE_LIBINTL_H */
diff --git a/tools/virt-login-shell.c b/tools/virt-login-shell.c
index 77b04ec484..d0b1e1e368 100644
--- a/tools/virt-login-shell.c
+++ b/tools/virt-login-shell.c
@@ -21,12 +21,10 @@
  */
 #include <config.h>
 
-#include <errno.h>
 #include <fnmatch.h>
 #include <getopt.h>
 #include <signal.h>
 #include <stdarg.h>
-#include <stdlib.h>
 #include <unistd.h>
 
 #include "internal.h"
diff --git a/tools/vsh-table.c b/tools/vsh-table.c
index d441a30f09..9b4a34c1e6 100644
--- a/tools/vsh-table.c
+++ b/tools/vsh-table.c
@@ -25,7 +25,6 @@
 #include <config.h>
 #include "vsh-table.h"
 
-#include <string.h>
 #include <stdarg.h>
 #include <stddef.h>
 #include <wchar.h>
diff --git a/tools/vsh.c b/tools/vsh.c
index ddd8ff1f18..9ea3c4b96a 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -26,16 +26,12 @@
 #include "vsh.h"
 
 #include <assert.h>
-#include <stdlib.h>
-#include <string.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <errno.h>
 #include <sys/time.h>
 #include "c-ctype.h"
 #include <fcntl.h>
 #include <time.h>
-#include <limits.h>
 #include <sys/stat.h>
 #include <inttypes.h>
 #include <signal.h>
diff --git a/tools/vsh.h b/tools/vsh.h
index 9b690aea77..8b4f544a61 100644
--- a/tools/vsh.h
+++ b/tools/vsh.h
@@ -25,8 +25,6 @@
 #ifndef VSH_H
 # define VSH_H
 
-# include <stdlib.h>
-# include <string.h>
 # include <stdarg.h>
 # include <unistd.h>
 # include <sys/stat.h>
diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/packet-libvirt.c
index 71f0f6114a..c037ad7e26 100644
--- a/tools/wireshark/src/packet-libvirt.c
+++ b/tools/wireshark/src/packet-libvirt.c
@@ -22,7 +22,6 @@
  */
 #include <config.h>
 
-#include <stdlib.h>
 #include <wireshark/config.h>
 #include <wireshark/epan/proto.h>
 #include <wireshark/epan/packet.h>
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux