Note that VIR_STRDUP is still defined at the end of this series,
due to sharing a test with VIR_STRNDUP.
Removing VIR_STRNDUP will require some extra care, since GLib's
g_strndup does not accept a length of -1 as an alias for acting
like g_strdup.
Ján Tomko (34):
scripts: introduce a macro file for coccinelle
util: fix check for iscsi initiator copy
conf: use g_strdup in virDomainDiskSet
Use g_strdup instead of ignoring VIR_STRDUP's value
Use g_strdup instead of ignoring VIR_STRDUP_QUIET's value
drivers: use g_strdup in probe functions
Use g_strdup where VIR_STRDUP's return value was propagated
Use g_strdup to fill in default values
bhyve: use g_strdup instead of VIR_STRDUP
conf: use g_strdup instead of VIR_STRDUP
cpu: use g_strdup instead of VIR_STRDUP
datatypes: use g_strdup instead of VIR_STRDUP
esx: use g_strdup instead of VIR_STRDUP
interface: use g_strdup instead of VIR_STRDUP
libxl: use g_strdup instead of VIR_STRDUP
locking: use g_strdup instead of VIR_STRDUP
logging: use g_strdup instead of VIR_STRDUP
lxc: use g_strdup instead of VIR_STRDUP
network: use g_strdup instead of VIR_STRDUP
node_device: use g_strdup instead of VIR_STRDUP
nwfilter: use g_strdup instead of VIR_STRDUP
qemu: use g_strdup instead of VIR_STRDUP
remote: use g_strdup instead of VIR_STRDUP
rpc: use g_strdup instead of VIR_STRDUP
security: use g_strdup instead of VIR_STRDUP
storage: use g_strdup instead of VIR_STRDUP
test: use g_strdup instead of VIR_STRDUP
virstorage: use g_strdup instead of VIR_STRDUP
vircgroup: use g_strdup instead of VIR_STRDUP
util: use g_strdup instead of VIR_STRDUP
vbox: use g_strdup instead of VIR_STRDUP
tests: use g_strdup instead of VIR_STRDUP
tools: use g_strdup instead of VIR_STRDUP
Use g_strdup instead of VIR_STRDUP everywhere
scripts/cocci-macro-file.h | 39 ++++
src/admin/admin_server_dispatch.c | 3 +-
src/bhyve/bhyve_command.c | 15 +-
src/bhyve/bhyve_conf.c | 3 +-
src/bhyve/bhyve_driver.c | 6 +-
src/bhyve/bhyve_parse_command.c | 35 +---
src/conf/capabilities.c | 33 ++-
src/conf/checkpoint_conf.c | 9 +-
src/conf/cpu_conf.c | 15 +-
src/conf/domain_audit.c | 15 +-
src/conf/domain_capabilities.c | 8 +-
src/conf/domain_conf.c | 173 ++++++----------
src/conf/domain_event.c | 103 +++-------
src/conf/domain_nwfilter.c | 14 +-
src/conf/networkcommon_conf.c | 3 +-
src/conf/node_device_conf.c | 14 +-
src/conf/node_device_util.c | 5 +-
src/conf/nwfilter_conf.c | 4 +-
src/conf/nwfilter_ipaddrmap.c | 3 +-
src/conf/nwfilter_params.c | 12 +-
src/conf/object_event.c | 10 +-
src/conf/snapshot_conf.c | 9 +-
src/conf/storage_conf.c | 17 +-
src/conf/virchrdev.c | 6 +-
src/conf/virdomainmomentobjlist.c | 7 +-
src/conf/virdomainobjlist.c | 10 +-
src/conf/virinterfaceobj.c | 11 +-
src/conf/virnetworkobj.c | 7 +-
src/conf/virnodedeviceobj.c | 10 +-
src/conf/virnwfilterbindingdef.c | 12 +-
src/conf/virnwfilterobj.c | 11 +-
src/conf/virstorageobj.c | 28 +--
src/cpu/cpu_arm.c | 5 +-
src/cpu/cpu_ppc64.c | 31 ++-
src/cpu/cpu_x86.c | 45 ++---
src/datatypes.c | 45 ++---
src/esx/esx_driver.c | 37 +---
src/esx/esx_interface_driver.c | 15 +-
src/esx/esx_network_driver.c | 33 +--
src/esx/esx_storage_backend_iscsi.c | 11 +-
src/esx/esx_storage_backend_vmfs.c | 15 +-
src/esx/esx_util.c | 38 ++--
src/esx/esx_vi.c | 82 ++++----
src/esx/esx_vi_types.c | 23 +--
src/hyperv/hyperv_driver.c | 17 +-
src/hyperv/hyperv_util.c | 8 +-
src/interface/interface_backend_netcf.c | 11 +-
src/interface/interface_backend_udev.c | 30 +--
src/libvirt-admin.c | 18 +-
src/libvirt.c | 16 +-
src/libxl/libxl_capabilities.c | 4 +-
src/libxl/libxl_conf.c | 185 ++++++-----------
src/libxl/libxl_domain.c | 15 +-
src/libxl/libxl_driver.c | 23 +--
src/libxl/libxl_migration.c | 8 +-
src/libxl/xen_common.c | 62 ++----
src/libxl/xen_xl.c | 30 +--
src/libxl/xen_xm.c | 3 +-
src/locking/lock_daemon.c | 24 +--
src/locking/lock_daemon_config.c | 3 +-
src/locking/lock_daemon_dispatch.c | 3 +-
src/locking/lock_driver_lockd.c | 24 +--
src/locking/lock_driver_sanlock.c | 14 +-
src/locking/lock_manager.c | 3 +-
src/logging/log_daemon.c | 21 +-
src/logging/log_daemon_config.c | 3 +-
src/logging/log_handler.c | 11 +-
src/logging/log_manager.c | 3 +-
src/lxc/lxc_conf.c | 21 +-
src/lxc/lxc_container.c | 20 +-
src/lxc/lxc_controller.c | 12 +-
src/lxc/lxc_driver.c | 10 +-
src/lxc/lxc_native.c | 63 +++---
src/lxc/lxc_process.c | 13 +-
src/network/bridge_driver.c | 51 ++---
src/network/leaseshelper.c | 6 +-
src/node_device/node_device_driver.c | 32 +--
src/node_device/node_device_hal.c | 8 +-
src/node_device/node_device_udev.c | 75 +++----
src/nwfilter/nwfilter_dhcpsnoop.c | 5 +-
src/nwfilter/nwfilter_driver.c | 9 +-
src/openvz/openvz_conf.c | 16 +-
src/openvz/openvz_driver.c | 19 +-
src/phyp/phyp_driver.c | 25 +--
src/qemu/qemu_agent.c | 51 ++---
src/qemu/qemu_alias.c | 32 +--
src/qemu/qemu_block.c | 48 ++---
src/qemu/qemu_blockjob.c | 9 +-
src/qemu/qemu_capabilities.c | 90 ++++-----
src/qemu/qemu_cgroup.c | 5 +-
src/qemu/qemu_checkpoint.c | 12 +-
src/qemu/qemu_command.c | 15 +-
src/qemu/qemu_conf.c | 55 ++---
src/qemu/qemu_dbus.c | 7 +-
src/qemu/qemu_domain.c | 59 +++---
src/qemu/qemu_driver.c | 80 +++-----
src/qemu/qemu_firmware.c | 44 ++--
src/qemu/qemu_hotplug.c | 23 +--
src/qemu/qemu_interface.c | 6 +-
src/qemu/qemu_interop_config.c | 6 +-
src/qemu/qemu_migration.c | 28 +--
src/qemu/qemu_migration_cookie.c | 21 +-
src/qemu/qemu_migration_params.c | 10 +-
src/qemu/qemu_monitor.c | 14 +-
src/qemu/qemu_monitor_json.c | 125 +++++-------
src/qemu/qemu_process.c | 71 +++----
src/qemu/qemu_vhost_user.c | 6 +-
src/remote/remote_daemon.c | 15 +-
src/remote/remote_daemon_config.c | 24 +--
src/remote/remote_daemon_dispatch.c | 222 ++++++++-------------
src/remote/remote_driver.c | 110 ++++------
src/rpc/gendispatch.pl | 20 +-
src/rpc/virnetclient.c | 15 +-
src/rpc/virnetlibsshsession.c | 19 +-
src/rpc/virnetmessage.c | 26 +--
src/rpc/virnetsaslcontext.c | 2 +-
src/rpc/virnetserver.c | 3 +-
src/rpc/virnetserverclient.c | 3 +-
src/rpc/virnetsocket.c | 9 +-
src/rpc/virnetsshsession.c | 30 +--
src/rpc/virnettlscontext.c | 21 +-
src/security/security_apparmor.c | 12 +-
src/security/security_dac.c | 10 +-
src/security/security_nop.c | 2 +-
src/security/security_selinux.c | 48 ++---
src/security/virt-aa-helper.c | 15 +-
src/storage/parthelper.c | 3 +-
src/storage/storage_backend_disk.c | 19 +-
src/storage/storage_backend_fs.c | 5 +-
src/storage/storage_backend_gluster.c | 15 +-
src/storage/storage_backend_iscsi_direct.c | 3 +-
src/storage/storage_backend_logical.c | 12 +-
src/storage/storage_backend_mpath.c | 3 +-
src/storage/storage_backend_rbd.c | 3 +-
src/storage/storage_backend_scsi.c | 2 +-
src/storage/storage_backend_sheepdog.c | 9 +-
src/storage/storage_backend_zfs.c | 10 +-
src/storage/storage_driver.c | 23 +--
src/storage/storage_util.c | 39 ++--
src/test/test_driver.c | 133 +++++-------
src/util/virarptable.c | 6 +-
src/util/virauth.c | 12 +-
src/util/virauthconfig.c | 6 +-
src/util/virbitmap.c | 2 +-
src/util/vircgroup.c | 15 +-
src/util/vircgroupv1.c | 41 ++--
src/util/vircgroupv2.c | 9 +-
src/util/vircommand.c | 44 +---
src/util/virconf.c | 30 +--
src/util/virdbus.c | 9 +-
src/util/virdnsmasq.c | 13 +-
src/util/virerror.c | 23 +--
src/util/virfcp.c | 3 +-
src/util/virfdstream.c | 10 +-
src/util/virfile.c | 52 ++---
src/util/virfilecache.c | 6 +-
src/util/virfirewall.c | 3 +-
src/util/virfirmware.c | 10 +-
src/util/virhash.c | 2 +-
src/util/virhostdev.c | 3 +-
src/util/virhostmem.c | 3 +-
src/util/viriscsi.c | 12 +-
src/util/virjson.c | 13 +-
src/util/virlease.c | 11 +-
src/util/virlockspace.c | 21 +-
src/util/virlog.c | 11 +-
src/util/virmdev.c | 9 +-
src/util/virnetdev.c | 2 +-
src/util/virnetdevmacvlan.c | 12 +-
src/util/virnetdevopenvswitch.c | 3 +-
src/util/virnetdevtap.c | 6 +-
src/util/virnetdevvportprofile.c | 5 +-
src/util/virnuma.c | 3 +-
src/util/virobject.c | 3 +-
src/util/virpci.c | 32 +--
src/util/virportallocator.c | 8 +-
src/util/virresctrl.c | 9 +-
src/util/virrotatingfile.c | 9 +-
src/util/virscsi.c | 9 +-
src/util/virscsihost.c | 2 +-
src/util/virscsivhost.c | 13 +-
src/util/virseclabel.c | 19 +-
src/util/virsecret.c | 3 +-
src/util/virsocketaddr.c | 6 +-
src/util/virstorageencryption.c | 11 +-
src/util/virstoragefile.c | 197 +++++++-----------
src/util/virstring.c | 16 +-
src/util/virsysinfo.c | 6 +-
src/util/virsystemd.c | 3 +-
src/util/virtpm.c | 8 +-
src/util/virtypedparam-public.c | 6 +-
src/util/virtypedparam.c | 28 +--
src/util/viruri.c | 25 +--
src/util/virusb.c | 6 +-
src/util/virutil.c | 35 ++--
src/util/virvhba.c | 8 +-
src/util/virxml.c | 7 +-
src/vbox/vbox_XPCOMCGlue.c | 3 +-
src/vbox/vbox_common.c | 152 ++++----------
src/vbox/vbox_network.c | 45 ++---
src/vbox/vbox_snapshot_conf.c | 15 +-
src/vbox/vbox_storage.c | 17 +-
src/vmware/vmware_conf.c | 13 +-
src/vmware/vmware_driver.c | 8 +-
src/vmx/vmx.c | 20 +-
src/vz/vz_driver.c | 5 +-
src/vz/vz_sdk.c | 29 +--
tests/bhyvexml2argvmock.c | 6 +-
tests/commandtest.c | 5 +-
tests/cputest.c | 4 +-
tests/domaincapstest.c | 19 +-
tests/networkxml2firewalltest.c | 4 +-
tests/nssmock.c | 3 +-
tests/openvzutilstest.c | 5 +-
tests/qemublocktest.c | 3 +-
tests/qemudomaincheckpointxml2xmltest.c | 9 +-
tests/qemufirmwaretest.c | 3 +-
tests/qemuhotplugtest.c | 8 +-
tests/qemumemlocktest.c | 5 +-
tests/qemumonitorjsontest.c | 3 +-
tests/qemumonitortestutils.c | 32 ++-
tests/qemusecuritymock.c | 6 +-
tests/qemuvhostusertest.c | 3 +-
tests/qemuxml2argvmock.c | 12 +-
tests/qemuxml2argvtest.c | 59 ++----
tests/qemuxml2xmltest.c | 5 +-
tests/scsihosttest.c | 5 +-
tests/securityselinuxhelper.c | 6 +-
tests/securityselinuxlabeltest.c | 8 +-
tests/securityselinuxtest.c | 13 +-
tests/storagebackendsheepdogtest.c | 6 +-
tests/testutils.c | 5 +-
tests/testutilsqemu.c | 31 +--
tests/vboxsnapshotxmltest.c | 4 +-
tests/viralloctest.c | 3 +-
tests/vircgrouptest.c | 5 +-
tests/virfilecachetest.c | 7 +-
tests/virfilemock.c | 2 +-
tests/virfirewalltest.c | 8 +-
tests/virhostdevtest.c | 8 +-
tests/viriscsitest.c | 12 +-
tests/virnetmessagetest.c | 11 +-
tests/virpcimock.c | 19 +-
tests/virpcitest.c | 5 +-
tests/virscsitest.c | 5 +-
tests/virstoragetest.c | 6 +-
tests/virstringtest.c | 15 +-
tests/virtestmock.c | 3 +-
tests/virusbmock.c | 4 +-
tests/vmx2xmltest.c | 5 +-
tests/xml2vmxtest.c | 5 +-
tools/virsh-completer-checkpoint.c | 3 +-
tools/virsh-completer-domain.c | 15 +-
tools/virsh-completer-interface.c | 3 +-
tools/virsh-completer-network.c | 14 +-
tools/virsh-completer-nodedev.c | 15 +-
tools/virsh-completer-nwfilter.c | 6 +-
tools/virsh-completer-pool.c | 15 +-
tools/virsh-completer-secret.c | 10 +-
tools/virsh-completer-snapshot.c | 3 +-
tools/virsh-completer-volume.c | 3 +-
tools/virsh-completer.c | 8 +-
tools/virt-admin-completer.c | 3 +-
tools/virt-login-shell-helper.c | 17 +-
tools/vsh-table.c | 3 +-
tools/vsh.c | 11 +-
266 files changed, 1906 insertions(+), 3460 deletions(-)
create mode 100644 scripts/cocci-macro-file.h
--
2.21.0