[PATCH 00/29] Remove some unused includes

Peng Liang posted 29 patches 1 year, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220511135530.951850-1-tcx4c70@gmail.com
There is a newer version of this series
src/access/viraccessdriver.h                    | 1 -
src/access/viraccessdriverpolkit.c              | 4 ----
src/access/viraccessdriverstack.c               | 1 -
src/access/viraccessmanager.h                   | 1 -
src/access/viraccessperm.h                      | 1 -
src/admin/admin_server.c                        | 4 ----
src/admin/admin_server.h                        | 1 -
src/admin/admin_server_dispatch.c               | 4 ----
src/admin/libvirt-admin.c                       | 2 --
src/ch/ch_conf.c                                | 1 -
src/ch/ch_domain.c                              | 1 -
src/ch/ch_driver.c                              | 7 -------
src/ch/ch_monitor.c                             | 2 --
src/ch/ch_process.c                             | 2 --
src/ch/ch_process.h                             | 1 -
src/conf/backup_conf.c                          | 3 ---
src/conf/capabilities.c                         | 1 -
src/conf/capabilities.h                         | 3 ---
src/conf/checkpoint_conf.c                      | 4 ----
src/conf/checkpoint_conf.h                      | 1 -
src/conf/cpu_conf.c                             | 2 --
src/conf/cpu_conf.h                             | 1 -
src/conf/device_conf.c                          | 2 --
src/conf/device_conf.h                          | 1 -
src/conf/domain_addr.c                          | 1 -
src/conf/domain_audit.c                         | 1 -
src/conf/domain_capabilities.c                  | 2 --
src/conf/domain_capabilities.h                  | 1 -
src/conf/domain_conf.c                          | 4 ----
src/conf/domain_conf.h                          | 1 -
src/conf/domain_event.c                         | 2 --
src/conf/domain_nwfilter.c                      | 2 --
src/conf/domain_validate.c                      | 1 -
src/conf/interface_conf.c                       | 4 ----
src/conf/interface_conf.h                       | 2 --
src/conf/moment_conf.c                          | 3 ---
src/conf/moment_conf.h                          | 1 -
src/conf/netdev_bandwidth_conf.c                | 1 -
src/conf/netdev_vlan_conf.h                     | 1 -
src/conf/netdev_vport_profile_conf.c            | 1 -
src/conf/netdev_vport_profile_conf.h            | 1 -
src/conf/network_conf.c                         | 2 --
src/conf/network_conf.h                         | 3 ---
src/conf/network_event.h                        | 1 -
src/conf/networkcommon_conf.c                   | 3 ---
src/conf/networkcommon_conf.h                   | 2 --
src/conf/node_device_conf.c                     | 1 -
src/conf/node_device_conf.h                     | 2 --
src/conf/node_device_event.h                    | 1 -
src/conf/node_device_util.c                     | 1 -
src/conf/nwfilter_conf.c                        | 2 --
src/conf/nwfilter_conf.h                        | 3 ---
src/conf/nwfilter_ipaddrmap.c                   | 3 ---
src/conf/nwfilter_params.c                      | 2 --
src/conf/nwfilter_params.h                      | 1 -
src/conf/object_event.c                         | 4 ----
src/conf/object_event.h                         | 2 --
src/conf/secret_conf.c                          | 3 ---
src/conf/secret_event.h                         | 1 -
src/conf/snapshot_conf.c                        | 8 --------
src/conf/snapshot_conf.h                        | 1 -
src/conf/storage_adapter_conf.c                 | 1 -
src/conf/storage_capabilities.c                 | 1 -
src/conf/storage_capabilities.h                 | 2 --
src/conf/storage_conf.c                         | 4 ----
src/conf/storage_conf.h                         | 4 ----
src/conf/storage_encryption_conf.c              | 3 ---
src/conf/storage_event.h                        | 1 -
src/conf/virchrdev.c                            | 1 -
src/conf/virchrdev.h                            | 1 -
src/conf/virdomaincheckpointobjlist.c           | 1 -
src/conf/virdomaincheckpointobjlist.h           | 2 --
src/conf/virdomainmomentobjlist.c               | 5 -----
src/conf/virdomainobjlist.c                     | 2 --
src/conf/virdomainsnapshotobjlist.c             | 3 ---
src/conf/virdomainsnapshotobjlist.h             | 2 --
src/conf/virinterfaceobj.c                      | 1 -
src/conf/virinterfaceobj.h                      | 2 --
src/conf/virnetworkobj.h                        | 2 --
src/conf/virnetworkportdef.c                    | 2 --
src/conf/virnetworkportdef.h                    | 2 --
src/conf/virnodedeviceobj.c                     | 1 -
src/conf/virnwfilterbindingdef.c                | 1 -
src/conf/virnwfilterbindingdef.h                | 1 -
src/conf/virnwfilterbindingobj.c                | 4 ----
src/conf/virnwfilterbindingobj.h                | 1 -
src/conf/virnwfilterobj.h                       | 2 --
src/conf/virsavecookie.h                        | 1 -
src/conf/virsecretobj.h                         | 3 ---
src/conf/virstorageobj.c                        | 1 -
src/conf/virstorageobj.h                        | 4 ----
src/cpu/cpu.c                                   | 3 ---
src/cpu/cpu.h                                   | 1 -
src/cpu/cpu_arm.c                               | 1 -
src/cpu/cpu_map.c                               | 2 --
src/cpu/cpu_ppc64.c                             | 1 -
src/cpu/cpu_s390.c                              | 2 --
src/cpu/cpu_x86.c                               | 1 -
src/esx/esx_driver.c                            | 1 -
src/esx/esx_interface_driver.c                  | 6 ------
src/esx/esx_network_driver.c                    | 2 --
src/esx/esx_private.h                           | 3 ---
src/esx/esx_storage_backend_iscsi.c             | 2 --
src/esx/esx_storage_backend_vmfs.c              | 2 --
src/esx/esx_storage_driver.c                    | 2 --
src/esx/esx_stream.c                            | 1 -
src/esx/esx_stream.h                            | 1 -
src/esx/esx_util.c                              | 3 ---
src/esx/esx_vi.h                                | 2 --
src/esx/esx_vi_methods.c                        | 2 --
src/esx/esx_vi_types.c                          | 1 -
src/hyperv/hyperv_private.h                     | 3 ---
src/hyperv/hyperv_util.c                        | 3 ---
src/hyperv/hyperv_util.h                        | 1 -
src/interface/interface_backend_netcf.c         | 2 --
src/interface/interface_backend_udev.c          | 1 -
src/libxl/libxl_capabilities.c                  | 1 -
src/libxl/libxl_capabilities.h                  | 2 --
src/libxl/libxl_conf.c                          | 3 ---
src/libxl/libxl_conf.h                          | 3 ---
src/libxl/libxl_domain.c                        | 1 -
src/libxl/libxl_domain.h                        | 2 --
src/libxl/libxl_driver.c                        | 3 ---
src/libxl/libxl_logger.c                        | 2 --
src/libxl/libxl_migration.c                     | 3 ---
src/libxl/xen_common.h                          | 1 -
src/libxl/xen_xl.c                              | 1 -
src/libxl/xen_xl.h                              | 1 -
src/libxl/xen_xm.c                              | 1 -
src/libxl/xen_xm.h                              | 1 -
src/locking/domain_lock.c                       | 3 ---
src/locking/domain_lock.h                       | 2 --
src/locking/lock_daemon.c                       | 2 --
src/locking/lock_daemon_config.c                | 4 ----
src/locking/lock_daemon_dispatch.c              | 1 -
src/locking/lock_driver.h                       | 1 -
src/locking/lock_driver_lockd.c                 | 1 -
src/locking/lock_driver_nop.c                   | 2 --
src/locking/lock_manager.c                      | 1 -
src/locking/lock_manager.h                      | 1 -
src/locking/sanlock_helper.c                    | 2 --
src/logging/log_daemon.c                        | 5 -----
src/logging/log_daemon_config.c                 | 4 ----
src/logging/log_daemon_dispatch.c               | 1 -
src/logging/log_handler.c                       | 1 -
src/logging/log_handler.h                       | 1 -
src/logging/log_manager.c                       | 1 -
src/network/bridge_driver.c                     | 5 -----
src/network/bridge_driver.h                     | 3 ---
src/network/bridge_driver_linux.c               | 1 -
src/network/bridge_driver_platform.h            | 1 -
src/network/leaseshelper.c                      | 4 ----
src/node_device/node_device_driver.c            | 3 ---
src/node_device/node_device_driver.h            | 1 -
src/node_device/node_device_udev.c              | 3 ---
src/nwfilter/nwfilter_dhcpsnoop.c               | 3 ---
src/nwfilter/nwfilter_driver.c                  | 5 -----
src/nwfilter/nwfilter_driver.h                  | 3 ---
src/nwfilter/nwfilter_ebiptables_driver.c       | 4 ----
src/nwfilter/nwfilter_gentech_driver.c          | 4 ----
src/nwfilter/nwfilter_gentech_driver.h          | 1 -
src/nwfilter/nwfilter_learnipaddr.c             | 5 -----
src/nwfilter/nwfilter_learnipaddr.h             | 1 -
src/openvz/openvz_conf.c                        | 1 -
src/openvz/openvz_conf.h                        | 1 -
src/openvz/openvz_driver.h                      | 2 --
src/openvz/openvz_util.c                        | 1 -
src/qemu/qemu_agent.c                           | 2 --
src/qemu/qemu_agent.h                           | 1 -
src/qemu/qemu_alias.c                           | 1 -
src/qemu/qemu_alias.h                           | 2 --
src/qemu/qemu_backup.c                          | 5 -----
src/qemu/qemu_block.c                           | 1 -
src/qemu/qemu_block.h                           | 1 -
src/qemu/qemu_blockjob.c                        | 2 --
src/qemu/qemu_capabilities.c                    | 5 -----
src/qemu/qemu_capabilities.h                    | 2 --
src/qemu/qemu_cgroup.c                          | 7 -------
src/qemu/qemu_cgroup.h                          | 2 --
src/qemu/qemu_checkpoint.c                      | 3 ---
src/qemu/qemu_checkpoint.h                      | 1 -
src/qemu/qemu_command.c                         | 7 -------
src/qemu/qemu_command.h                         | 4 ----
src/qemu/qemu_conf.c                            | 5 -----
src/qemu/qemu_conf.h                            | 8 --------
src/qemu/qemu_dbus.c                            | 3 ---
src/qemu/qemu_domain.c                          | 6 ------
src/qemu/qemu_domain.h                          | 3 ---
src/qemu/qemu_domain_address.h                  | 2 --
src/qemu/qemu_driver.c                          | 8 --------
src/qemu/qemu_extdevice.c                       | 5 -----
src/qemu/qemu_firmware.c                        | 1 -
src/qemu/qemu_hostdev.c                         | 5 -----
src/qemu/qemu_hostdev.h                         | 1 -
src/qemu/qemu_hotplug.c                         | 4 ----
src/qemu/qemu_hotplug.h                         | 1 -
src/qemu/qemu_interface.c                       | 1 -
src/qemu/qemu_interface.h                       | 1 -
src/qemu/qemu_interop_config.c                  | 3 ---
src/qemu/qemu_migration.c                       | 5 -----
src/qemu/qemu_migration_cookie.c                | 1 -
src/qemu/qemu_migration_cookie.h                | 1 -
src/qemu/qemu_migration_params.c                | 2 --
src/qemu/qemu_migration_params.h                | 4 ----
src/qemu/qemu_monitor.c                         | 2 --
src/qemu/qemu_monitor.h                         | 2 --
src/qemu/qemu_monitor_json.c                    | 4 ----
src/qemu/qemu_monitor_json.h                    | 1 -
src/qemu/qemu_monitor_text.c                    | 2 --
src/qemu/qemu_monitor_text.h                    | 2 --
src/qemu/qemu_namespace.c                       | 1 -
src/qemu/qemu_namespace.h                       | 1 -
src/qemu/qemu_process.c                         | 2 --
src/qemu/qemu_process.h                         | 1 -
src/qemu/qemu_qapi.c                            | 2 --
src/qemu/qemu_saveimage.c                       | 2 --
src/qemu/qemu_saveimage.h                       | 2 --
src/qemu/qemu_security.h                        | 2 --
src/qemu/qemu_shim.c                            | 1 -
src/qemu/qemu_slirp.c                           | 3 ---
src/qemu/qemu_snapshot.c                        | 4 ----
src/qemu/qemu_snapshot.h                        | 1 -
src/qemu/qemu_tpm.c                             | 5 -----
src/qemu/qemu_validate.h                        | 1 -
src/qemu/qemu_vhost_user.c                      | 1 -
src/qemu/qemu_vhost_user.h                      | 2 --
src/qemu/qemu_vhost_user_gpu.c                  | 3 ---
src/qemu/qemu_vhost_user_gpu.h                  | 1 -
src/remote/remote_daemon.c                      | 3 ---
src/remote/remote_daemon.h                      | 1 -
src/remote/remote_daemon_config.c               | 1 -
src/remote/remote_daemon_dispatch.c             | 5 -----
src/remote/remote_daemon_dispatch.h             | 1 -
src/remote/remote_daemon_stream.c               | 1 -
src/remote/remote_driver.c                      | 3 ---
src/remote/remote_driver.h                      | 1 -
src/rpc/virkeepalive.c                          | 3 ---
src/rpc/virnetclient.c                          | 1 -
src/rpc/virnetclient.h                          | 1 -
src/rpc/virnetclientprogram.h                   | 1 -
src/rpc/virnetclientstream.c                    | 1 -
src/rpc/virnetclientstream.h                    | 1 -
src/rpc/virnetdaemon.c                          | 2 --
src/rpc/virnetdaemon.h                          | 3 ---
src/rpc/virnetlibsshsession.h                   | 1 -
src/rpc/virnetmessage.c                         | 1 -
src/rpc/virnetsaslcontext.c                     | 3 ---
src/rpc/virnetsaslcontext.h                     | 1 -
src/rpc/virnetserver.c                          | 2 --
src/rpc/virnetserver.h                          | 1 -
src/rpc/virnetserverclient.c                    | 1 -
src/rpc/virnetserverprogram.h                   | 1 -
src/rpc/virnetserverservice.h                   | 1 -
src/rpc/virnetsocket.c                          | 1 -
src/rpc/virnetsshsession.c                      | 1 -
src/rpc/virnetsshsession.h                      | 1 -
src/rpc/virnettlscontext.h                      | 1 -
src/secret/secret_driver.c                      | 2 --
src/security/security_dac.c                     | 1 -
src/security/security_manager.h                 | 1 -
src/security/security_nop.c                     | 2 --
src/security/security_selinux.c                 | 2 --
src/security/security_stack.c                   | 1 -
src/security/security_util.c                    | 1 -
src/storage/parthelper.c                        | 1 -
src/storage/storage_backend.c                   | 3 ---
src/storage/storage_backend.h                   | 1 -
src/storage/storage_backend_fs.c                | 1 -
src/storage/storage_backend_gluster.c           | 1 -
src/storage/storage_backend_iscsi.c             | 4 ----
src/storage/storage_backend_iscsi_direct.c      | 2 --
src/storage/storage_backend_mpath.c             | 1 -
src/storage/storage_backend_rbd.c               | 1 -
src/storage/storage_backend_scsi.c              | 3 ---
src/storage/storage_backend_vstorage.c          | 2 --
src/storage/storage_driver.c                    | 2 --
src/storage/storage_util.c                      | 3 ---
src/storage/storage_util.h                      | 1 -
src/storage_file/storage_file_backend.c         | 2 --
src/storage_file/storage_file_backend_fs.c      | 5 -----
src/storage_file/storage_file_backend_gluster.c | 2 --
src/storage_file/storage_source.c               | 3 ---
src/test/test_driver.c                          | 2 --
src/test/test_driver.h                          | 2 --
src/util/iohelper.c                             | 3 ---
src/util/virarch.h                              | 2 --
src/util/virarptable.c                          | 2 --
src/util/virarptable.h                          | 2 --
src/util/viraudit.h                             | 1 -
src/util/virauth.c                              | 1 -
src/util/virauth.h                              | 1 -
src/util/virauthconfig.c                        | 1 -
src/util/virbpf.c                               | 1 -
src/util/virbuffer.c                            | 2 --
src/util/vircgroup.c                            | 3 ---
src/util/vircgroupv2devices.c                   | 1 -
src/util/vircgroupv2devices.h                   | 2 --
src/util/virconf.c                              | 1 -
src/util/vircrypto.c                            | 2 --
src/util/virdnsmasq.c                           | 2 --
src/util/virebtables.c                          | 4 ----
src/util/virendian.h                            | 2 --
src/util/virenum.c                              | 1 -
src/util/virerror.c                             | 1 -
src/util/virevent.h                             | 1 -
src/util/vireventglib.c                         | 1 -
src/util/vireventglib.h                         | 2 --
src/util/vireventthread.h                       | 1 -
src/util/virfcp.c                               | 2 --
src/util/virfdstream.c                          | 1 -
src/util/virfilecache.c                         | 2 --
src/util/virfilecache.h                         | 2 --
src/util/virfirewall.c                          | 1 -
src/util/virfirmware.c                          | 1 -
src/util/virgic.c                               | 1 -
src/util/virhook.c                              | 2 --
src/util/virhook.h                              | 2 --
src/util/virhostcpu.c                           | 2 --
src/util/virhostcpu.h                           | 1 -
src/util/virhostmem.c                           | 2 --
src/util/virhostuptime.c                        | 1 -
src/util/viridentity.c                          | 3 ---
src/util/virinitctl.c                           | 3 ---
src/util/viriptables.c                          | 6 ------
src/util/viriscsi.c                             | 2 --
src/util/virjson.c                              | 1 -
src/util/virkmod.c                              | 1 -
src/util/virlease.c                             | 2 --
src/util/virlockspace.c                         | 1 -
src/util/virlockspace.h                         | 1 -
src/util/virmacaddr.c                           | 1 -
src/util/virmacmap.c                            | 2 --
src/util/virmacmap.h                            | 1 -
src/util/virmdev.h                              | 1 -
src/util/virnetdevbandwidth.c                   | 2 --
src/util/virnetdevbridge.c                      | 2 --
src/util/virnetdevip.c                          | 1 -
src/util/virnetdevmacvlan.c                     | 2 --
src/util/virnetdevmacvlan.h                     | 2 --
src/util/virnetdevmidonet.c                     | 1 -
src/util/virnetdevopenvswitch.c                 | 1 -
src/util/virnetdevtap.c                         | 1 -
src/util/virnetdevveth.c                        | 3 ---
src/util/virnetdevvlan.c                        | 2 --
src/util/virnetlink.c                           | 1 -
src/util/virnetlink.h                           | 1 -
src/util/virnodesuspend.c                       | 4 ----
src/util/virnodesuspend.h                       | 2 --
src/util/virnvme.c                              | 1 -
src/util/virobject.c                            | 2 --
src/util/virpci.c                               | 1 -
src/util/virpcivpd.c                            | 1 -
src/util/virperf.c                              | 2 --
src/util/virpidfile.c                           | 1 -
src/util/virpolkit.c                            | 2 --
src/util/virportallocator.c                     | 3 ---
src/util/virprobe.h                             | 1 -
src/util/virprocess.h                           | 1 -
src/util/virqemu.c                              | 2 --
src/util/virqemu.h                              | 1 -
src/util/virrandom.c                            | 3 ---
src/util/virresctrl.h                           | 3 ---
src/util/virrotatingfile.c                      | 1 -
src/util/virscsi.h                              | 1 -
src/util/virscsivhost.c                         | 1 -
src/util/virscsivhost.h                         | 1 -
src/util/virseclabel.c                          | 2 --
src/util/virsecret.c                            | 1 -
src/util/virsocketaddr.c                        | 2 --
src/util/virstoragefile.c                       | 4 ----
src/util/virtpm.c                               | 1 -
src/util/virusb.h                               | 1 -
src/util/virutil.c                              | 2 --
src/util/viruuid.c                              | 3 ---
src/vbox/vbox_XPCOMCGlue.c                      | 3 ---
src/vbox/vbox_common.h                          | 1 -
src/vbox/vbox_driver.c                          | 2 --
src/vbox/vbox_driver.h                          | 2 --
src/vbox/vbox_get_driver.h                      | 2 --
src/vbox/vbox_network.c                         | 2 --
src/vbox/vbox_storage.c                         | 3 ---
src/vbox/vbox_tmpl.c                            | 1 -
src/vbox/vbox_uniformed_api.h                   | 2 --
src/vmware/vmware_conf.c                        | 1 -
src/vmware/vmware_conf.h                        | 1 -
src/vmware/vmware_driver.c                      | 1 -
src/vmx/vmx.c                                   | 1 -
src/vmx/vmx.h                                   | 2 --
tests/commandtest.c                             | 2 --
tests/cputest.c                                 | 2 --
tests/domainconftest.c                          | 2 --
tests/esxutilstest.c                            | 1 -
tests/eventtest.c                               | 2 --
tests/fchosttest.c                              | 1 -
tests/fdstreamtest.c                            | 3 ---
tests/genericxml2xmltest.c                      | 2 --
tests/interfacexml2xmltest.c                    | 2 --
tests/libxlmock.c                               | 2 --
tests/libxlxml2domconfigtest.c                  | 6 ------
tests/lxcxml2xmltest.c                          | 2 --
tests/networkxml2conftest.c                     | 2 --
tests/networkxml2firewalltest.c                 | 2 --
tests/networkxml2xmltest.c                      | 3 ---
tests/networkxml2xmlupdatetest.c                | 3 ---
tests/nodedevmdevctltest.c                      | 2 --
tests/nodedevxml2xmltest.c                      | 3 ---
tests/nssmock.c                                 | 2 --
tests/nsstest.c                                 | 1 -
tests/nwfilterebiptablestest.c                  | 1 -
tests/nwfilterxml2firewalltest.c                | 1 -
tests/nwfilterxml2xmltest.c                     | 6 ------
tests/objecteventtest.c                         | 3 ---
tests/openvzutilstest.c                         | 2 --
tests/qemuagenttest.c                           | 2 --
tests/qemublocktest.c                           | 4 ----
tests/qemucapsprobemock.c                       | 1 -
tests/qemucommandutiltest.c                     | 1 -
tests/qemucpumock.c                             | 1 -
tests/qemudomaincheckpointxml2xmltest.c         | 2 --
tests/qemudomainsnapshotxml2xmltest.c           | 2 --
tests/qemuhotplugmock.c                         | 1 -
tests/qemuhotplugtest.c                         | 3 ---
tests/qemumemlocktest.c                         | 2 --
tests/qemumigparamstest.c                       | 1 -
tests/qemumigrationcookiexmltest.c              | 1 -
tests/qemumonitorjsontest.c                     | 2 --
tests/qemumonitortestutils.c                    | 2 --
tests/qemumonitortestutils.h                    | 1 -
tests/qemusecuritymock.c                        | 2 --
tests/qemuxml2argvmock.c                        | 5 -----
tests/qemuxml2argvtest.c                        | 8 --------
tests/qemuxml2xmltest.c                         | 3 ---
tests/scsihosttest.c                            | 2 --
tests/seclabeltest.c                            | 1 -
tests/secretxml2xmltest.c                       | 2 --
tests/securityselinuxhelper.c                   | 1 -
tests/securityselinuxlabeltest.c                | 2 --
tests/securityselinuxtest.c                     | 3 ---
tests/sockettest.c                              | 1 -
tests/storagebackendsheepdogtest.c              | 1 -
tests/storagepoolxml2argvtest.c                 | 4 ----
tests/storagepoolxml2xmltest.c                  | 3 ---
tests/storagevolxml2argvtest.c                  | 4 ----
tests/storagevolxml2xmltest.c                   | 3 ---
tests/sysinfotest.c                             | 1 -
tests/testutils.c                               | 4 ----
tests/testutils.h                               | 1 -
tests/testutilslxc.c                            | 1 -
tests/testutilslxc.h                            | 2 --
tests/testutilsqemu.c                           | 1 -
tests/utiltest.c                                | 1 -
tests/virauthconfigtest.c                       | 2 --
tests/virbuftest.c                              | 2 --
tests/vircaps2xmltest.c                         | 1 -
tests/vircgroupmock.c                           | 2 --
tests/vircgrouptest.c                           | 1 -
tests/virconftest.c                             | 1 -
tests/virdriverconnvalidatetest.c               | 2 --
tests/virdrivermoduletest.c                     | 2 --
tests/virfilemock.c                             | 2 --
tests/virfiletest.c                             | 1 -
tests/virfilewrapper.c                          | 2 --
tests/virfirewallmock.c                         | 1 -
tests/virfirewalltest.c                         | 1 -
tests/virhostcputest.c                          | 1 -
tests/viridentitytest.c                         | 4 ----
tests/virkeycodetest.c                          | 4 ----
tests/virkmodtest.c                             | 1 -
tests/virlockspacetest.c                        | 3 ---
tests/virmigtest.c                              | 1 -
tests/virmockstathelpers.c                      | 1 -
tests/virnetdaemonmock.c                        | 1 -
tests/virnetdevmock.c                           | 2 --
tests/virnetdevtest.c                           | 2 --
tests/virnetmessagetest.c                       | 2 --
tests/virnetserverclientmock.c                  | 1 -
tests/virnetsockettest.c                        | 1 -
tests/virnettlscontexttest.c                    | 5 -----
tests/virnettlshelpers.c                        | 1 -
tests/virnettlssessiontest.c                    | 4 ----
tests/virnetworkportxml2xmltest.c               | 2 --
tests/virnumamock.c                             | 3 ---
tests/virnwfilterbindingxml2xmltest.c           | 4 ----
tests/virpcimock.c                              | 1 -
tests/virportallocatortest.c                    | 3 ---
tests/virrandommock.c                           | 1 -
tests/virschematest.c                           | 2 --
tests/virshtest.c                               | 2 --
tests/virstoragetest.c                          | 3 ---
tests/virstorageutiltest.c                      | 3 ---
tests/virstringtest.c                           | 3 ---
tests/virtestmock.c                             | 2 --
tests/virtimetest.c                             | 2 --
tests/viruritest.c                              | 1 -
tests/virusbmock.c                              | 3 ---
tests/virusbtest.c                              | 2 --
tests/vmx2xmltest.c                             | 2 --
tests/vshtabletest.c                            | 1 -
tests/xlconfigtest.c                            | 1 -
tests/xmconfigtest.c                            | 2 --
tests/xml2vmxtest.c                             | 1 -
tools/virsh-checkpoint.c                        | 2 --
tools/virsh-completer-checkpoint.c              | 2 --
tools/virsh-completer-domain.c                  | 1 -
tools/virsh-completer-host.c                    | 1 -
tools/virsh-completer-interface.c               | 2 --
tools/virsh-completer-network.c                 | 1 -
tools/virsh-completer-nodedev.c                 | 2 --
tools/virsh-completer-nwfilter.c                | 2 --
tools/virsh-completer-pool.c                    | 2 --
tools/virsh-completer-secret.c                  | 2 --
tools/virsh-completer-snapshot.c                | 2 --
tools/virsh-completer-volume.c                  | 2 --
tools/virsh-completer.c                         | 2 --
tools/virsh-console.c                           | 1 -
tools/virsh-domain-event.c                      | 2 --
tools/virsh-domain.c                            | 1 -
tools/virsh-nodedev.c                           | 1 -
tools/virsh-pool.c                              | 1 -
tools/virsh-snapshot.c                          | 1 -
tools/virsh-util.c                              | 1 -
tools/virsh.c                                   | 4 ----
tools/virsh.h                                   | 2 --
tools/virt-admin.c                              | 1 -
tools/virt-admin.h                              | 1 -
tools/virt-host-validate-common.h               | 1 -
tools/vsh.h                                     | 1 -
527 files changed, 1064 deletions(-)
[PATCH 00/29] Remove some unused includes
Posted by Peng Liang 1 year, 10 months ago
Recently, I update the toolchain in my dev machine from LLVM13 to LLVM14,
and I find that there are many unsed include headers in the libvirt.  So
I try to remove them in this series.

Besides, I also find that:
1. some header files are not self-contained, which means if you want to
   include one header, you need to include more headers to meet the
   requirements of the declarations in the header you want to include;
2. some includes in the .h file are not the dependences of the .h file
   (the declaration) but the dependences of the .c file (the
   implementation), maybe it's better to move them to .c file.

But it will take more time to cleanup.  So I only remove the unused
includs in this series.  Is the community welcome to the removing and
the cleanup I mentioned above?  If so, I'll move on and cleanup more.

Adam Tao (29):
  access: Remove unused includes
  admin: Remove unused includes
  ch: Remove unused includes
  conf: Remove unused includes
  cpu: Remove unused includes
  esx: Remove unused includes
  hyperv: Remove unused includes
  interface: Remove unused includes
  libxl: Remove unused includes
  locking: Remove unused includes
  logging: Remove unused includes
  network: Remove unused includes
  node_device: Remove unused includes
  nwfilter: Remove unused includes
  openvz: Remove unused includes
  qemu: Remove unused includes
  remote: Remove unused includes
  rpc: Remove unused includes
  secret: Remove unused includes
  security: Remove unused includes
  storage: Remove unused includes
  storage_file: Remove unused includes
  util: Remove unused includes
  vbox: Remove unused includes
  vmware: Remove unused includes
  vmx: Remove unused includes
  test_driver: Remove unused includes
  tools: Remove unused includes
  tests: Remove unused includes

 src/access/viraccessdriver.h                    | 1 -
 src/access/viraccessdriverpolkit.c              | 4 ----
 src/access/viraccessdriverstack.c               | 1 -
 src/access/viraccessmanager.h                   | 1 -
 src/access/viraccessperm.h                      | 1 -
 src/admin/admin_server.c                        | 4 ----
 src/admin/admin_server.h                        | 1 -
 src/admin/admin_server_dispatch.c               | 4 ----
 src/admin/libvirt-admin.c                       | 2 --
 src/ch/ch_conf.c                                | 1 -
 src/ch/ch_domain.c                              | 1 -
 src/ch/ch_driver.c                              | 7 -------
 src/ch/ch_monitor.c                             | 2 --
 src/ch/ch_process.c                             | 2 --
 src/ch/ch_process.h                             | 1 -
 src/conf/backup_conf.c                          | 3 ---
 src/conf/capabilities.c                         | 1 -
 src/conf/capabilities.h                         | 3 ---
 src/conf/checkpoint_conf.c                      | 4 ----
 src/conf/checkpoint_conf.h                      | 1 -
 src/conf/cpu_conf.c                             | 2 --
 src/conf/cpu_conf.h                             | 1 -
 src/conf/device_conf.c                          | 2 --
 src/conf/device_conf.h                          | 1 -
 src/conf/domain_addr.c                          | 1 -
 src/conf/domain_audit.c                         | 1 -
 src/conf/domain_capabilities.c                  | 2 --
 src/conf/domain_capabilities.h                  | 1 -
 src/conf/domain_conf.c                          | 4 ----
 src/conf/domain_conf.h                          | 1 -
 src/conf/domain_event.c                         | 2 --
 src/conf/domain_nwfilter.c                      | 2 --
 src/conf/domain_validate.c                      | 1 -
 src/conf/interface_conf.c                       | 4 ----
 src/conf/interface_conf.h                       | 2 --
 src/conf/moment_conf.c                          | 3 ---
 src/conf/moment_conf.h                          | 1 -
 src/conf/netdev_bandwidth_conf.c                | 1 -
 src/conf/netdev_vlan_conf.h                     | 1 -
 src/conf/netdev_vport_profile_conf.c            | 1 -
 src/conf/netdev_vport_profile_conf.h            | 1 -
 src/conf/network_conf.c                         | 2 --
 src/conf/network_conf.h                         | 3 ---
 src/conf/network_event.h                        | 1 -
 src/conf/networkcommon_conf.c                   | 3 ---
 src/conf/networkcommon_conf.h                   | 2 --
 src/conf/node_device_conf.c                     | 1 -
 src/conf/node_device_conf.h                     | 2 --
 src/conf/node_device_event.h                    | 1 -
 src/conf/node_device_util.c                     | 1 -
 src/conf/nwfilter_conf.c                        | 2 --
 src/conf/nwfilter_conf.h                        | 3 ---
 src/conf/nwfilter_ipaddrmap.c                   | 3 ---
 src/conf/nwfilter_params.c                      | 2 --
 src/conf/nwfilter_params.h                      | 1 -
 src/conf/object_event.c                         | 4 ----
 src/conf/object_event.h                         | 2 --
 src/conf/secret_conf.c                          | 3 ---
 src/conf/secret_event.h                         | 1 -
 src/conf/snapshot_conf.c                        | 8 --------
 src/conf/snapshot_conf.h                        | 1 -
 src/conf/storage_adapter_conf.c                 | 1 -
 src/conf/storage_capabilities.c                 | 1 -
 src/conf/storage_capabilities.h                 | 2 --
 src/conf/storage_conf.c                         | 4 ----
 src/conf/storage_conf.h                         | 4 ----
 src/conf/storage_encryption_conf.c              | 3 ---
 src/conf/storage_event.h                        | 1 -
 src/conf/virchrdev.c                            | 1 -
 src/conf/virchrdev.h                            | 1 -
 src/conf/virdomaincheckpointobjlist.c           | 1 -
 src/conf/virdomaincheckpointobjlist.h           | 2 --
 src/conf/virdomainmomentobjlist.c               | 5 -----
 src/conf/virdomainobjlist.c                     | 2 --
 src/conf/virdomainsnapshotobjlist.c             | 3 ---
 src/conf/virdomainsnapshotobjlist.h             | 2 --
 src/conf/virinterfaceobj.c                      | 1 -
 src/conf/virinterfaceobj.h                      | 2 --
 src/conf/virnetworkobj.h                        | 2 --
 src/conf/virnetworkportdef.c                    | 2 --
 src/conf/virnetworkportdef.h                    | 2 --
 src/conf/virnodedeviceobj.c                     | 1 -
 src/conf/virnwfilterbindingdef.c                | 1 -
 src/conf/virnwfilterbindingdef.h                | 1 -
 src/conf/virnwfilterbindingobj.c                | 4 ----
 src/conf/virnwfilterbindingobj.h                | 1 -
 src/conf/virnwfilterobj.h                       | 2 --
 src/conf/virsavecookie.h                        | 1 -
 src/conf/virsecretobj.h                         | 3 ---
 src/conf/virstorageobj.c                        | 1 -
 src/conf/virstorageobj.h                        | 4 ----
 src/cpu/cpu.c                                   | 3 ---
 src/cpu/cpu.h                                   | 1 -
 src/cpu/cpu_arm.c                               | 1 -
 src/cpu/cpu_map.c                               | 2 --
 src/cpu/cpu_ppc64.c                             | 1 -
 src/cpu/cpu_s390.c                              | 2 --
 src/cpu/cpu_x86.c                               | 1 -
 src/esx/esx_driver.c                            | 1 -
 src/esx/esx_interface_driver.c                  | 6 ------
 src/esx/esx_network_driver.c                    | 2 --
 src/esx/esx_private.h                           | 3 ---
 src/esx/esx_storage_backend_iscsi.c             | 2 --
 src/esx/esx_storage_backend_vmfs.c              | 2 --
 src/esx/esx_storage_driver.c                    | 2 --
 src/esx/esx_stream.c                            | 1 -
 src/esx/esx_stream.h                            | 1 -
 src/esx/esx_util.c                              | 3 ---
 src/esx/esx_vi.h                                | 2 --
 src/esx/esx_vi_methods.c                        | 2 --
 src/esx/esx_vi_types.c                          | 1 -
 src/hyperv/hyperv_private.h                     | 3 ---
 src/hyperv/hyperv_util.c                        | 3 ---
 src/hyperv/hyperv_util.h                        | 1 -
 src/interface/interface_backend_netcf.c         | 2 --
 src/interface/interface_backend_udev.c          | 1 -
 src/libxl/libxl_capabilities.c                  | 1 -
 src/libxl/libxl_capabilities.h                  | 2 --
 src/libxl/libxl_conf.c                          | 3 ---
 src/libxl/libxl_conf.h                          | 3 ---
 src/libxl/libxl_domain.c                        | 1 -
 src/libxl/libxl_domain.h                        | 2 --
 src/libxl/libxl_driver.c                        | 3 ---
 src/libxl/libxl_logger.c                        | 2 --
 src/libxl/libxl_migration.c                     | 3 ---
 src/libxl/xen_common.h                          | 1 -
 src/libxl/xen_xl.c                              | 1 -
 src/libxl/xen_xl.h                              | 1 -
 src/libxl/xen_xm.c                              | 1 -
 src/libxl/xen_xm.h                              | 1 -
 src/locking/domain_lock.c                       | 3 ---
 src/locking/domain_lock.h                       | 2 --
 src/locking/lock_daemon.c                       | 2 --
 src/locking/lock_daemon_config.c                | 4 ----
 src/locking/lock_daemon_dispatch.c              | 1 -
 src/locking/lock_driver.h                       | 1 -
 src/locking/lock_driver_lockd.c                 | 1 -
 src/locking/lock_driver_nop.c                   | 2 --
 src/locking/lock_manager.c                      | 1 -
 src/locking/lock_manager.h                      | 1 -
 src/locking/sanlock_helper.c                    | 2 --
 src/logging/log_daemon.c                        | 5 -----
 src/logging/log_daemon_config.c                 | 4 ----
 src/logging/log_daemon_dispatch.c               | 1 -
 src/logging/log_handler.c                       | 1 -
 src/logging/log_handler.h                       | 1 -
 src/logging/log_manager.c                       | 1 -
 src/network/bridge_driver.c                     | 5 -----
 src/network/bridge_driver.h                     | 3 ---
 src/network/bridge_driver_linux.c               | 1 -
 src/network/bridge_driver_platform.h            | 1 -
 src/network/leaseshelper.c                      | 4 ----
 src/node_device/node_device_driver.c            | 3 ---
 src/node_device/node_device_driver.h            | 1 -
 src/node_device/node_device_udev.c              | 3 ---
 src/nwfilter/nwfilter_dhcpsnoop.c               | 3 ---
 src/nwfilter/nwfilter_driver.c                  | 5 -----
 src/nwfilter/nwfilter_driver.h                  | 3 ---
 src/nwfilter/nwfilter_ebiptables_driver.c       | 4 ----
 src/nwfilter/nwfilter_gentech_driver.c          | 4 ----
 src/nwfilter/nwfilter_gentech_driver.h          | 1 -
 src/nwfilter/nwfilter_learnipaddr.c             | 5 -----
 src/nwfilter/nwfilter_learnipaddr.h             | 1 -
 src/openvz/openvz_conf.c                        | 1 -
 src/openvz/openvz_conf.h                        | 1 -
 src/openvz/openvz_driver.h                      | 2 --
 src/openvz/openvz_util.c                        | 1 -
 src/qemu/qemu_agent.c                           | 2 --
 src/qemu/qemu_agent.h                           | 1 -
 src/qemu/qemu_alias.c                           | 1 -
 src/qemu/qemu_alias.h                           | 2 --
 src/qemu/qemu_backup.c                          | 5 -----
 src/qemu/qemu_block.c                           | 1 -
 src/qemu/qemu_block.h                           | 1 -
 src/qemu/qemu_blockjob.c                        | 2 --
 src/qemu/qemu_capabilities.c                    | 5 -----
 src/qemu/qemu_capabilities.h                    | 2 --
 src/qemu/qemu_cgroup.c                          | 7 -------
 src/qemu/qemu_cgroup.h                          | 2 --
 src/qemu/qemu_checkpoint.c                      | 3 ---
 src/qemu/qemu_checkpoint.h                      | 1 -
 src/qemu/qemu_command.c                         | 7 -------
 src/qemu/qemu_command.h                         | 4 ----
 src/qemu/qemu_conf.c                            | 5 -----
 src/qemu/qemu_conf.h                            | 8 --------
 src/qemu/qemu_dbus.c                            | 3 ---
 src/qemu/qemu_domain.c                          | 6 ------
 src/qemu/qemu_domain.h                          | 3 ---
 src/qemu/qemu_domain_address.h                  | 2 --
 src/qemu/qemu_driver.c                          | 8 --------
 src/qemu/qemu_extdevice.c                       | 5 -----
 src/qemu/qemu_firmware.c                        | 1 -
 src/qemu/qemu_hostdev.c                         | 5 -----
 src/qemu/qemu_hostdev.h                         | 1 -
 src/qemu/qemu_hotplug.c                         | 4 ----
 src/qemu/qemu_hotplug.h                         | 1 -
 src/qemu/qemu_interface.c                       | 1 -
 src/qemu/qemu_interface.h                       | 1 -
 src/qemu/qemu_interop_config.c                  | 3 ---
 src/qemu/qemu_migration.c                       | 5 -----
 src/qemu/qemu_migration_cookie.c                | 1 -
 src/qemu/qemu_migration_cookie.h                | 1 -
 src/qemu/qemu_migration_params.c                | 2 --
 src/qemu/qemu_migration_params.h                | 4 ----
 src/qemu/qemu_monitor.c                         | 2 --
 src/qemu/qemu_monitor.h                         | 2 --
 src/qemu/qemu_monitor_json.c                    | 4 ----
 src/qemu/qemu_monitor_json.h                    | 1 -
 src/qemu/qemu_monitor_text.c                    | 2 --
 src/qemu/qemu_monitor_text.h                    | 2 --
 src/qemu/qemu_namespace.c                       | 1 -
 src/qemu/qemu_namespace.h                       | 1 -
 src/qemu/qemu_process.c                         | 2 --
 src/qemu/qemu_process.h                         | 1 -
 src/qemu/qemu_qapi.c                            | 2 --
 src/qemu/qemu_saveimage.c                       | 2 --
 src/qemu/qemu_saveimage.h                       | 2 --
 src/qemu/qemu_security.h                        | 2 --
 src/qemu/qemu_shim.c                            | 1 -
 src/qemu/qemu_slirp.c                           | 3 ---
 src/qemu/qemu_snapshot.c                        | 4 ----
 src/qemu/qemu_snapshot.h                        | 1 -
 src/qemu/qemu_tpm.c                             | 5 -----
 src/qemu/qemu_validate.h                        | 1 -
 src/qemu/qemu_vhost_user.c                      | 1 -
 src/qemu/qemu_vhost_user.h                      | 2 --
 src/qemu/qemu_vhost_user_gpu.c                  | 3 ---
 src/qemu/qemu_vhost_user_gpu.h                  | 1 -
 src/remote/remote_daemon.c                      | 3 ---
 src/remote/remote_daemon.h                      | 1 -
 src/remote/remote_daemon_config.c               | 1 -
 src/remote/remote_daemon_dispatch.c             | 5 -----
 src/remote/remote_daemon_dispatch.h             | 1 -
 src/remote/remote_daemon_stream.c               | 1 -
 src/remote/remote_driver.c                      | 3 ---
 src/remote/remote_driver.h                      | 1 -
 src/rpc/virkeepalive.c                          | 3 ---
 src/rpc/virnetclient.c                          | 1 -
 src/rpc/virnetclient.h                          | 1 -
 src/rpc/virnetclientprogram.h                   | 1 -
 src/rpc/virnetclientstream.c                    | 1 -
 src/rpc/virnetclientstream.h                    | 1 -
 src/rpc/virnetdaemon.c                          | 2 --
 src/rpc/virnetdaemon.h                          | 3 ---
 src/rpc/virnetlibsshsession.h                   | 1 -
 src/rpc/virnetmessage.c                         | 1 -
 src/rpc/virnetsaslcontext.c                     | 3 ---
 src/rpc/virnetsaslcontext.h                     | 1 -
 src/rpc/virnetserver.c                          | 2 --
 src/rpc/virnetserver.h                          | 1 -
 src/rpc/virnetserverclient.c                    | 1 -
 src/rpc/virnetserverprogram.h                   | 1 -
 src/rpc/virnetserverservice.h                   | 1 -
 src/rpc/virnetsocket.c                          | 1 -
 src/rpc/virnetsshsession.c                      | 1 -
 src/rpc/virnetsshsession.h                      | 1 -
 src/rpc/virnettlscontext.h                      | 1 -
 src/secret/secret_driver.c                      | 2 --
 src/security/security_dac.c                     | 1 -
 src/security/security_manager.h                 | 1 -
 src/security/security_nop.c                     | 2 --
 src/security/security_selinux.c                 | 2 --
 src/security/security_stack.c                   | 1 -
 src/security/security_util.c                    | 1 -
 src/storage/parthelper.c                        | 1 -
 src/storage/storage_backend.c                   | 3 ---
 src/storage/storage_backend.h                   | 1 -
 src/storage/storage_backend_fs.c                | 1 -
 src/storage/storage_backend_gluster.c           | 1 -
 src/storage/storage_backend_iscsi.c             | 4 ----
 src/storage/storage_backend_iscsi_direct.c      | 2 --
 src/storage/storage_backend_mpath.c             | 1 -
 src/storage/storage_backend_rbd.c               | 1 -
 src/storage/storage_backend_scsi.c              | 3 ---
 src/storage/storage_backend_vstorage.c          | 2 --
 src/storage/storage_driver.c                    | 2 --
 src/storage/storage_util.c                      | 3 ---
 src/storage/storage_util.h                      | 1 -
 src/storage_file/storage_file_backend.c         | 2 --
 src/storage_file/storage_file_backend_fs.c      | 5 -----
 src/storage_file/storage_file_backend_gluster.c | 2 --
 src/storage_file/storage_source.c               | 3 ---
 src/test/test_driver.c                          | 2 --
 src/test/test_driver.h                          | 2 --
 src/util/iohelper.c                             | 3 ---
 src/util/virarch.h                              | 2 --
 src/util/virarptable.c                          | 2 --
 src/util/virarptable.h                          | 2 --
 src/util/viraudit.h                             | 1 -
 src/util/virauth.c                              | 1 -
 src/util/virauth.h                              | 1 -
 src/util/virauthconfig.c                        | 1 -
 src/util/virbpf.c                               | 1 -
 src/util/virbuffer.c                            | 2 --
 src/util/vircgroup.c                            | 3 ---
 src/util/vircgroupv2devices.c                   | 1 -
 src/util/vircgroupv2devices.h                   | 2 --
 src/util/virconf.c                              | 1 -
 src/util/vircrypto.c                            | 2 --
 src/util/virdnsmasq.c                           | 2 --
 src/util/virebtables.c                          | 4 ----
 src/util/virendian.h                            | 2 --
 src/util/virenum.c                              | 1 -
 src/util/virerror.c                             | 1 -
 src/util/virevent.h                             | 1 -
 src/util/vireventglib.c                         | 1 -
 src/util/vireventglib.h                         | 2 --
 src/util/vireventthread.h                       | 1 -
 src/util/virfcp.c                               | 2 --
 src/util/virfdstream.c                          | 1 -
 src/util/virfilecache.c                         | 2 --
 src/util/virfilecache.h                         | 2 --
 src/util/virfirewall.c                          | 1 -
 src/util/virfirmware.c                          | 1 -
 src/util/virgic.c                               | 1 -
 src/util/virhook.c                              | 2 --
 src/util/virhook.h                              | 2 --
 src/util/virhostcpu.c                           | 2 --
 src/util/virhostcpu.h                           | 1 -
 src/util/virhostmem.c                           | 2 --
 src/util/virhostuptime.c                        | 1 -
 src/util/viridentity.c                          | 3 ---
 src/util/virinitctl.c                           | 3 ---
 src/util/viriptables.c                          | 6 ------
 src/util/viriscsi.c                             | 2 --
 src/util/virjson.c                              | 1 -
 src/util/virkmod.c                              | 1 -
 src/util/virlease.c                             | 2 --
 src/util/virlockspace.c                         | 1 -
 src/util/virlockspace.h                         | 1 -
 src/util/virmacaddr.c                           | 1 -
 src/util/virmacmap.c                            | 2 --
 src/util/virmacmap.h                            | 1 -
 src/util/virmdev.h                              | 1 -
 src/util/virnetdevbandwidth.c                   | 2 --
 src/util/virnetdevbridge.c                      | 2 --
 src/util/virnetdevip.c                          | 1 -
 src/util/virnetdevmacvlan.c                     | 2 --
 src/util/virnetdevmacvlan.h                     | 2 --
 src/util/virnetdevmidonet.c                     | 1 -
 src/util/virnetdevopenvswitch.c                 | 1 -
 src/util/virnetdevtap.c                         | 1 -
 src/util/virnetdevveth.c                        | 3 ---
 src/util/virnetdevvlan.c                        | 2 --
 src/util/virnetlink.c                           | 1 -
 src/util/virnetlink.h                           | 1 -
 src/util/virnodesuspend.c                       | 4 ----
 src/util/virnodesuspend.h                       | 2 --
 src/util/virnvme.c                              | 1 -
 src/util/virobject.c                            | 2 --
 src/util/virpci.c                               | 1 -
 src/util/virpcivpd.c                            | 1 -
 src/util/virperf.c                              | 2 --
 src/util/virpidfile.c                           | 1 -
 src/util/virpolkit.c                            | 2 --
 src/util/virportallocator.c                     | 3 ---
 src/util/virprobe.h                             | 1 -
 src/util/virprocess.h                           | 1 -
 src/util/virqemu.c                              | 2 --
 src/util/virqemu.h                              | 1 -
 src/util/virrandom.c                            | 3 ---
 src/util/virresctrl.h                           | 3 ---
 src/util/virrotatingfile.c                      | 1 -
 src/util/virscsi.h                              | 1 -
 src/util/virscsivhost.c                         | 1 -
 src/util/virscsivhost.h                         | 1 -
 src/util/virseclabel.c                          | 2 --
 src/util/virsecret.c                            | 1 -
 src/util/virsocketaddr.c                        | 2 --
 src/util/virstoragefile.c                       | 4 ----
 src/util/virtpm.c                               | 1 -
 src/util/virusb.h                               | 1 -
 src/util/virutil.c                              | 2 --
 src/util/viruuid.c                              | 3 ---
 src/vbox/vbox_XPCOMCGlue.c                      | 3 ---
 src/vbox/vbox_common.h                          | 1 -
 src/vbox/vbox_driver.c                          | 2 --
 src/vbox/vbox_driver.h                          | 2 --
 src/vbox/vbox_get_driver.h                      | 2 --
 src/vbox/vbox_network.c                         | 2 --
 src/vbox/vbox_storage.c                         | 3 ---
 src/vbox/vbox_tmpl.c                            | 1 -
 src/vbox/vbox_uniformed_api.h                   | 2 --
 src/vmware/vmware_conf.c                        | 1 -
 src/vmware/vmware_conf.h                        | 1 -
 src/vmware/vmware_driver.c                      | 1 -
 src/vmx/vmx.c                                   | 1 -
 src/vmx/vmx.h                                   | 2 --
 tests/commandtest.c                             | 2 --
 tests/cputest.c                                 | 2 --
 tests/domainconftest.c                          | 2 --
 tests/esxutilstest.c                            | 1 -
 tests/eventtest.c                               | 2 --
 tests/fchosttest.c                              | 1 -
 tests/fdstreamtest.c                            | 3 ---
 tests/genericxml2xmltest.c                      | 2 --
 tests/interfacexml2xmltest.c                    | 2 --
 tests/libxlmock.c                               | 2 --
 tests/libxlxml2domconfigtest.c                  | 6 ------
 tests/lxcxml2xmltest.c                          | 2 --
 tests/networkxml2conftest.c                     | 2 --
 tests/networkxml2firewalltest.c                 | 2 --
 tests/networkxml2xmltest.c                      | 3 ---
 tests/networkxml2xmlupdatetest.c                | 3 ---
 tests/nodedevmdevctltest.c                      | 2 --
 tests/nodedevxml2xmltest.c                      | 3 ---
 tests/nssmock.c                                 | 2 --
 tests/nsstest.c                                 | 1 -
 tests/nwfilterebiptablestest.c                  | 1 -
 tests/nwfilterxml2firewalltest.c                | 1 -
 tests/nwfilterxml2xmltest.c                     | 6 ------
 tests/objecteventtest.c                         | 3 ---
 tests/openvzutilstest.c                         | 2 --
 tests/qemuagenttest.c                           | 2 --
 tests/qemublocktest.c                           | 4 ----
 tests/qemucapsprobemock.c                       | 1 -
 tests/qemucommandutiltest.c                     | 1 -
 tests/qemucpumock.c                             | 1 -
 tests/qemudomaincheckpointxml2xmltest.c         | 2 --
 tests/qemudomainsnapshotxml2xmltest.c           | 2 --
 tests/qemuhotplugmock.c                         | 1 -
 tests/qemuhotplugtest.c                         | 3 ---
 tests/qemumemlocktest.c                         | 2 --
 tests/qemumigparamstest.c                       | 1 -
 tests/qemumigrationcookiexmltest.c              | 1 -
 tests/qemumonitorjsontest.c                     | 2 --
 tests/qemumonitortestutils.c                    | 2 --
 tests/qemumonitortestutils.h                    | 1 -
 tests/qemusecuritymock.c                        | 2 --
 tests/qemuxml2argvmock.c                        | 5 -----
 tests/qemuxml2argvtest.c                        | 8 --------
 tests/qemuxml2xmltest.c                         | 3 ---
 tests/scsihosttest.c                            | 2 --
 tests/seclabeltest.c                            | 1 -
 tests/secretxml2xmltest.c                       | 2 --
 tests/securityselinuxhelper.c                   | 1 -
 tests/securityselinuxlabeltest.c                | 2 --
 tests/securityselinuxtest.c                     | 3 ---
 tests/sockettest.c                              | 1 -
 tests/storagebackendsheepdogtest.c              | 1 -
 tests/storagepoolxml2argvtest.c                 | 4 ----
 tests/storagepoolxml2xmltest.c                  | 3 ---
 tests/storagevolxml2argvtest.c                  | 4 ----
 tests/storagevolxml2xmltest.c                   | 3 ---
 tests/sysinfotest.c                             | 1 -
 tests/testutils.c                               | 4 ----
 tests/testutils.h                               | 1 -
 tests/testutilslxc.c                            | 1 -
 tests/testutilslxc.h                            | 2 --
 tests/testutilsqemu.c                           | 1 -
 tests/utiltest.c                                | 1 -
 tests/virauthconfigtest.c                       | 2 --
 tests/virbuftest.c                              | 2 --
 tests/vircaps2xmltest.c                         | 1 -
 tests/vircgroupmock.c                           | 2 --
 tests/vircgrouptest.c                           | 1 -
 tests/virconftest.c                             | 1 -
 tests/virdriverconnvalidatetest.c               | 2 --
 tests/virdrivermoduletest.c                     | 2 --
 tests/virfilemock.c                             | 2 --
 tests/virfiletest.c                             | 1 -
 tests/virfilewrapper.c                          | 2 --
 tests/virfirewallmock.c                         | 1 -
 tests/virfirewalltest.c                         | 1 -
 tests/virhostcputest.c                          | 1 -
 tests/viridentitytest.c                         | 4 ----
 tests/virkeycodetest.c                          | 4 ----
 tests/virkmodtest.c                             | 1 -
 tests/virlockspacetest.c                        | 3 ---
 tests/virmigtest.c                              | 1 -
 tests/virmockstathelpers.c                      | 1 -
 tests/virnetdaemonmock.c                        | 1 -
 tests/virnetdevmock.c                           | 2 --
 tests/virnetdevtest.c                           | 2 --
 tests/virnetmessagetest.c                       | 2 --
 tests/virnetserverclientmock.c                  | 1 -
 tests/virnetsockettest.c                        | 1 -
 tests/virnettlscontexttest.c                    | 5 -----
 tests/virnettlshelpers.c                        | 1 -
 tests/virnettlssessiontest.c                    | 4 ----
 tests/virnetworkportxml2xmltest.c               | 2 --
 tests/virnumamock.c                             | 3 ---
 tests/virnwfilterbindingxml2xmltest.c           | 4 ----
 tests/virpcimock.c                              | 1 -
 tests/virportallocatortest.c                    | 3 ---
 tests/virrandommock.c                           | 1 -
 tests/virschematest.c                           | 2 --
 tests/virshtest.c                               | 2 --
 tests/virstoragetest.c                          | 3 ---
 tests/virstorageutiltest.c                      | 3 ---
 tests/virstringtest.c                           | 3 ---
 tests/virtestmock.c                             | 2 --
 tests/virtimetest.c                             | 2 --
 tests/viruritest.c                              | 1 -
 tests/virusbmock.c                              | 3 ---
 tests/virusbtest.c                              | 2 --
 tests/vmx2xmltest.c                             | 2 --
 tests/vshtabletest.c                            | 1 -
 tests/xlconfigtest.c                            | 1 -
 tests/xmconfigtest.c                            | 2 --
 tests/xml2vmxtest.c                             | 1 -
 tools/virsh-checkpoint.c                        | 2 --
 tools/virsh-completer-checkpoint.c              | 2 --
 tools/virsh-completer-domain.c                  | 1 -
 tools/virsh-completer-host.c                    | 1 -
 tools/virsh-completer-interface.c               | 2 --
 tools/virsh-completer-network.c                 | 1 -
 tools/virsh-completer-nodedev.c                 | 2 --
 tools/virsh-completer-nwfilter.c                | 2 --
 tools/virsh-completer-pool.c                    | 2 --
 tools/virsh-completer-secret.c                  | 2 --
 tools/virsh-completer-snapshot.c                | 2 --
 tools/virsh-completer-volume.c                  | 2 --
 tools/virsh-completer.c                         | 2 --
 tools/virsh-console.c                           | 1 -
 tools/virsh-domain-event.c                      | 2 --
 tools/virsh-domain.c                            | 1 -
 tools/virsh-nodedev.c                           | 1 -
 tools/virsh-pool.c                              | 1 -
 tools/virsh-snapshot.c                          | 1 -
 tools/virsh-util.c                              | 1 -
 tools/virsh.c                                   | 4 ----
 tools/virsh.h                                   | 2 --
 tools/virt-admin.c                              | 1 -
 tools/virt-admin.h                              | 1 -
 tools/virt-host-validate-common.h               | 1 -
 tools/vsh.h                                     | 1 -
 527 files changed, 1064 deletions(-)

-- 
2.36.1
Re: [PATCH 00/29] Remove some unused includes
Posted by Daniel P. Berrangé 1 year, 10 months ago
On Wed, May 11, 2022 at 09:55:01PM +0800, Peng Liang wrote:
> Recently, I update the toolchain in my dev machine from LLVM13 to LLVM14,
> and I find that there are many unsed include headers in the libvirt.  So
> I try to remove them in this series.

So is clang actually reporting that the headers are unused, or is
there some other tool with LLVM14 that is reporting this. I'm
basically curious how you go about finding the redundant includes ?

I do wonder if we could automate reporting in CI, but then whether
a header is redundant or not, is likely to be platform specific.
ie freebsd might need a header but on Linux perhaps not, or vica
verca.

> Besides, I also find that:
> 1. some header files are not self-contained, which means if you want to
>    include one header, you need to include more headers to meet the
>    requirements of the declarations in the header you want to include;

This is definitely a bug. We want all our headers to be self-contained
and should fix any such problems.

> 2. some includes in the .h file are not the dependences of the .h file
>    (the declaration) but the dependences of the .c file (the
>    implementation), maybe it's better to move them to .c file.

Agreed, those would be  better moved into the .c, as it could
(theoretically at least) speed up compilation to not huave so
many includes visible across the codebase.

> But it will take more time to cleanup.  So I only remove the unused
> includs in this series.  Is the community welcome to the removing and
> the cleanup I mentioned above?  If so, I'll move on and cleanup more.

Conceptually I think the cleanup is useful. Just have to be careful
not to break the code on platforms where different headers might be
needed to get the declaration for a given symbol. For example this
series breaks on Ubuntu 20.04 and Mingw64:

  https://gitlab.com/berrange/libvirt/-/jobs/2443438983
  https://gitlab.com/berrange/libvirt/-/jobs/2443439016

and indeed many other platforms with the same missing geteuid
declaration.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Re: [PATCH 00/29] Remove some unused includes
Posted by Adam Tao 1 year, 10 months ago
On 5/12/2022 12:25 AM, Daniel P. Berrangé wrote:
> On Wed, May 11, 2022 at 09:55:01PM +0800, Peng Liang wrote:
>> Recently, I update the toolchain in my dev machine from LLVM13 to LLVM14,
>> and I find that there are many unsed include headers in the libvirt.  So
>> I try to remove them in this series.
> 
> So is clang actually reporting that the headers are unused, or is
> there some other tool with LLVM14 that is reporting this. I'm
> basically curious how you go about finding the redundant includes ?

I use LSP+clangd for my editor and it is a new feature of clangd [1] who
reports the unused includes. For my editor configuration, it will report a
hint-level diagnostic for a unused include. But I doesn't find the
corresponding CLI tool so far, maybe it is clangd itself does the check. So
I just open the files using my editor then fix the unused diagnostics &
compile... It's such a waste of time! How I wish there is a CLI tool that can
do such boring work.

The feature may be experimental, which need to be enabled manually. And I find
that the diagnostics for .c file are almost perfect but that for .h file are
just abort 50-50 correctness.

[1] https://clangd.llvm.org/design/include-cleaner

> 
> I do wonder if we could automate reporting in CI, but then whether
> a header is redundant or not, is likely to be platform specific.
> ie freebsd might need a header but on Linux perhaps not, or vica
> verca.
> 
>> Besides, I also find that:
>> 1. some header files are not self-contained, which means if you want to
>>    include one header, you need to include more headers to meet the
>>    requirements of the declarations in the header you want to include;
> 
> This is definitely a bug. We want all our headers to be self-contained
> and should fix any such problems.

But I find several .h files which are not self-contained, e.g. src/qemu/qemu_backup.h
which uses virDomainObj in the declerations but includes nothing itself and
any .c files including qemu_backup.h need to include several other files.

> 
>> 2. some includes in the .h file are not the dependences of the .h file
>>    (the declaration) but the dependences of the .c file (the
>>    implementation), maybe it's better to move them to .c file.
> 
> Agreed, those would be  better moved into the .c, as it could
> (theoretically at least) speed up compilation to not huave so
> many includes visible across the codebase.
> 
>> But it will take more time to cleanup.  So I only remove the unused
>> includs in this series.  Is the community welcome to the removing and
>> the cleanup I mentioned above?  If so, I'll move on and cleanup more.
> 
> Conceptually I think the cleanup is useful. Just have to be careful
> not to break the code on platforms where different headers might be
> needed to get the declaration for a given symbol. For example this
> series breaks on Ubuntu 20.04 and Mingw64:
> 
>   https://gitlab.com/berrange/libvirt/-/jobs/2443438983
>   https://gitlab.com/berrange/libvirt/-/jobs/2443439016
> 
> and indeed many other platforms with the same missing geteuid
> declaration.

I'm very sorry for that. I only tested the series in my own machine with
my own build configuration, so maybe the series should be a "RFC" instead
of a "PATCH"? I will cover more scenarios in the next version.

BTW, how could I trigger the pipeline in my own repo? Just fork & push to
my own repo can trigger it?

> 
> With regards,
> Daniel

Re: [PATCH 00/29] Remove some unused includes
Posted by Daniel P. Berrangé 1 year, 10 months ago
On Thu, May 12, 2022 at 01:25:01AM +0800, Adam Tao wrote:
> On 5/12/2022 12:25 AM, Daniel P. Berrangé wrote:
> > On Wed, May 11, 2022 at 09:55:01PM +0800, Peng Liang wrote:
> >> Recently, I update the toolchain in my dev machine from LLVM13 to LLVM14,
> >> and I find that there are many unsed include headers in the libvirt.  So
> >> I try to remove them in this series.
> > 
> > So is clang actually reporting that the headers are unused, or is
> > there some other tool with LLVM14 that is reporting this. I'm
> > basically curious how you go about finding the redundant includes ?
> 
> I use LSP+clangd for my editor and it is a new feature of clangd [1] who
> reports the unused includes. For my editor configuration, it will report a
> hint-level diagnostic for a unused include. But I doesn't find the
> corresponding CLI tool so far, maybe it is clangd itself does the check. So
> I just open the files using my editor then fix the unused diagnostics &
> compile... It's such a waste of time! How I wish there is a CLI tool that can
> do such boring work.
> 
> The feature may be experimental, which need to be enabled manually. And I find
> that the diagnostics for .c file are almost perfect but that for .h file are
> just abort 50-50 correctness.
> 
> [1] https://clangd.llvm.org/design/include-cleaner

That's very interesting, thanks for the pointer.

> > I do wonder if we could automate reporting in CI, but then whether
> > a header is redundant or not, is likely to be platform specific.
> > ie freebsd might need a header but on Linux perhaps not, or vica
> > verca.
> > 
> >> Besides, I also find that:
> >> 1. some header files are not self-contained, which means if you want to
> >>    include one header, you need to include more headers to meet the
> >>    requirements of the declarations in the header you want to include;
> > 
> > This is definitely a bug. We want all our headers to be self-contained
> > and should fix any such problems.
> 
> But I find several .h files which are not self-contained, e.g. src/qemu/qemu_backup.h
> which uses virDomainObj in the declerations but includes nothing itself and
> any .c files including qemu_backup.h need to include several other files.
> 
> > 
> >> 2. some includes in the .h file are not the dependences of the .h file
> >>    (the declaration) but the dependences of the .c file (the
> >>    implementation), maybe it's better to move them to .c file.
> > 
> > Agreed, those would be  better moved into the .c, as it could
> > (theoretically at least) speed up compilation to not huave so
> > many includes visible across the codebase.
> > 
> >> But it will take more time to cleanup.  So I only remove the unused
> >> includs in this series.  Is the community welcome to the removing and
> >> the cleanup I mentioned above?  If so, I'll move on and cleanup more.
> > 
> > Conceptually I think the cleanup is useful. Just have to be careful
> > not to break the code on platforms where different headers might be
> > needed to get the declaration for a given symbol. For example this
> > series breaks on Ubuntu 20.04 and Mingw64:
> > 
> >   https://gitlab.com/berrange/libvirt/-/jobs/2443438983
> >   https://gitlab.com/berrange/libvirt/-/jobs/2443439016
> > 
> > and indeed many other platforms with the same missing geteuid
> > declaration.
> 
> I'm very sorry for that. I only tested the series in my own machine with
> my own build configuration, so maybe the series should be a "RFC" instead
> of a "PATCH"? I will cover more scenarios in the next version.

No problem.

> BTW, how could I trigger the pipeline in my own repo? Just fork & push to
> my own repo can trigger it?

Yes, that's sufficient currently.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|