From 7c9a2d88cd80211cfc71e31489397c902fe3c997 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 3 Apr 2013 12:36:23 +0200 Subject: [PATCH] virutil: Move string related functions to virstring.c The source code base needs to be adapted as well. Some files include virutil.h just for the string related functions (here, the include is substituted to match the new file), some include virutil.h without any need (here, the include is removed), and some require both. --- cfg.mk | 4 +- daemon/libvirtd-config.c | 2 + daemon/libvirtd.c | 2 +- daemon/remote.c | 3 +- python/libvirt-override.c | 1 + src/conf/capabilities.c | 1 - src/conf/cpu_conf.c | 2 +- src/conf/device_conf.c | 2 +- src/conf/domain_audit.c | 1 + src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 1 - src/conf/interface_conf.c | 1 - src/conf/netdev_bandwidth_conf.c | 2 +- src/conf/netdev_vport_profile_conf.c | 1 + src/conf/network_conf.c | 2 +- src/conf/node_device_conf.c | 1 - src/conf/nwfilter_conf.c | 2 +- src/conf/nwfilter_conf.h | 1 - src/conf/nwfilter_params.c | 1 + src/conf/secret_conf.c | 1 - src/conf/snapshot_conf.c | 2 +- src/conf/storage_conf.c | 2 +- src/conf/storage_conf.h | 1 - src/conf/storage_encryption_conf.c | 1 - src/conf/virchrdev.c | 1 + src/cpu/cpu_powerpc.c | 1 - src/cpu/cpu_x86.c | 3 +- src/datatypes.c | 1 - src/driver.c | 2 +- src/esx/esx_device_monitor.c | 1 - src/esx/esx_driver.c | 2 +- src/esx/esx_interface_driver.c | 1 - src/esx/esx_network_driver.c | 1 - src/esx/esx_nwfilter_driver.c | 1 - src/esx/esx_secret_driver.c | 1 - src/esx/esx_storage_backend_iscsi.c | 1 - src/esx/esx_storage_backend_vmfs.c | 2 +- src/esx/esx_util.c | 2 +- src/esx/esx_vi.c | 2 +- src/esx/esx_vi_types.c | 2 +- src/fdstream.c | 1 + src/hyperv/hyperv_device_monitor.c | 1 - src/hyperv/hyperv_driver.c | 2 +- src/hyperv/hyperv_interface_driver.c | 1 - src/hyperv/hyperv_network_driver.c | 1 - src/hyperv/hyperv_nwfilter_driver.c | 1 - src/hyperv/hyperv_secret_driver.c | 1 - src/hyperv/hyperv_storage_driver.c | 1 - src/hyperv/hyperv_util.c | 1 - src/hyperv/hyperv_wmi.c | 2 +- src/interface/interface_backend_udev.c | 1 + src/libvirt.c | 1 + src/libvirt_private.syms | 32 +-- src/libxl/libxl_driver.c | 1 + src/locking/lock_daemon.c | 1 + src/locking/lock_daemon_config.c | 2 + src/locking/lock_daemon_dispatch.c | 1 - src/locking/lock_driver_lockd.c | 2 +- src/locking/lock_driver_sanlock.c | 1 - src/locking/lock_manager.c | 2 +- src/lxc/lxc_cgroup.c | 1 + src/lxc/lxc_container.c | 2 +- src/lxc/lxc_controller.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/lxc/lxc_fuse.c | 1 + src/lxc/lxc_fuse.h | 1 - src/lxc/lxc_monitor.c | 1 + src/lxc/lxc_process.c | 1 + src/network/bridge_driver.c | 2 +- src/node_device/node_device_driver.c | 1 - src/node_device/node_device_linux_sysfs.c | 1 + src/node_device/node_device_udev.c | 2 +- src/nodeinfo.c | 3 +- src/nwfilter/nwfilter_dhcpsnoop.c | 1 + src/nwfilter/nwfilter_driver.c | 1 + src/nwfilter/nwfilter_ebiptables_driver.c | 2 +- src/nwfilter/nwfilter_learnipaddr.c | 1 + src/openvz/openvz_conf.c | 2 +- src/openvz/openvz_driver.c | 2 +- src/parallels/parallels_driver.c | 2 +- src/parallels/parallels_network.c | 2 +- src/parallels/parallels_storage.c | 2 +- src/parallels/parallels_utils.c | 2 +- src/phyp/phyp_driver.c | 3 +- src/qemu/qemu_agent.c | 1 + src/qemu/qemu_bridge_filter.c | 1 - src/qemu/qemu_capabilities.c | 1 - src/qemu/qemu_cgroup.c | 1 - src/qemu/qemu_command.c | 1 - src/qemu/qemu_conf.c | 1 - src/qemu/qemu_domain.c | 1 + src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_hotplug.c | 1 + src/qemu/qemu_migration.c | 3 +- src/qemu/qemu_monitor.c | 1 + src/qemu/qemu_monitor_text.c | 1 + src/qemu/qemu_process.c | 2 +- src/remote/remote_driver.c | 2 +- src/rpc/virkeepalive.c | 1 - src/rpc/virnetserverclient.c | 2 + src/rpc/virnetsocket.c | 2 +- src/rpc/virnetsshsession.c | 1 + src/rpc/virnettlscontext.c | 1 + src/secret/secret_driver.c | 2 +- src/security/security_apparmor.c | 2 +- src/security/security_dac.c | 2 +- src/security/security_selinux.c | 2 +- src/security/virt-aa-helper.c | 2 +- src/storage/storage_backend.c | 2 +- src/storage/storage_backend_disk.c | 2 +- src/storage/storage_backend_fs.c | 1 + src/storage/storage_backend_iscsi.c | 2 +- src/storage/storage_backend_logical.c | 1 + src/storage/storage_backend_mpath.c | 1 + src/storage/storage_backend_rbd.c | 1 - src/storage/storage_backend_scsi.c | 1 + src/storage/storage_backend_sheepdog.c | 1 - src/storage/storage_driver.c | 2 +- src/test/test_driver.c | 2 +- src/uml/uml_conf.c | 3 +- src/uml/uml_driver.c | 2 +- src/util/iohelper.c | 1 + src/util/viraudit.c | 2 +- src/util/virauth.c | 1 + src/util/virauthconfig.c | 3 +- src/util/virbitmap.c | 3 +- src/util/vircommand.c | 1 + src/util/vircommand.h | 1 - src/util/virdnsmasq.c | 1 + src/util/virebtables.c | 2 + src/util/virerror.c | 1 + src/util/virfile.c | 1 + src/util/virhook.h | 1 - src/util/virinitctl.c | 1 + src/util/viriptables.c | 2 + src/util/virjson.c | 1 + src/util/virlockspace.c | 1 + src/util/virlog.c | 1 + src/util/virnetdev.c | 2 + src/util/virnetdevbandwidth.c | 1 + src/util/virnetdevbridge.c | 1 + src/util/virnetdevmacvlan.c | 1 - src/util/virnetdevopenvswitch.c | 1 + src/util/virnetdevopenvswitch.h | 1 - src/util/virnetdevtap.c | 2 +- src/util/virnetdevveth.c | 2 + src/util/virnetdevvportprofile.c | 1 + src/util/virpci.c | 2 + src/util/virpidfile.c | 1 + src/util/virprocess.c | 1 + src/util/virrandom.c | 1 + src/util/virsexpr.c | 2 +- src/util/virsocketaddr.c | 2 +- src/util/virstatslinux.c | 1 - src/util/virstoragefile.c | 2 + src/util/virstring.c | 335 ++++++++++++++++++++++ src/util/virstring.h | 50 ++++ src/util/virsysinfo.c | 2 +- src/util/virtime.c | 1 - src/util/virtpm.c | 2 +- src/util/virtypedparam.c | 1 + src/util/viruri.c | 2 +- src/util/virusb.c | 1 + src/util/virutil.c | 334 +-------------------- src/util/virutil.h | 49 ---- src/util/virxml.c | 1 + src/vbox/vbox_MSCOMGlue.c | 1 - src/vbox/vbox_XPCOMCGlue.c | 1 + src/vbox/vbox_driver.c | 1 - src/vbox/vbox_tmpl.c | 1 + src/vmware/vmware_conf.c | 2 +- src/vmware/vmware_driver.c | 1 - src/vmx/vmx.c | 1 + src/xen/block_stats.c | 2 +- src/xen/xen_driver.c | 2 +- src/xen/xen_hypervisor.c | 2 +- src/xen/xend_internal.c | 2 +- src/xen/xm_internal.c | 2 +- src/xenapi/xenapi_driver.c | 2 +- src/xenapi/xenapi_utils.c | 2 +- src/xenxs/xen_sxpr.c | 1 + src/xenxs/xen_xm.c | 1 + tests/commandtest.c | 2 +- tests/cputest.c | 1 + tests/domainsnapshotxml2xmltest.c | 1 + tests/esxutilstest.c | 1 - tests/interfacexml2xmltest.c | 2 +- tests/libvirtdconftest.c | 1 + tests/lxcxml2xmltest.c | 1 + tests/networkxml2conftest.c | 1 + tests/networkxml2xmltest.c | 1 + tests/nodedevxml2xmltest.c | 1 + tests/nodeinfotest.c | 2 +- tests/nwfilterxml2xmltest.c | 1 + tests/openvzutilstest.c | 2 +- tests/qemuargv2xmltest.c | 2 +- tests/qemuhelptest.c | 1 + tests/qemumonitortest.c | 1 - tests/qemumonitortestutils.c | 2 +- tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmltest.c | 1 + tests/qemuxmlnstest.c | 2 +- tests/securityselinuxlabeltest.c | 3 +- tests/securityselinuxtest.c | 3 +- tests/sexpr2xmltest.c | 1 + tests/storagepoolxml2xmltest.c | 1 + tests/storagevolxml2argvtest.c | 1 + tests/storagevolxml2xmltest.c | 1 + tests/sysinfotest.c | 2 +- tests/testutils.c | 1 + tests/virauthconfigtest.c | 1 - tests/virbuftest.c | 2 +- tests/vircgrouptest.c | 2 +- tests/virdrivermoduletest.c | 1 - tests/virhashtest.c | 3 +- tests/viridentitytest.c | 1 - tests/virkeyfiletest.c | 1 - tests/virnetmessagetest.c | 1 - tests/virnetsockettest.c | 1 + tests/virportallocatortest.c | 2 +- tests/virshtest.c | 2 +- tests/virstoragetest.c | 1 + tests/virstringtest.c | 1 - tests/virtimetest.c | 1 - tests/viruritest.c | 1 - tests/vmx2xmltest.c | 1 + tests/xencapstest.c | 1 + tests/xmconfigtest.c | 1 + tests/xml2sexprtest.c | 1 + tests/xml2vmxtest.c | 1 + tools/console.c | 1 - tools/virsh-domain-monitor.c | 1 + tools/virsh-domain.c | 1 - tools/virsh-host.c | 2 +- tools/virsh-interface.c | 1 + tools/virsh-network.c | 1 - tools/virsh-nodedev.c | 1 - tools/virsh-pool.c | 2 +- tools/virsh-snapshot.c | 1 - tools/virsh-volume.c | 1 + tools/virsh.c | 2 +- tools/virt-host-validate-common.c | 1 + 242 files changed, 590 insertions(+), 557 deletions(-) diff --git a/cfg.mk b/cfg.mk index f0f78f5f2d..d499dede19 100644 --- a/cfg.mk +++ b/cfg.mk @@ -858,7 +858,7 @@ exclude_file_name_regexp--sc_prohibit_always_true_header_tests = \ ^python/(libvirt-(lxc-|qemu-)?override|typewrappers)\.c$$ exclude_file_name_regexp--sc_prohibit_asprintf = \ - ^(bootstrap.conf$$|src/util/virutil\.c$$|examples/domain-events/events-c/event-test\.c$$|tests/vircgroupmock\.c$$) + ^(bootstrap.conf$$|src/util/virstring\.c$$|examples/domain-events/events-c/event-test\.c$$|tests/vircgroupmock\.c$$) exclude_file_name_regexp--sc_prohibit_close = \ (\.p[yl]$$|^docs/|^(src/util/virfile\.c|src/libvirt\.c|tests/vircgroupmock\.c)$$) @@ -892,7 +892,7 @@ exclude_file_name_regexp--sc_prohibit_setuid = ^src/util/virutil\.c$$ exclude_file_name_regexp--sc_prohibit_sprintf = \ ^(docs/hacking\.html\.in)|(examples/systemtap/.*stp)|(src/dtrace2systemtap\.pl)|(src/rpc/gensystemtap\.pl)$$ -exclude_file_name_regexp--sc_prohibit_strncpy = ^src/util/virutil\.c$$ +exclude_file_name_regexp--sc_prohibit_strncpy = ^src/util/virstring\.c$$ exclude_file_name_regexp--sc_prohibit_strtol = \ ^src/(util/virsexpr|(vbox|xen|xenxs)/.*)\.c$$ diff --git a/daemon/libvirtd-config.c b/daemon/libvirtd-config.c index 5e3ae218f3..efb564eeb3 100644 --- a/daemon/libvirtd-config.c +++ b/daemon/libvirtd-config.c @@ -32,6 +32,8 @@ #include "configmake.h" #include "remote/remote_protocol.h" #include "remote/remote_driver.h" +#include "virstring.h" +#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_CONF diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 38b7346698..9f81a0f1ea 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -43,7 +43,6 @@ #include "libvirtd.h" #include "libvirtd-config.h" -#include "virutil.h" #include "viruuid.h" #include "remote_driver.h" #include "viralloc.h" @@ -54,6 +53,7 @@ #include "virhook.h" #include "viraudit.h" #include "locking/lock_manager.h" +#include "virstring.h" #ifdef WITH_DRIVER_MODULES # include "driver.h" diff --git a/daemon/remote.c b/daemon/remote.c index e5e3f2ca5d..8c79680721 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -35,7 +35,6 @@ #include "datatypes.h" #include "viralloc.h" #include "virlog.h" -#include "virutil.h" #include "stream.h" #include "viruuid.h" #include "vircommand.h" @@ -49,7 +48,7 @@ #include "remote_protocol.h" #include "qemu_protocol.h" #include "lxc_protocol.h" - +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_RPC diff --git a/python/libvirt-override.c b/python/libvirt-override.c index 244b7ec5e5..856789a2ac 100644 --- a/python/libvirt-override.c +++ b/python/libvirt-override.c @@ -28,6 +28,7 @@ #include "virtypedparam.h" #include "ignore-value.h" #include "virutil.h" +#include "virstring.h" #ifndef __CYGWIN__ extern void initlibvirtmod(void); diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index c7ec92f22a..5340b63af0 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -28,7 +28,6 @@ #include "capabilities.h" #include "virbuffer.h" #include "viralloc.h" -#include "virutil.h" #include "viruuid.h" #include "cpu_conf.h" #include "virerror.h" diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index bdc5f1d17e..6aaee75ad7 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -25,10 +25,10 @@ #include "virerror.h" #include "viralloc.h" -#include "virutil.h" #include "virbuffer.h" #include "cpu_conf.h" #include "domain_conf.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_CPU diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index 099b1cbc4d..f49dc21d84 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -26,9 +26,9 @@ #include "viralloc.h" #include "virxml.h" #include "viruuid.h" -#include "virutil.h" #include "virbuffer.h" #include "device_conf.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_DEVICE diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c index d81744c0fc..40910d679f 100644 --- a/src/conf/domain_audit.c +++ b/src/conf/domain_audit.c @@ -31,6 +31,7 @@ #include "viruuid.h" #include "virlog.h" #include "viralloc.h" +#include "virstring.h" /* Return nn:mm in hex for block and character devices, and NULL * for other file types, stat failure, or allocation failure. */ diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 608870f157..fe97c02fc5 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -38,7 +38,6 @@ #include "verify.h" #include "virxml.h" #include "viruuid.h" -#include "virutil.h" #include "virbuffer.h" #include "virlog.h" #include "nwfilter_conf.h" @@ -52,6 +51,7 @@ #include "netdev_vlan_conf.h" #include "device_conf.h" #include "virtpm.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_DOMAIN diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 3a0f23ae7e..21f7ce28da 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -32,7 +32,6 @@ # include "capabilities.h" # include "storage_encryption_conf.h" # include "cpu_conf.h" -# include "virutil.h" # include "virthread.h" # include "virhash.h" # include "virsocketaddr.h" diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index 7ca9c8618c..fd3c2920f6 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -30,7 +30,6 @@ #include "viralloc.h" #include "virxml.h" #include "viruuid.h" -#include "virutil.h" #include "virbuffer.h" #define VIR_FROM_THIS VIR_FROM_INTERFACE diff --git a/src/conf/netdev_bandwidth_conf.c b/src/conf/netdev_bandwidth_conf.c index b830cd00cb..87249cb236 100644 --- a/src/conf/netdev_bandwidth_conf.c +++ b/src/conf/netdev_bandwidth_conf.c @@ -24,9 +24,9 @@ #include "netdev_bandwidth_conf.h" #include "virerror.h" -#include "virutil.h" #include "viralloc.h" #include "domain_conf.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_profile_conf.c index 47f51f9592..c2753394d4 100644 --- a/src/conf/netdev_vport_profile_conf.c +++ b/src/conf/netdev_vport_profile_conf.c @@ -25,6 +25,7 @@ #include "netdev_vport_profile_conf.h" #include "virerror.h" #include "viralloc.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index d910a279fe..8abfa53008 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -40,10 +40,10 @@ #include "viralloc.h" #include "virxml.h" #include "viruuid.h" -#include "virutil.h" #include "virbuffer.h" #include "c-ctype.h" #include "virfile.h" +#include "virstring.h" #define MAX_BRIDGE_ID 256 #define VIR_FROM_THIS VIR_FROM_NETWORK diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index 8fe4e0350d..f9303c1ae4 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -32,7 +32,6 @@ #include "node_device_conf.h" #include "virxml.h" -#include "virutil.h" #include "virbuffer.h" #include "viruuid.h" #include "virrandom.h" diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index b61010df69..08222de68d 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -47,7 +47,7 @@ #include "domain_conf.h" #include "c-ctype.h" #include "virfile.h" - +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NWFILTER diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h index 48998ec7f0..5d04cff890 100644 --- a/src/conf/nwfilter_conf.h +++ b/src/conf/nwfilter_conf.h @@ -28,7 +28,6 @@ # include "internal.h" -# include "virutil.h" # include "virhash.h" # include "virxml.h" # include "virbuffer.h" diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index 7aebc8db0a..2509c0d8e6 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -31,6 +31,7 @@ #include "nwfilter_params.h" #include "domain_conf.h" #include "virlog.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NWFILTER diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c index a81a91b6c9..5bcfe12a01 100644 --- a/src/conf/secret_conf.c +++ b/src/conf/secret_conf.c @@ -29,7 +29,6 @@ #include "viralloc.h" #include "secret_conf.h" #include "virerror.h" -#include "virutil.h" #include "virxml.h" #include "viruuid.h" diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index bd5684d8cb..5b54a28a59 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -42,11 +42,11 @@ #include "secret_conf.h" #include "snapshot_conf.h" #include "virstoragefile.h" -#include "virutil.h" #include "viruuid.h" #include "virfile.h" #include "virerror.h" #include "virxml.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_DOMAIN_SNAPSHOT diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index b58385d2fd..9f2012e22b 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -41,9 +41,9 @@ #include "virxml.h" #include "viruuid.h" #include "virbuffer.h" -#include "virutil.h" #include "viralloc.h" #include "virfile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index 60b8034a75..567a4ac3d1 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -25,7 +25,6 @@ # define __VIR_STORAGE_CONF_H__ # include "internal.h" -# include "virutil.h" # include "storage_encryption_conf.h" # include "virthread.h" diff --git a/src/conf/storage_encryption_conf.c b/src/conf/storage_encryption_conf.c index 88dff1b210..c710bbd248 100644 --- a/src/conf/storage_encryption_conf.c +++ b/src/conf/storage_encryption_conf.c @@ -31,7 +31,6 @@ #include "viralloc.h" #include "storage_conf.h" #include "storage_encryption_conf.h" -#include "virutil.h" #include "virxml.h" #include "virerror.h" #include "viruuid.h" diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index 1802324a77..025d4a817b 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -37,6 +37,7 @@ #include "virlog.h" #include "virerror.h" #include "virfile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c index 5f392ee007..b253db278f 100644 --- a/src/cpu/cpu_powerpc.c +++ b/src/cpu/cpu_powerpc.c @@ -28,7 +28,6 @@ #include "virlog.h" #include "viralloc.h" -#include "virutil.h" #include "cpu.h" #include "cpu_map.h" diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 4940c23703..14d525e537 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -27,13 +27,12 @@ #include "virlog.h" #include "viralloc.h" -#include "virutil.h" #include "cpu.h" #include "cpu_map.h" #include "cpu_x86.h" #include "virbuffer.h" #include "virendian.h" - +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_CPU diff --git a/src/datatypes.c b/src/datatypes.c index 0e1dbb17be..d3cf5f2d38 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -27,7 +27,6 @@ #include "virlog.h" #include "viralloc.h" #include "viruuid.h" -#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/driver.c b/src/driver.c index 0a5fe0547b..c35fcd2de2 100644 --- a/src/driver.c +++ b/src/driver.c @@ -27,8 +27,8 @@ #include "driver.h" #include "viralloc.h" #include "virlog.h" -#include "virutil.h" #include "configmake.h" +#include "virstring.h" #define DEFAULT_DRIVER_DIR LIBDIR "/libvirt/connection-driver" diff --git a/src/esx/esx_device_monitor.c b/src/esx/esx_device_monitor.c index 0f3421c8a6..7dc0618cd2 100644 --- a/src/esx/esx_device_monitor.c +++ b/src/esx/esx_device_monitor.c @@ -25,7 +25,6 @@ #include #include "internal.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 50ff723826..dcf64b85c6 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -28,7 +28,6 @@ #include "domain_conf.h" #include "snapshot_conf.h" #include "virauth.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" @@ -46,6 +45,7 @@ #include "esx_vi_methods.h" #include "esx_util.h" #include "viruri.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_ESX diff --git a/src/esx/esx_interface_driver.c b/src/esx/esx_interface_driver.c index 44055a1bd1..fe5194c36a 100644 --- a/src/esx/esx_interface_driver.c +++ b/src/esx/esx_interface_driver.c @@ -25,7 +25,6 @@ #include #include "internal.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/esx/esx_network_driver.c b/src/esx/esx_network_driver.c index c5be2083cc..fd57b611c0 100644 --- a/src/esx/esx_network_driver.c +++ b/src/esx/esx_network_driver.c @@ -26,7 +26,6 @@ #include "md5.h" #include "internal.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/esx/esx_nwfilter_driver.c b/src/esx/esx_nwfilter_driver.c index 03b74174db..3b932de1c4 100644 --- a/src/esx/esx_nwfilter_driver.c +++ b/src/esx/esx_nwfilter_driver.c @@ -25,7 +25,6 @@ #include #include "internal.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/esx/esx_secret_driver.c b/src/esx/esx_secret_driver.c index 2e36e15e79..5607a2efb3 100644 --- a/src/esx/esx_secret_driver.c +++ b/src/esx/esx_secret_driver.c @@ -24,7 +24,6 @@ #include #include "internal.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/esx/esx_storage_backend_iscsi.c b/src/esx/esx_storage_backend_iscsi.c index a3336a24c0..941e8002ac 100644 --- a/src/esx/esx_storage_backend_iscsi.c +++ b/src/esx/esx_storage_backend_iscsi.c @@ -28,7 +28,6 @@ #include "internal.h" #include "md5.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/esx/esx_storage_backend_vmfs.c b/src/esx/esx_storage_backend_vmfs.c index 329022e8c7..dea6716453 100644 --- a/src/esx/esx_storage_backend_vmfs.c +++ b/src/esx/esx_storage_backend_vmfs.c @@ -31,7 +31,6 @@ #include "internal.h" #include "md5.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" @@ -42,6 +41,7 @@ #include "esx_vi.h" #include "esx_vi_methods.h" #include "esx_util.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_ESX diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c index 4d2019b34d..4566fec90e 100644 --- a/src/esx/esx_util.c +++ b/src/esx/esx_util.c @@ -28,13 +28,13 @@ #include "internal.h" #include "datatypes.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" #include "vmx.h" #include "esx_private.h" #include "esx_util.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_ESX diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index d84ce19075..ee48159f0e 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -29,13 +29,13 @@ #include "virbuffer.h" #include "viralloc.h" #include "virlog.h" -#include "virutil.h" #include "viruuid.h" #include "vmx.h" #include "virxml.h" #include "esx_vi.h" #include "esx_vi_methods.h" #include "esx_util.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_ESX diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c index d1f91ffa2f..7f4030818a 100644 --- a/src/esx/esx_vi_types.c +++ b/src/esx/esx_vi_types.c @@ -31,9 +31,9 @@ #include "datatypes.h" #include "viralloc.h" #include "virlog.h" -#include "virutil.h" #include "esx_vi.h" #include "esx_vi_types.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_ESX diff --git a/src/fdstream.c b/src/fdstream.c index 53dde97ccb..6f8ce530af 100644 --- a/src/fdstream.c +++ b/src/fdstream.c @@ -40,6 +40,7 @@ #include "virutil.h" #include "virfile.h" #include "configmake.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_STREAMS diff --git a/src/hyperv/hyperv_device_monitor.c b/src/hyperv/hyperv_device_monitor.c index c362a1239f..83ea72a303 100644 --- a/src/hyperv/hyperv_device_monitor.c +++ b/src/hyperv/hyperv_device_monitor.c @@ -26,7 +26,6 @@ #include "internal.h" #include "virerror.h" #include "datatypes.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 3b381de020..7031fdbb61 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -27,7 +27,6 @@ #include "datatypes.h" #include "domain_conf.h" #include "virauth.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" @@ -42,6 +41,7 @@ #include "hyperv_util.h" #include "hyperv_wmi.h" #include "openwsman.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_HYPERV diff --git a/src/hyperv/hyperv_interface_driver.c b/src/hyperv/hyperv_interface_driver.c index 477b661241..62123a4f36 100644 --- a/src/hyperv/hyperv_interface_driver.c +++ b/src/hyperv/hyperv_interface_driver.c @@ -26,7 +26,6 @@ #include "internal.h" #include "virerror.h" #include "datatypes.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/hyperv/hyperv_network_driver.c b/src/hyperv/hyperv_network_driver.c index 336d722ad0..e23f53a16c 100644 --- a/src/hyperv/hyperv_network_driver.c +++ b/src/hyperv/hyperv_network_driver.c @@ -26,7 +26,6 @@ #include "internal.h" #include "virerror.h" #include "datatypes.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/hyperv/hyperv_nwfilter_driver.c b/src/hyperv/hyperv_nwfilter_driver.c index e7489712b0..034323845b 100644 --- a/src/hyperv/hyperv_nwfilter_driver.c +++ b/src/hyperv/hyperv_nwfilter_driver.c @@ -26,7 +26,6 @@ #include "internal.h" #include "virerror.h" #include "datatypes.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/hyperv/hyperv_secret_driver.c b/src/hyperv/hyperv_secret_driver.c index 09d9b9e2f3..3f9f8f5188 100644 --- a/src/hyperv/hyperv_secret_driver.c +++ b/src/hyperv/hyperv_secret_driver.c @@ -26,7 +26,6 @@ #include "internal.h" #include "virerror.h" #include "datatypes.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/hyperv/hyperv_storage_driver.c b/src/hyperv/hyperv_storage_driver.c index b701dc60a1..5acc4d8fe8 100644 --- a/src/hyperv/hyperv_storage_driver.c +++ b/src/hyperv/hyperv_storage_driver.c @@ -26,7 +26,6 @@ #include "internal.h" #include "virerror.h" #include "datatypes.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/hyperv/hyperv_util.c b/src/hyperv/hyperv_util.c index 9bc5b814cb..a55b9397a0 100644 --- a/src/hyperv/hyperv_util.c +++ b/src/hyperv/hyperv_util.c @@ -24,7 +24,6 @@ #include "internal.h" #include "datatypes.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "viruuid.h" diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 33ba21f58d..65fc83dcfe 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -29,11 +29,11 @@ #include "datatypes.h" #include "virlog.h" #include "viralloc.h" -#include "virutil.h" #include "viruuid.h" #include "virbuffer.h" #include "hyperv_private.h" #include "hyperv_wmi.h" +#include "virstring.h" #define WS_SERIALIZER_FREE_MEM_WORKS 0 diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c index 79c57eef6f..7daad16b8e 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -30,6 +30,7 @@ #include "interface_driver.h" #include "interface_conf.h" #include "viralloc.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_INTERFACE diff --git a/src/libvirt.c b/src/libvirt.c index 2daa0b4ee0..15b37a3c9f 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -62,6 +62,7 @@ #include "virrandom.h" #include "viruri.h" #include "virthread.h" +#include "virstring.h" #ifdef WITH_TEST # include "test/test_driver.h" diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index a7e1eeb65d..98660dc2b3 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1745,10 +1745,26 @@ virStorageFileResize; # util/virstring.h +virArgvToString; +virAsprintf; +virSkipSpaces; +virSkipSpacesAndBackslash; +virSkipSpacesBackwards; +virStrcpy; virStringArrayHasString; virStringFreeList; virStringJoin; virStringSplit; +virStrncpy; +virStrToDouble; +virStrToLong_i; +virStrToLong_l; +virStrToLong_ll; +virStrToLong_ui; +virStrToLong_ul; +virStrToLong_ull; +virTrimSpaces; +virVasprintf; # util/virsysinfo.h @@ -1845,8 +1861,6 @@ virUSBDeviceSetUsedBy; saferead; safewrite; safezero; -virArgvToString; -virAsprintf; virBuildPathInternal; virCompareLimitUlong; virDirCreate; @@ -1914,22 +1928,8 @@ virSetInherit; virSetNonBlock; virSetUIDGID; virSetUIDGIDWithCaps; -virSkipSpaces; -virSkipSpacesAndBackslash; -virSkipSpacesBackwards; -virStrcpy; virStrIsPrint; -virStrncpy; -virStrToDouble; -virStrToLong_i; -virStrToLong_l; -virStrToLong_ll; -virStrToLong_ui; -virStrToLong_ul; -virStrToLong_ull; -virTrimSpaces; virValidateWWN; -virVasprintf; # util/viruuid.h diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 212d0fcdfd..736174320d 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -44,6 +44,7 @@ #include "xen_xm.h" #include "virtypedparam.h" #include "viruri.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_LIBXL diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 97e5d749c2..0d8ef399ff 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -45,6 +45,7 @@ #include "virrandom.h" #include "virhash.h" #include "viruuid.h" +#include "virstring.h" #include "locking/lock_daemon_dispatch.h" #include "locking/lock_protocol.h" diff --git a/src/locking/lock_daemon_config.c b/src/locking/lock_daemon_config.c index 12b06e27e2..c3d59bd236 100644 --- a/src/locking/lock_daemon_config.c +++ b/src/locking/lock_daemon_config.c @@ -30,6 +30,8 @@ #include "virlog.h" #include "rpc/virnetserver.h" #include "configmake.h" +#include "virstring.h" +#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_CONF diff --git a/src/locking/lock_daemon_dispatch.c b/src/locking/lock_daemon_dispatch.c index 4c99088265..8a92802b3a 100644 --- a/src/locking/lock_daemon_dispatch.c +++ b/src/locking/lock_daemon_dispatch.c @@ -24,7 +24,6 @@ #include "rpc/virnetserver.h" #include "rpc/virnetserverclient.h" -#include "virutil.h" #include "virlog.h" #include "lock_daemon.h" diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lockd.c index 4b72a05ab2..28a4f15c39 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -26,13 +26,13 @@ #include "viralloc.h" #include "virlog.h" #include "viruuid.h" -#include "virutil.h" #include "virfile.h" #include "virerror.h" #include "rpc/virnetclient.h" #include "lock_protocol.h" #include "configmake.h" #include "sha256.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_LOCKING diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c index 95f7d61827..48c6d56948 100644 --- a/src/locking/lock_driver_sanlock.c +++ b/src/locking/lock_driver_sanlock.c @@ -40,7 +40,6 @@ #include "virlog.h" #include "virerror.h" #include "viralloc.h" -#include "virutil.h" #include "virfile.h" #include "md5.h" #include "virconf.h" diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c index ae60caf1c0..82bbe6b7d0 100644 --- a/src/locking/lock_manager.c +++ b/src/locking/lock_manager.c @@ -25,9 +25,9 @@ #include "lock_driver_nop.h" #include "virerror.h" #include "virlog.h" -#include "virutil.h" #include "viralloc.h" #include "viruuid.h" +#include "virstring.h" #if HAVE_DLFCN_H # include diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index 4a661da445..bc3b0d1065 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -28,6 +28,7 @@ #include "virlog.h" #include "viralloc.h" #include "vircgroup.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_LXC diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index ac0f69c794..ff4069a320 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -55,7 +55,6 @@ #include "virerror.h" #include "virlog.h" #include "lxc_container.h" -#include "virutil.h" #include "viralloc.h" #include "virnetdevveth.h" #include "viruuid.h" @@ -64,6 +63,7 @@ #include "vircommand.h" #include "virnetdev.h" #include "virprocess.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_LXC diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 740b87256e..f1800eb417 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -48,7 +48,6 @@ #include "virerror.h" #include "virlog.h" -#include "virutil.h" #include "lxc_conf.h" #include "lxc_container.h" @@ -66,6 +65,7 @@ #include "virprocess.h" #include "virnuma.h" #include "rpc/virnetserver.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_LXC diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 0becdc7862..84a97de4fd 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -46,7 +46,6 @@ #include "lxc_driver.h" #include "lxc_process.h" #include "viralloc.h" -#include "virutil.h" #include "virnetdevbridge.h" #include "virnetdevveth.h" #include "nodeinfo.h" @@ -68,6 +67,7 @@ #include "virtime.h" #include "virtypedparam.h" #include "viruri.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_LXC diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index fbd0d56c95..b6df99cb91 100644 --- a/src/lxc/lxc_fuse.c +++ b/src/lxc/lxc_fuse.c @@ -35,6 +35,7 @@ #include "virlog.h" #include "virfile.h" #include "virbuffer.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_LXC diff --git a/src/lxc/lxc_fuse.h b/src/lxc/lxc_fuse.h index ccc9b9248e..a42c39a15b 100644 --- a/src/lxc/lxc_fuse.h +++ b/src/lxc/lxc_fuse.h @@ -32,7 +32,6 @@ # endif # include "lxc_conf.h" -# include "virutil.h" # include "viralloc.h" struct virLXCMeminfo { diff --git a/src/lxc/lxc_monitor.c b/src/lxc/lxc_monitor.c index 6d11edacbf..a205d6962f 100644 --- a/src/lxc/lxc_monitor.c +++ b/src/lxc/lxc_monitor.c @@ -30,6 +30,7 @@ #include "virlog.h" #include "virthread.h" #include "rpc/virnetclient.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_LXC diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index ab07a1e514..b10e81c4d9 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -47,6 +47,7 @@ #include "vircommand.h" #include "lxc_hostdev.h" #include "virhook.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_LXC diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 8da28e45d0..35202f1781 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -51,7 +51,6 @@ #include "driver.h" #include "virbuffer.h" #include "virpidfile.h" -#include "virutil.h" #include "vircommand.h" #include "viralloc.h" #include "viruuid.h" @@ -66,6 +65,7 @@ #include "virnetdevvportprofile.h" #include "virdbus.h" #include "virfile.h" +#include "virstring.h" #define NETWORK_PID_DIR LOCALSTATEDIR "/run/libvirt/network" #define NETWORK_STATE_DIR LOCALSTATEDIR "/lib/libvirt/network" diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index c9bd68b65c..95df2e5a7f 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -36,7 +36,6 @@ #include "node_device_conf.h" #include "node_device_hal.h" #include "node_device_driver.h" -#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_NODEDEV diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c index fd91430620..71c717269e 100644 --- a/src/node_device/node_device_linux_sysfs.c +++ b/src/node_device/node_device_linux_sysfs.c @@ -32,6 +32,7 @@ #include "viralloc.h" #include "virlog.h" #include "virfile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NODEDEV diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index f98841e96f..c3c97d7c8a 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -36,9 +36,9 @@ #include "virlog.h" #include "viralloc.h" #include "viruuid.h" -#include "virutil.h" #include "virbuffer.h" #include "virpci.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NODEDEV diff --git a/src/nodeinfo.c b/src/nodeinfo.c index a5b5608ed3..95c2f33926 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -47,7 +47,6 @@ #include "viralloc.h" #include "nodeinfo.h" #include "physmem.h" -#include "virutil.h" #include "virlog.h" #include "virerror.h" #include "count-one-bits.h" @@ -55,7 +54,7 @@ #include "virarch.h" #include "virfile.h" #include "virtypedparam.h" - +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c index 5012b14d17..df11e89134 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -68,6 +68,7 @@ #include "virthreadpool.h" #include "configmake.h" #include "virtime.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NWFILTER diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 789280785b..7eec3de40b 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -41,6 +41,7 @@ #include "nwfilter_driver.h" #include "nwfilter_gentech_driver.h" #include "configmake.h" +#include "virstring.h" #include "nwfilter_ipaddrmap.h" #include "nwfilter_dhcpsnoop.h" diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index 0e39574edb..ac943555ea 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -43,7 +43,7 @@ #include "vircommand.h" #include "configmake.h" #include "intprops.h" - +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NWFILTER diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c index b399092ef0..14fd32cfc6 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -54,6 +54,7 @@ #include "nwfilter_ebiptables_driver.h" #include "nwfilter_ipaddrmap.h" #include "nwfilter_learnipaddr.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NWFILTER diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index a6f96c717f..49fae2894c 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -47,10 +47,10 @@ #include "viruuid.h" #include "virbuffer.h" #include "viralloc.h" -#include "virutil.h" #include "nodeinfo.h" #include "virfile.h" #include "vircommand.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_OPENVZ diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index f8bec6239c..e6d71466ad 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -48,7 +48,6 @@ #include "openvz_driver.h" #include "openvz_util.h" #include "virbuffer.h" -#include "virutil.h" #include "openvz_conf.h" #include "nodeinfo.h" #include "viralloc.h" @@ -58,6 +57,7 @@ #include "vircommand.h" #include "viruri.h" #include "virstatslinux.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_OPENVZ diff --git a/src/parallels/parallels_driver.c b/src/parallels/parallels_driver.c index e1269672bd..c29a5ba24d 100644 --- a/src/parallels/parallels_driver.c +++ b/src/parallels/parallels_driver.c @@ -42,13 +42,13 @@ #include "datatypes.h" #include "virerror.h" #include "viralloc.h" -#include "virutil.h" #include "virlog.h" #include "vircommand.h" #include "configmake.h" #include "virstoragefile.h" #include "nodeinfo.h" #include "c-ctype.h" +#include "virstring.h" #include "parallels_driver.h" #include "parallels_utils.h" diff --git a/src/parallels/parallels_network.c b/src/parallels/parallels_network.c index 7a9436f860..23109d3843 100644 --- a/src/parallels/parallels_network.c +++ b/src/parallels/parallels_network.c @@ -28,8 +28,8 @@ #include "viralloc.h" #include "virerror.h" #include "md5.h" - #include "parallels_utils.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_PARALLELS #define PARALLELS_ROUTED_NETWORK_UUID "eb593dd1-6846-45b0-84a0-de0729286982" diff --git a/src/parallels/parallels_storage.c b/src/parallels/parallels_storage.c index 271f3709dc..4c98e4389d 100644 --- a/src/parallels/parallels_storage.c +++ b/src/parallels/parallels_storage.c @@ -36,8 +36,8 @@ #include "configmake.h" #include "virstoragefile.h" #include "virerror.h" - #include "parallels_utils.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_PARALLELS diff --git a/src/parallels/parallels_utils.c b/src/parallels/parallels_utils.c index 0b589abd23..4236ed5073 100644 --- a/src/parallels/parallels_utils.c +++ b/src/parallels/parallels_utils.c @@ -28,8 +28,8 @@ #include "virerror.h" #include "viralloc.h" #include "virjson.h" - #include "parallels_utils.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_PARALLELS diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index f5c66ba56a..85eb650645 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -43,7 +43,6 @@ #include "internal.h" #include "virauth.h" -#include "virutil.h" #include "datatypes.h" #include "virbuffer.h" #include "viralloc.h" @@ -56,8 +55,8 @@ #include "nodeinfo.h" #include "virfile.h" #include "interface_conf.h" - #include "phyp_driver.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_PHYP diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 8c8c38bab0..d116b2394f 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -41,6 +41,7 @@ #include "virprocess.h" #include "virtime.h" #include "virobject.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_QEMU diff --git a/src/qemu/qemu_bridge_filter.c b/src/qemu/qemu_bridge_filter.c index 3bc1141a4d..ab4db9a0ad 100644 --- a/src/qemu/qemu_bridge_filter.c +++ b/src/qemu/qemu_bridge_filter.c @@ -25,7 +25,6 @@ #include "virebtables.h" #include "qemu_conf.h" #include "qemu_driver.h" -#include "virutil.h" #include "virerror.h" #include "virlog.h" diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2acf535e2c..a3a8d1feed 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -27,7 +27,6 @@ #include "viralloc.h" #include "virlog.h" #include "virerror.h" -#include "virutil.h" #include "virfile.h" #include "virpidfile.h" #include "virprocess.h" diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 7a7824d83f..4819cfe99b 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -30,7 +30,6 @@ #include "virlog.h" #include "viralloc.h" #include "virerror.h" -#include "virutil.h" #include "domain_audit.h" #define VIR_FROM_THIS VIR_FROM_QEMU diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7d851e3786..575dce1376 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -33,7 +33,6 @@ #include "virlog.h" #include "virarch.h" #include "virerror.h" -#include "virutil.h" #include "virfile.h" #include "virnetdev.h" #include "virstring.h" diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 7c3f317cf0..c16b90d3fe 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -42,7 +42,6 @@ #include "viruuid.h" #include "virbuffer.h" #include "virconf.h" -#include "virutil.h" #include "viralloc.h" #include "datatypes.h" #include "virxml.h" diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 1ea2bcd76e..47edfba9e5 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -37,6 +37,7 @@ #include "domain_event.h" #include "virtime.h" #include "virstoragefile.h" +#include "virstring.h" #include #include diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 94928508f0..d5d7de3906 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -61,7 +61,6 @@ #include "virlog.h" #include "datatypes.h" #include "virbuffer.h" -#include "virutil.h" #include "nodeinfo.h" #include "virstatslinux.h" #include "capabilities.h" @@ -92,6 +91,7 @@ #include "virtime.h" #include "virtypedparam.h" #include "virbitmap.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_QEMU diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 0d1ca45016..a4f48b0338 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -47,6 +47,7 @@ #include "virnetdevtap.h" #include "device_conf.h" #include "virstoragefile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_QEMU #define CHANGE_MEDIA_RETRIES 10 diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 6ad1c307f3..0732614f76 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -44,7 +44,6 @@ #include "virlog.h" #include "virerror.h" #include "viralloc.h" -#include "virutil.h" #include "virfile.h" #include "datatypes.h" #include "fdstream.h" @@ -55,7 +54,7 @@ #include "virstoragefile.h" #include "viruri.h" #include "virhook.h" - +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_QEMU diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 1b1d4a18d8..4deb2d60ac 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -37,6 +37,7 @@ #include "virfile.h" #include "virprocess.h" #include "virobject.h" +#include "virstring.h" #ifdef WITH_DTRACE_PROBES # include "libvirt_qemu_probes.h" diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index daade3d554..696961bdab 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -40,6 +40,7 @@ #include "datatypes.h" #include "virerror.h" #include "virbuffer.h" +#include "virstring.h" #ifdef WITH_DTRACE_PROBES # include "libvirt_qemu_probes.h" diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 58f64b7310..3dd178c19c 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -50,7 +50,6 @@ #include "virhook.h" #include "virfile.h" #include "virpidfile.h" -#include "virutil.h" #include "c-ctype.h" #include "nodeinfo.h" #include "domain_audit.h" @@ -64,6 +63,7 @@ #include "virbitmap.h" #include "viratomic.h" #include "virnuma.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_QEMU diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index f66304c3f9..13212d08b0 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -40,7 +40,6 @@ #include "lxc_protocol.h" #include "qemu_protocol.h" #include "viralloc.h" -#include "virutil.h" #include "virfile.h" #include "vircommand.h" #include "intprops.h" @@ -48,6 +47,7 @@ #include "viruri.h" #include "virauth.h" #include "virauthconfig.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_REMOTE diff --git a/src/rpc/virkeepalive.c b/src/rpc/virkeepalive.c index d49082ca96..8ae5c6c24e 100644 --- a/src/rpc/virkeepalive.c +++ b/src/rpc/virkeepalive.c @@ -26,7 +26,6 @@ #include "virthread.h" #include "virfile.h" #include "virlog.h" -#include "virutil.h" #include "virerror.h" #include "virnetsocket.h" #include "virkeepaliveprotocol.h" diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index 58fb0b4918..2bde5c74e5 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -34,6 +34,8 @@ #include "viralloc.h" #include "virthread.h" #include "virkeepalive.h" +#include "virstring.h" +#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_RPC diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index c4fd9ee981..e950d7fd77 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -52,7 +52,7 @@ #include "virfile.h" #include "virthread.h" #include "virprocess.h" - +#include "virstring.h" #include "passfd.h" #if WITH_SSH2 diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c index 9ce99f85cd..27750fc66b 100644 --- a/src/rpc/virnetsshsession.c +++ b/src/rpc/virnetsshsession.c @@ -34,6 +34,7 @@ #include "virutil.h" #include "virerror.h" #include "virobject.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_SSH diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c index eed0439c32..7f5975dcff 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -29,6 +29,7 @@ #include "gnutls_1_0_compat.h" #include "virnettlscontext.h" +#include "virstring.h" #include "viralloc.h" #include "virerror.h" diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 646c8ffc93..377b9f4c45 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -37,11 +37,11 @@ #include "secret_conf.h" #include "secret_driver.h" #include "virthread.h" -#include "virutil.h" #include "viruuid.h" #include "virerror.h" #include "virfile.h" #include "configmake.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_SECRET diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c index 5be5ff02d9..5fb5db318d 100644 --- a/src/security/security_apparmor.c +++ b/src/security/security_apparmor.c @@ -38,7 +38,6 @@ #include "internal.h" #include "security_apparmor.h" -#include "virutil.h" #include "viralloc.h" #include "virerror.h" #include "datatypes.h" @@ -49,6 +48,7 @@ #include "configmake.h" #include "vircommand.h" #include "virlog.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_SECURITY #define SECURITY_APPARMOR_VOID_DOI "0" diff --git a/src/security/security_dac.c b/src/security/security_dac.c index e197eff42e..cd214d8860 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -25,12 +25,12 @@ #include "security_dac.h" #include "virerror.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "virpci.h" #include "virusb.h" #include "virstoragefile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_SECURITY #define SECURITY_DAC_NAME "dac" diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index 0cf4009358..a85f0a3c94 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -34,7 +34,6 @@ #include "security_driver.h" #include "security_selinux.h" #include "virerror.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "virpci.h" @@ -45,6 +44,7 @@ #include "virrandom.h" #include "virconf.h" #include "virtpm.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_SECURITY diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 3c9515f19f..b52691992f 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -41,7 +41,6 @@ #include "internal.h" #include "virbuffer.h" -#include "virutil.h" #include "viralloc.h" #include "vircommand.h" @@ -55,6 +54,7 @@ #include "virfile.h" #include "configmake.h" #include "virrandom.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_SECURITY diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index d4aabb6bca..b85a5a9aa8 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -45,7 +45,6 @@ #include "datatypes.h" #include "virerror.h" -#include "virutil.h" #include "viralloc.h" #include "internal.h" #include "secret_conf.h" @@ -55,6 +54,7 @@ #include "virlog.h" #include "virfile.h" #include "stat-time.h" +#include "virstring.h" #if WITH_STORAGE_LVM # include "storage_backend_logical.h" diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c index 1faf1aed36..6da2d12474 100644 --- a/src/storage/storage_backend_disk.c +++ b/src/storage/storage_backend_disk.c @@ -30,10 +30,10 @@ #include "virerror.h" #include "virlog.h" #include "storage_backend_disk.h" -#include "virutil.h" #include "viralloc.h" #include "vircommand.h" #include "configmake.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index c1684f77cb..8288b1e7c8 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -50,6 +50,7 @@ #include "virxml.h" #include "virfile.h" #include "virlog.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c index f6b76ed496..cf259193a6 100644 --- a/src/storage/storage_backend_iscsi.c +++ b/src/storage/storage_backend_iscsi.c @@ -38,12 +38,12 @@ #include "virerror.h" #include "storage_backend_scsi.h" #include "storage_backend_iscsi.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "virfile.h" #include "vircommand.h" #include "virrandom.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c index 4cf664775e..316043fe72 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -38,6 +38,7 @@ #include "viralloc.h" #include "virlog.h" #include "virfile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c index 60490634f8..6e742f77cd 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -35,6 +35,7 @@ #include "viralloc.h" #include "virlog.h" #include "virfile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index e815192c22..ca23d4b0fb 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -26,7 +26,6 @@ #include "virerror.h" #include "storage_backend_rbd.h" #include "storage_conf.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "base64.h" diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c index 987d218509..154a56aa8e 100644 --- a/src/storage/storage_backend_scsi.c +++ b/src/storage/storage_backend_scsi.c @@ -34,6 +34,7 @@ #include "virlog.h" #include "virfile.h" #include "vircommand.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c index 15fa29c7e2..dfa5673257 100644 --- a/src/storage/storage_backend_sheepdog.c +++ b/src/storage/storage_backend_sheepdog.c @@ -30,7 +30,6 @@ #include "storage_backend_sheepdog.h" #include "storage_conf.h" #include "vircommand.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index f190eb7b7e..990f0b178b 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -39,7 +39,6 @@ #include "virerror.h" #include "datatypes.h" #include "driver.h" -#include "virutil.h" #include "storage_driver.h" #include "storage_conf.h" #include "viralloc.h" @@ -48,6 +47,7 @@ #include "virfile.h" #include "fdstream.h" #include "configmake.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/test/test_driver.c b/src/test/test_driver.c index d964fb2e6f..f60f106bb8 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -36,7 +36,6 @@ #include "datatypes.h" #include "test_driver.h" #include "virbuffer.h" -#include "virutil.h" #include "viruuid.h" #include "capabilities.h" #include "configmake.h" @@ -54,6 +53,7 @@ #include "virfile.h" #include "virtypedparam.h" #include "virrandom.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_TEST diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c index 4fa79271fa..a55b5b1f10 100644 --- a/src/uml/uml_conf.c +++ b/src/uml/uml_conf.c @@ -38,7 +38,6 @@ #include "viruuid.h" #include "virbuffer.h" #include "virconf.h" -#include "virutil.h" #include "viralloc.h" #include "nodeinfo.h" #include "virlog.h" @@ -47,7 +46,7 @@ #include "vircommand.h" #include "virnetdevtap.h" #include "virnodesuspend.h" - +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_UML diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 9b0aba6f09..66c00b2beb 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -46,7 +46,6 @@ #include "uml_driver.h" #include "uml_conf.h" #include "virbuffer.h" -#include "virutil.h" #include "nodeinfo.h" #include "virstatslinux.h" #include "capabilities.h" @@ -65,6 +64,7 @@ #include "virnodesuspend.h" #include "virprocess.h" #include "viruri.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_UML diff --git a/src/util/iohelper.c b/src/util/iohelper.c index 2230bcbbd4..33ba85240a 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -40,6 +40,7 @@ #include "virerror.h" #include "configmake.h" #include "virrandom.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/util/viraudit.c b/src/util/viraudit.c index 0f4bb4f4a8..5dd4e1fc74 100644 --- a/src/util/viraudit.c +++ b/src/util/viraudit.c @@ -30,9 +30,9 @@ #include "virerror.h" #include "virlog.h" #include "viraudit.h" -#include "virutil.h" #include "virfile.h" #include "viralloc.h" +#include "virstring.h" /* Provide the macros in case the header file is old. FIXME: should be removed. */ diff --git a/src/util/virauth.c b/src/util/virauth.c index c26e340ddd..fdcefe1a06 100644 --- a/src/util/virauth.c +++ b/src/util/virauth.c @@ -32,6 +32,7 @@ #include "virerror.h" #include "configmake.h" #include "virauthconfig.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_AUTH diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c index 1d1f084ae2..4259cb3bad 100644 --- a/src/util/virauthconfig.c +++ b/src/util/virauthconfig.c @@ -26,10 +26,9 @@ #include "virkeyfile.h" #include "viralloc.h" -#include "virutil.h" #include "virlog.h" #include "virerror.h" - +#include "virstring.h" struct _virAuthConfig { virKeyFilePtr keyfile; diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index 998c302567..c81555acda 100644 --- a/src/util/virbitmap.c +++ b/src/util/virbitmap.c @@ -33,10 +33,9 @@ #include "virbitmap.h" #include "viralloc.h" #include "virbuffer.h" -#include "virutil.h" #include "c-ctype.h" #include "count-one-bits.h" - +#include "virstring.h" struct _virBitmap { size_t max_bit; diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 98521ec9ec..f6f27d9e71 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -50,6 +50,7 @@ #include "virprocess.h" #include "virbuffer.h" #include "virthread.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/vircommand.h b/src/util/vircommand.h index 18568feb87..a4021392d1 100644 --- a/src/util/vircommand.h +++ b/src/util/vircommand.h @@ -23,7 +23,6 @@ # define __VIR_COMMAND_H__ # include "internal.h" -# include "virutil.h" # include "virbuffer.h" typedef struct _virCommand virCommand; diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index 2e63d83af2..4f0563317b 100644 --- a/src/util/virdnsmasq.c +++ b/src/util/virdnsmasq.c @@ -49,6 +49,7 @@ #include "virerror.h" #include "virlog.h" #include "virfile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NETWORK #define DNSMASQ_HOSTSFILE_SUFFIX "hostsfile" diff --git a/src/util/virebtables.c b/src/util/virebtables.c index 65c0ac33b4..6bc6fed3ca 100644 --- a/src/util/virebtables.c +++ b/src/util/virebtables.c @@ -48,6 +48,8 @@ #include "virerror.h" #include "virlog.h" #include "virthread.h" +#include "virstring.h" +#include "virutil.h" #if HAVE_FIREWALLD static char *firewall_cmd_path = NULL; diff --git a/src/util/virerror.c b/src/util/virerror.c index 8a329a9825..af4da8c8fb 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -33,6 +33,7 @@ #include "viralloc.h" #include "virthread.h" #include "virutil.h" +#include "virstring.h" virThreadLocal virLastErr; diff --git a/src/util/virfile.c b/src/util/virfile.c index fbaeeddbe8..25a0501cdf 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -42,6 +42,7 @@ #include "viralloc.h" #include "virerror.h" #include "virlog.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virhook.h b/src/util/virhook.h index a63a12536a..96bf4cf126 100644 --- a/src/util/virhook.h +++ b/src/util/virhook.h @@ -25,7 +25,6 @@ # define __VIR_HOOKS_H__ # include "internal.h" -# include "virutil.h" enum virHookDriverType { VIR_HOOK_DRIVER_DAEMON = 0, /* Daemon related events */ diff --git a/src/util/virinitctl.c b/src/util/virinitctl.c index d1e0fe6e51..59db0575a2 100644 --- a/src/util/virinitctl.c +++ b/src/util/virinitctl.c @@ -32,6 +32,7 @@ #include "virutil.h" #include "viralloc.h" #include "virfile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_INITCTL diff --git a/src/util/viriptables.c b/src/util/viriptables.c index 19d61610c8..06a1356cf2 100644 --- a/src/util/viriptables.c +++ b/src/util/viriptables.c @@ -46,6 +46,8 @@ #include "virerror.h" #include "virlog.h" #include "virthread.h" +#include "virstring.h" +#include "virutil.h" #if HAVE_FIREWALLD static char *firewall_cmd_path = NULL; diff --git a/src/util/virjson.c b/src/util/virjson.c index e6a3b1b61e..92138d3673 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -27,6 +27,7 @@ #include "viralloc.h" #include "virerror.h" #include "virlog.h" +#include "virstring.h" #include "virutil.h" #if WITH_YAJL diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c index 4ff0f3a329..620a460ee2 100644 --- a/src/util/virlockspace.c +++ b/src/util/virlockspace.c @@ -29,6 +29,7 @@ #include "virfile.h" #include "virhash.h" #include "virthread.h" +#include "virstring.h" #include #include diff --git a/src/util/virlog.c b/src/util/virlog.c index e31abb091c..bd47b38e2c 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -50,6 +50,7 @@ #include "virfile.h" #include "virtime.h" #include "intprops.h" +#include "virstring.h" /* Journald output is only supported on Linux new enough to expose * htole64. */ diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 8013f23346..d987b8eb21 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -30,6 +30,8 @@ #include "viralloc.h" #include "virpci.h" #include "virlog.h" +#include "virstring.h" +#include "virutil.h" #include #include diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c index 2c5b63a0d2..ccc1449d76 100644 --- a/src/util/virnetdevbandwidth.c +++ b/src/util/virnetdevbandwidth.c @@ -26,6 +26,7 @@ #include "vircommand.h" #include "viralloc.h" #include "virerror.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index 9d46cc4a3f..130829cede 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -28,6 +28,7 @@ #include "virfile.h" #include "viralloc.h" #include "intprops.h" +#include "virstring.h" #include #include diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index e76e94c5d5..0c4fcbdd79 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -29,7 +29,6 @@ #include "virnetdevmacvlan.h" #include "virmacaddr.h" -#include "virutil.h" #include "virerror.h" #include "virthread.h" diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c index 4fe077aa34..2aee445a58 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -28,6 +28,7 @@ #include "viralloc.h" #include "virerror.h" #include "virmacaddr.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitch.h index 3216ea01e3..0852e4d870 100644 --- a/src/util/virnetdevopenvswitch.h +++ b/src/util/virnetdevopenvswitch.h @@ -25,7 +25,6 @@ # define __VIR_NETDEV_OPENVSWITCH_H__ # include "internal.h" -# include "virutil.h" # include "virnetdevvportprofile.h" # include "virnetdevvlan.h" diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 7d77f819fd..75599db807 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -31,7 +31,7 @@ #include "virfile.h" #include "viralloc.h" #include "virlog.h" -#include "virutil.h" +#include "virstring.h" #include #include diff --git a/src/util/virnetdevveth.c b/src/util/virnetdevveth.c index 3f81655e40..5daf21ef7b 100644 --- a/src/util/virnetdevveth.c +++ b/src/util/virnetdevveth.c @@ -30,6 +30,8 @@ #include "virlog.h" #include "vircommand.h" #include "virerror.h" +#include "virstring.h" +#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c index 13ccbab1c8..883aa46b3c 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -25,6 +25,7 @@ #include "virnetdevvportprofile.h" #include "virerror.h" #include "viralloc.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NET diff --git a/src/util/virpci.c b/src/util/virpci.c index ba60292f15..5865613986 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -42,6 +42,8 @@ #include "vircommand.h" #include "virerror.h" #include "virfile.h" +#include "virstring.h" +#include "virutil.h" #define PCI_SYSFS "/sys/bus/pci/" #define PCI_ID_LEN 10 /* "XXXX XXXX" */ diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index 14c9f9f08f..298d57c94c 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -36,6 +36,7 @@ #include "virerror.h" #include "c-ctype.h" #include "areadlink.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virprocess.c b/src/util/virprocess.c index fb818059f8..73f512313f 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -39,6 +39,7 @@ #include "virfile.h" #include "virlog.h" #include "virutil.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virrandom.c b/src/util/virrandom.c index 6c5bc9162e..f46d7023e5 100644 --- a/src/util/virrandom.c +++ b/src/util/virrandom.c @@ -32,6 +32,7 @@ #include "virutil.h" #include "virerror.h" #include "virlog.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/virsexpr.c b/src/util/virsexpr.c index 81dfbe61e3..23b6781135 100644 --- a/src/util/virsexpr.c +++ b/src/util/virsexpr.c @@ -30,8 +30,8 @@ #include "virerror.h" #include "virsexpr.h" -#include "virutil.h" #include "viralloc.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_SEXPR diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c index 7ee450bb9e..d6a0d934f9 100644 --- a/src/util/virsocketaddr.c +++ b/src/util/virsocketaddr.c @@ -25,7 +25,7 @@ #include "virsocketaddr.h" #include "virerror.h" -#include "virutil.h" +#include "virstring.h" #include diff --git a/src/util/virstatslinux.c b/src/util/virstatslinux.c index d3e1a0262b..60b72dc0e8 100644 --- a/src/util/virstatslinux.c +++ b/src/util/virstatslinux.c @@ -34,7 +34,6 @@ # include "virerror.h" # include "datatypes.h" -# include "virutil.h" # include "virstatslinux.h" # include "viralloc.h" # include "virfile.h" diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index aabb5c8e2a..c7bb85a86d 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -43,6 +43,8 @@ #include "vircommand.h" #include "virhash.h" #include "virendian.h" +#include "virstring.h" +#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/util/virstring.c b/src/util/virstring.c index 122ebb8f0f..9b4cb0141b 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -21,6 +21,10 @@ #include +#include +#include + +#include "c-ctype.h" #include "virstring.h" #include "viralloc.h" #include "virbuffer.h" @@ -180,3 +184,334 @@ virStringArrayHasString(char **strings, const char *needle) return false; } + +/* Like strtol, but produce an "int" result, and check more carefully. + Return 0 upon success; return -1 to indicate failure. + When END_PTR is NULL, the byte after the final valid digit must be NUL. + Otherwise, it's like strtol and lets the caller check any suffix for + validity. This function is careful to return -1 when the string S + represents a number that is not representable as an "int". */ +int +virStrToLong_i(char const *s, char **end_ptr, int base, int *result) +{ + long int val; + char *p; + int err; + + errno = 0; + val = strtol(s, &p, base); /* exempt from syntax-check */ + err = (errno || (!end_ptr && *p) || p == s || (int) val != val); + if (end_ptr) + *end_ptr = p; + if (err) + return -1; + *result = val; + return 0; +} + +/* Just like virStrToLong_i, above, but produce an "unsigned int" value. */ +int +virStrToLong_ui(char const *s, char **end_ptr, int base, unsigned int *result) +{ + unsigned long int val; + char *p; + int err; + + errno = 0; + val = strtoul(s, &p, base); /* exempt from syntax-check */ + err = (errno || (!end_ptr && *p) || p == s || (unsigned int) val != val); + if (end_ptr) + *end_ptr = p; + if (err) + return -1; + *result = val; + return 0; +} + +/* Just like virStrToLong_i, above, but produce a "long" value. */ +int +virStrToLong_l(char const *s, char **end_ptr, int base, long *result) +{ + long int val; + char *p; + int err; + + errno = 0; + val = strtol(s, &p, base); /* exempt from syntax-check */ + err = (errno || (!end_ptr && *p) || p == s); + if (end_ptr) + *end_ptr = p; + if (err) + return -1; + *result = val; + return 0; +} + +/* Just like virStrToLong_i, above, but produce an "unsigned long" value. */ +int +virStrToLong_ul(char const *s, char **end_ptr, int base, unsigned long *result) +{ + unsigned long int val; + char *p; + int err; + + errno = 0; + val = strtoul(s, &p, base); /* exempt from syntax-check */ + err = (errno || (!end_ptr && *p) || p == s); + if (end_ptr) + *end_ptr = p; + if (err) + return -1; + *result = val; + return 0; +} + +/* Just like virStrToLong_i, above, but produce a "long long" value. */ +int +virStrToLong_ll(char const *s, char **end_ptr, int base, long long *result) +{ + long long val; + char *p; + int err; + + errno = 0; + val = strtoll(s, &p, base); /* exempt from syntax-check */ + err = (errno || (!end_ptr && *p) || p == s); + if (end_ptr) + *end_ptr = p; + if (err) + return -1; + *result = val; + return 0; +} + +/* Just like virStrToLong_i, above, but produce an "unsigned long long" value. */ +int +virStrToLong_ull(char const *s, char **end_ptr, int base, unsigned long long *result) +{ + unsigned long long val; + char *p; + int err; + + errno = 0; + val = strtoull(s, &p, base); /* exempt from syntax-check */ + err = (errno || (!end_ptr && *p) || p == s); + if (end_ptr) + *end_ptr = p; + if (err) + return -1; + *result = val; + return 0; +} + +int +virStrToDouble(char const *s, + char **end_ptr, + double *result) +{ + double val; + char *p; + int err; + + errno = 0; + val = strtod(s, &p); /* exempt from syntax-check */ + err = (errno || (!end_ptr && *p) || p == s); + if (end_ptr) + *end_ptr = p; + if (err) + return -1; + *result = val; + return 0; +} + +/** + * virVasprintf + * + * like glibc's vasprintf but makes sure *strp == NULL on failure + */ +int +virVasprintf(char **strp, const char *fmt, va_list list) +{ + int ret; + + if ((ret = vasprintf(strp, fmt, list)) == -1) + *strp = NULL; + + return ret; +} + +/** + * virAsprintf + * + * like glibc's_asprintf but makes sure *strp == NULL on failure + */ +int +virAsprintf(char **strp, const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret = virVasprintf(strp, fmt, ap); + va_end(ap); + return ret; +} + +/** + * virStrncpy + * + * A safe version of strncpy. The last parameter is the number of bytes + * available in the destination string, *not* the number of bytes you want + * to copy. If the destination is not large enough to hold all n of the + * src string bytes plus a \0, NULL is returned and no data is copied. + * If the destination is large enough to hold the n bytes plus \0, then the + * string is copied and a pointer to the destination string is returned. + */ +char * +virStrncpy(char *dest, const char *src, size_t n, size_t destbytes) +{ + char *ret; + + if (n > (destbytes - 1)) + return NULL; + + ret = strncpy(dest, src, n); + /* strncpy NULL terminates iff the last character is \0. Therefore + * force the last byte to be \0 + */ + dest[n] = '\0'; + + return ret; +} + +/** + * virStrcpy + * + * A safe version of strcpy. The last parameter is the number of bytes + * available in the destination string, *not* the number of bytes you want + * to copy. If the destination is not large enough to hold all n of the + * src string bytes plus a \0, NULL is returned and no data is copied. + * If the destination is large enough to hold the source plus \0, then the + * string is copied and a pointer to the destination string is returned. + */ +char * +virStrcpy(char *dest, const char *src, size_t destbytes) +{ + return virStrncpy(dest, src, strlen(src), destbytes); +} + +/** + * virSkipSpaces: + * @str: pointer to the char pointer used + * + * Skip potential blanks, this includes space tabs, line feed, + * carriage returns. + */ +void +virSkipSpaces(const char **str) +{ + const char *cur = *str; + + while (c_isspace(*cur)) + cur++; + *str = cur; +} + +/** + * virSkipSpacesAndBackslash: + * @str: pointer to the char pointer used + * + * Like virSkipSpaces, but also skip backslashes erroneously emitted + * by xend + */ +void +virSkipSpacesAndBackslash(const char **str) +{ + const char *cur = *str; + + while (c_isspace(*cur) || *cur == '\\') + cur++; + *str = cur; +} + +/** + * virTrimSpaces: + * @str: string to modify to remove all trailing spaces + * @endp: track the end of the string + * + * If @endp is NULL on entry, then all spaces prior to the trailing + * NUL in @str are removed, by writing NUL into the appropriate + * location. If @endp is non-NULL but points to a NULL pointer, + * then all spaces prior to the trailing NUL in @str are removed, + * NUL is written to the new string end, and endp is set to the + * location of the (new) string end. If @endp is non-NULL and + * points to a non-NULL pointer, then that pointer is used as + * the end of the string, endp is set to the (new) location, but + * no NUL pointer is written into the string. + */ +void +virTrimSpaces(char *str, char **endp) +{ + char *end; + + if (!endp || !*endp) + end = str + strlen(str); + else + end = *endp; + while (end > str && c_isspace(end[-1])) + end--; + if (endp) { + if (!*endp) + *end = '\0'; + *endp = end; + } else { + *end = '\0'; + } +} + +/** + * virSkipSpacesBackwards: + * @str: start of string + * @endp: on entry, *endp must be NULL or a location within @str, on exit, + * will be adjusted to skip trailing spaces, or to NULL if @str had nothing + * but spaces. + */ +void +virSkipSpacesBackwards(const char *str, char **endp) +{ + /* Casting away const is safe, since virTrimSpaces does not + * modify string with this particular usage. */ + char *s = (char*) str; + + if (!*endp) + *endp = s + strlen(s); + virTrimSpaces(s, endp); + if (s == *endp) + *endp = NULL; +} + +char * +virArgvToString(const char *const *argv) +{ + int len, i; + char *ret, *p; + + for (len = 1, i = 0; argv[i]; i++) + len += strlen(argv[i]) + 1; + + if (VIR_ALLOC_N(ret, len) < 0) + return NULL; + p = ret; + + for (i = 0; argv[i]; i++) { + if (i != 0) + *(p++) = ' '; + + strcpy(p, argv[i]); + p += strlen(argv[i]); + } + + *p = '\0'; + + return ret; +} diff --git a/src/util/virstring.h b/src/util/virstring.h index 2ceadc6b84..457caa2fb5 100644 --- a/src/util/virstring.h +++ b/src/util/virstring.h @@ -22,6 +22,8 @@ #ifndef __VIR_STRING_H__ # define __VIR_STRING_H__ +# include + # include "internal.h" char **virStringSplit(const char *string, @@ -37,4 +39,52 @@ void virStringFreeList(char **strings); bool virStringArrayHasString(char **strings, const char *needle); +char *virArgvToString(const char *const *argv); + +int virStrToLong_i(char const *s, + char **end_ptr, + int base, + int *result); + +int virStrToLong_ui(char const *s, + char **end_ptr, + int base, + unsigned int *result); +int virStrToLong_l(char const *s, + char **end_ptr, + int base, + long *result); +int virStrToLong_ul(char const *s, + char **end_ptr, + int base, + unsigned long *result); +int virStrToLong_ll(char const *s, + char **end_ptr, + int base, + long long *result); +int virStrToLong_ull(char const *s, + char **end_ptr, + int base, + unsigned long long *result); +int virStrToDouble(char const *s, + char **end_ptr, + double *result); + +void virSkipSpaces(const char **str) ATTRIBUTE_NONNULL(1); +void virSkipSpacesAndBackslash(const char **str) ATTRIBUTE_NONNULL(1); +void virTrimSpaces(char *str, char **endp) ATTRIBUTE_NONNULL(1); +void virSkipSpacesBackwards(const char *str, char **endp) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); + +int virAsprintf(char **strp, const char *fmt, ...) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 3) + ATTRIBUTE_RETURN_CHECK; +int virVasprintf(char **strp, const char *fmt, va_list list) + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 0) + ATTRIBUTE_RETURN_CHECK; +char *virStrncpy(char *dest, const char *src, size_t n, size_t destbytes) + ATTRIBUTE_RETURN_CHECK; +char *virStrcpy(char *dest, const char *src, size_t destbytes) + ATTRIBUTE_RETURN_CHECK; +# define virStrcpyStatic(dest, src) virStrcpy((dest), (src), sizeof(dest)) #endif /* __VIR_STRING_H__ */ diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index ba0c245f99..2efe634957 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -32,10 +32,10 @@ #include "virerror.h" #include "virsysinfo.h" -#include "virutil.h" #include "virlog.h" #include "viralloc.h" #include "vircommand.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_SYSINFO diff --git a/src/util/virtime.c b/src/util/virtime.c index b54a4e8d6b..37c639cbbb 100644 --- a/src/util/virtime.c +++ b/src/util/virtime.c @@ -37,7 +37,6 @@ #include #include "virtime.h" -#include "virutil.h" #include "viralloc.h" #include "virerror.h" diff --git a/src/util/virtpm.c b/src/util/virtpm.c index fbe5e9dbcc..b5504b573c 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -24,7 +24,7 @@ #include -#include "virutil.h" +#include "virstring.h" #include "virerror.h" #include "virtpm.h" diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index c19632177e..a9f8a33320 100644 --- a/src/util/virtypedparam.c +++ b/src/util/virtypedparam.c @@ -27,6 +27,7 @@ #include "viralloc.h" #include "virutil.h" #include "virerror.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/src/util/viruri.c b/src/util/viruri.c index 2888cb0c0a..2a75425d74 100644 --- a/src/util/viruri.c +++ b/src/util/viruri.c @@ -23,9 +23,9 @@ #include "viruri.h" #include "viralloc.h" -#include "virutil.h" #include "virerror.h" #include "virbuffer.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_URI diff --git a/src/util/virusb.c b/src/util/virusb.c index 6e43f8efd5..3192634f4e 100644 --- a/src/util/virusb.c +++ b/src/util/virusb.c @@ -38,6 +38,7 @@ #include "viralloc.h" #include "virutil.h" #include "virerror.h" +#include "virstring.h" #define USB_SYSFS "/sys/bus/usb" #define USB_ID_LEN 10 /* "1234 5678" */ diff --git a/src/util/virutil.c b/src/util/virutil.c index b9de33c4eb..dc14c15238 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -80,7 +79,6 @@ #include "virerror.h" #include "virlog.h" #include "virbuffer.h" -#include "virutil.h" #include "virstoragefile.h" #include "viralloc.h" #include "virthread.h" @@ -90,6 +88,7 @@ #include "nonblocking.h" #include "passfd.h" #include "virprocess.h" +#include "virstring.h" #ifndef NSIG # define NSIG 32 @@ -240,32 +239,6 @@ int virFileStripSuffix(char *str, return 1; } -char * -virArgvToString(const char *const *argv) -{ - int len, i; - char *ret, *p; - - for (len = 1, i = 0; argv[i]; i++) - len += strlen(argv[i]) + 1; - - if (VIR_ALLOC_N(ret, len) < 0) - return NULL; - p = ret; - - for (i = 0; argv[i]; i++) { - if (i != 0) - *(p++) = ' '; - - strcpy(p, argv[i]); - p += strlen(argv[i]); - } - - *p = '\0'; - - return ret; -} - #ifndef WIN32 int virSetInherit(int fd, bool inherit) { @@ -1595,145 +1568,6 @@ virFileSanitizePath(const char *path) return cleanpath; } -/* Like strtol, but produce an "int" result, and check more carefully. - Return 0 upon success; return -1 to indicate failure. - When END_PTR is NULL, the byte after the final valid digit must be NUL. - Otherwise, it's like strtol and lets the caller check any suffix for - validity. This function is careful to return -1 when the string S - represents a number that is not representable as an "int". */ -int -virStrToLong_i(char const *s, char **end_ptr, int base, int *result) -{ - long int val; - char *p; - int err; - - errno = 0; - val = strtol(s, &p, base); /* exempt from syntax-check */ - err = (errno || (!end_ptr && *p) || p == s || (int) val != val); - if (end_ptr) - *end_ptr = p; - if (err) - return -1; - *result = val; - return 0; -} - -/* Just like virStrToLong_i, above, but produce an "unsigned int" value. */ -int -virStrToLong_ui(char const *s, char **end_ptr, int base, unsigned int *result) -{ - unsigned long int val; - char *p; - int err; - - errno = 0; - val = strtoul(s, &p, base); /* exempt from syntax-check */ - err = (errno || (!end_ptr && *p) || p == s || (unsigned int) val != val); - if (end_ptr) - *end_ptr = p; - if (err) - return -1; - *result = val; - return 0; -} - -/* Just like virStrToLong_i, above, but produce a "long" value. */ -int -virStrToLong_l(char const *s, char **end_ptr, int base, long *result) -{ - long int val; - char *p; - int err; - - errno = 0; - val = strtol(s, &p, base); /* exempt from syntax-check */ - err = (errno || (!end_ptr && *p) || p == s); - if (end_ptr) - *end_ptr = p; - if (err) - return -1; - *result = val; - return 0; -} - -/* Just like virStrToLong_i, above, but produce an "unsigned long" value. */ -int -virStrToLong_ul(char const *s, char **end_ptr, int base, unsigned long *result) -{ - unsigned long int val; - char *p; - int err; - - errno = 0; - val = strtoul(s, &p, base); /* exempt from syntax-check */ - err = (errno || (!end_ptr && *p) || p == s); - if (end_ptr) - *end_ptr = p; - if (err) - return -1; - *result = val; - return 0; -} - -/* Just like virStrToLong_i, above, but produce a "long long" value. */ -int -virStrToLong_ll(char const *s, char **end_ptr, int base, long long *result) -{ - long long val; - char *p; - int err; - - errno = 0; - val = strtoll(s, &p, base); /* exempt from syntax-check */ - err = (errno || (!end_ptr && *p) || p == s); - if (end_ptr) - *end_ptr = p; - if (err) - return -1; - *result = val; - return 0; -} - -/* Just like virStrToLong_i, above, but produce an "unsigned long long" value. */ -int -virStrToLong_ull(char const *s, char **end_ptr, int base, unsigned long long *result) -{ - unsigned long long val; - char *p; - int err; - - errno = 0; - val = strtoull(s, &p, base); /* exempt from syntax-check */ - err = (errno || (!end_ptr && *p) || p == s); - if (end_ptr) - *end_ptr = p; - if (err) - return -1; - *result = val; - return 0; -} - -int -virStrToDouble(char const *s, - char **end_ptr, - double *result) -{ - double val; - char *p; - int err; - - errno = 0; - val = strtod(s, &p); /* exempt from syntax-check */ - err = (errno || (!end_ptr && *p) || p == s); - if (end_ptr) - *end_ptr = p; - if (err) - return -1; - *result = val; - return 0; -} - /* Convert C from hexadecimal character to integer. */ int virHexToBin(unsigned char c) @@ -1819,95 +1653,6 @@ virScaleInteger(unsigned long long *value, const char *suffix, return 0; } -/** - * virSkipSpaces: - * @str: pointer to the char pointer used - * - * Skip potential blanks, this includes space tabs, line feed, - * carriage returns. - */ -void -virSkipSpaces(const char **str) -{ - const char *cur = *str; - - while (c_isspace(*cur)) - cur++; - *str = cur; -} - -/** - * virSkipSpacesAndBackslash: - * @str: pointer to the char pointer used - * - * Like virSkipSpaces, but also skip backslashes erroneously emitted - * by xend - */ -void -virSkipSpacesAndBackslash(const char **str) -{ - const char *cur = *str; - - while (c_isspace(*cur) || *cur == '\\') - cur++; - *str = cur; -} - -/** - * virTrimSpaces: - * @str: string to modify to remove all trailing spaces - * @endp: track the end of the string - * - * If @endp is NULL on entry, then all spaces prior to the trailing - * NUL in @str are removed, by writing NUL into the appropriate - * location. If @endp is non-NULL but points to a NULL pointer, - * then all spaces prior to the trailing NUL in @str are removed, - * NUL is written to the new string end, and endp is set to the - * location of the (new) string end. If @endp is non-NULL and - * points to a non-NULL pointer, then that pointer is used as - * the end of the string, endp is set to the (new) location, but - * no NUL pointer is written into the string. - */ -void -virTrimSpaces(char *str, char **endp) -{ - char *end; - - if (!endp || !*endp) - end = str + strlen(str); - else - end = *endp; - while (end > str && c_isspace(end[-1])) - end--; - if (endp) { - if (!*endp) - *end = '\0'; - *endp = end; - } else { - *end = '\0'; - } -} - -/** - * virSkipSpacesBackwards: - * @str: start of string - * @endp: on entry, *endp must be NULL or a location within @str, on exit, - * will be adjusted to skip trailing spaces, or to NULL if @str had nothing - * but spaces. - */ -void -virSkipSpacesBackwards(const char *str, char **endp) -{ - /* Casting away const is safe, since virTrimSpaces does not - * modify string with this particular usage. */ - char *s = (char*) str; - - if (!*endp) - *endp = s + strlen(s); - virTrimSpaces(s, endp); - if (s == *endp) - *endp = NULL; -} /** * virParseNumber: @@ -1940,7 +1685,6 @@ virParseNumber(const char **str) return ret; } - /** * virParseVersionString: * @str: const char pointer to the version string @@ -1987,82 +1731,6 @@ virParseVersionString(const char *str, unsigned long *version, return 0; } -/** - * virVasprintf - * - * like glibc's vasprintf but makes sure *strp == NULL on failure - */ -int -virVasprintf(char **strp, const char *fmt, va_list list) -{ - int ret; - - if ((ret = vasprintf(strp, fmt, list)) == -1) - *strp = NULL; - - return ret; -} - -/** - * virAsprintf - * - * like glibc's_asprintf but makes sure *strp == NULL on failure - */ -int -virAsprintf(char **strp, const char *fmt, ...) -{ - va_list ap; - int ret; - - va_start(ap, fmt); - ret = virVasprintf(strp, fmt, ap); - va_end(ap); - return ret; -} - -/** - * virStrncpy - * - * A safe version of strncpy. The last parameter is the number of bytes - * available in the destination string, *not* the number of bytes you want - * to copy. If the destination is not large enough to hold all n of the - * src string bytes plus a \0, NULL is returned and no data is copied. - * If the destination is large enough to hold the n bytes plus \0, then the - * string is copied and a pointer to the destination string is returned. - */ -char * -virStrncpy(char *dest, const char *src, size_t n, size_t destbytes) -{ - char *ret; - - if (n > (destbytes - 1)) - return NULL; - - ret = strncpy(dest, src, n); - /* strncpy NULL terminates iff the last character is \0. Therefore - * force the last byte to be \0 - */ - dest[n] = '\0'; - - return ret; -} - -/** - * virStrcpy - * - * A safe version of strcpy. The last parameter is the number of bytes - * available in the destination string, *not* the number of bytes you want - * to copy. If the destination is not large enough to hold all n of the - * src string bytes plus a \0, NULL is returned and no data is copied. - * If the destination is large enough to hold the source plus \0, then the - * string is copied and a pointer to the destination string is returned. - */ -char * -virStrcpy(char *dest, const char *src, size_t destbytes) -{ - return virStrncpy(dest, src, strlen(src), destbytes); -} - int virEnumFromString(const char *const*types, unsigned int ntypes, const char *type) diff --git a/src/util/virutil.h b/src/util/virutil.h index 39033db780..8a2d25cdad 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -30,7 +30,6 @@ # include # include # include -# include # ifndef MIN # define MIN(a, b) ((a) < (b) ? (a) : (b)) @@ -155,63 +154,15 @@ int virFileOpenTty(int *ttymaster, char **ttyName, int rawmode); -char *virArgvToString(const char *const *argv); - -int virStrToLong_i(char const *s, - char **end_ptr, - int base, - int *result); - -int virStrToLong_ui(char const *s, - char **end_ptr, - int base, - unsigned int *result); -int virStrToLong_l(char const *s, - char **end_ptr, - int base, - long *result); -int virStrToLong_ul(char const *s, - char **end_ptr, - int base, - unsigned long *result); -int virStrToLong_ll(char const *s, - char **end_ptr, - int base, - long long *result); -int virStrToLong_ull(char const *s, - char **end_ptr, - int base, - unsigned long long *result); -int virStrToDouble(char const *s, - char **end_ptr, - double *result); - int virScaleInteger(unsigned long long *value, const char *suffix, unsigned long long scale, unsigned long long limit) ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; int virHexToBin(unsigned char c); -void virSkipSpaces(const char **str) ATTRIBUTE_NONNULL(1); -void virSkipSpacesAndBackslash(const char **str) ATTRIBUTE_NONNULL(1); -void virTrimSpaces(char *str, char **endp) ATTRIBUTE_NONNULL(1); -void virSkipSpacesBackwards(const char *str, char **endp) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - int virParseNumber(const char **str); int virParseVersionString(const char *str, unsigned long *version, bool allowMissing); -int virAsprintf(char **strp, const char *fmt, ...) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 3) - ATTRIBUTE_RETURN_CHECK; -int virVasprintf(char **strp, const char *fmt, va_list list) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_FMT_PRINTF(2, 0) - ATTRIBUTE_RETURN_CHECK; -char *virStrncpy(char *dest, const char *src, size_t n, size_t destbytes) - ATTRIBUTE_RETURN_CHECK; -char *virStrcpy(char *dest, const char *src, size_t destbytes) - ATTRIBUTE_RETURN_CHECK; -# define virStrcpyStatic(dest, src) virStrcpy((dest), (src), sizeof(dest)) int virDoubleToStr(char **strp, double number) ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; diff --git a/src/util/virxml.c b/src/util/virxml.c index aa55a33874..26120b6fc8 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -36,6 +36,7 @@ #include "virutil.h" #include "viralloc.h" #include "virfile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_XML diff --git a/src/vbox/vbox_MSCOMGlue.c b/src/vbox/vbox_MSCOMGlue.c index b5fb821c92..6cebfaf242 100644 --- a/src/vbox/vbox_MSCOMGlue.c +++ b/src/vbox/vbox_MSCOMGlue.c @@ -31,7 +31,6 @@ #include "internal.h" #include "viralloc.h" -#include "virutil.h" #include "virlog.h" #include "virerror.h" #include "vbox_MSCOMGlue.h" diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c index 2b568e238b..e0b606fe4a 100644 --- a/src/vbox/vbox_XPCOMCGlue.c +++ b/src/vbox/vbox_XPCOMCGlue.c @@ -41,6 +41,7 @@ #include "virutil.h" #include "virlog.h" #include "virerror.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_VBOX diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c index dc1e8c356e..30721fd12a 100644 --- a/src/vbox/vbox_driver.c +++ b/src/vbox/vbox_driver.c @@ -38,7 +38,6 @@ #include "vbox_driver.h" #include "vbox_glue.h" #include "virerror.h" -#include "virutil.h" #define VIR_FROM_THIS VIR_FROM_VBOX diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 315ba9c878..43ddac8a61 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -57,6 +57,7 @@ #include "virfile.h" #include "fdstream.h" #include "viruri.h" +#include "virstring.h" /* This one changes from version to version. */ #if VBOX_API_VERSION == 2002 diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index 573fb336ad..4fb61a8a5a 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -32,8 +32,8 @@ #include "viruuid.h" #include "virerror.h" #include "vmx.h" - #include "vmware_conf.h" +#include "virstring.h" /* Free all memory associated with a vmware_driver structure */ void diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 00852bec7d..1e2634eb91 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -28,7 +28,6 @@ #include "datatypes.h" #include "virfile.h" #include "viralloc.h" -#include "virutil.h" #include "viruuid.h" #include "vircommand.h" #include "vmx.h" diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 87bec5beb8..9ec02694e9 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -32,6 +32,7 @@ #include "viruuid.h" #include "vmx.h" #include "viruri.h" +#include "virstring.h" /* diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c index 9f5823cc93..8c18ed591f 100644 --- a/src/xen/block_stats.c +++ b/src/xen/block_stats.c @@ -40,10 +40,10 @@ # include "virerror.h" # include "datatypes.h" -# include "virutil.h" # include "block_stats.h" # include "viralloc.h" # include "virfile.h" +# include "virstring.h" # define VIR_FROM_THIS VIR_FROM_STATS_LINUX diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 0642edb59b..938205ed5d 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -54,7 +54,6 @@ # include "xen_inotify.h" #endif #include "virxml.h" -#include "virutil.h" #include "viralloc.h" #include "node_device_conf.h" #include "virpci.h" @@ -66,6 +65,7 @@ #include "virnodesuspend.h" #include "nodeinfo.h" #include "configmake.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_XEN #define XEN_SAVE_DIR LOCALSTATEDIR "/lib/libvirt/xen/save" diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c index 9dbbe0745b..e15f7f2e1f 100644 --- a/src/xen/xen_hypervisor.c +++ b/src/xen/xen_hypervisor.c @@ -65,7 +65,6 @@ #include "virlog.h" #include "datatypes.h" #include "driver.h" -#include "virutil.h" #include "xen_driver.h" #include "xen_hypervisor.h" #include "xs_internal.h" @@ -80,6 +79,7 @@ #include "virnodesuspend.h" #include "virtypedparam.h" #include "virendian.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_XEN diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index 860bf11dcd..97f44abe4a 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -34,7 +34,6 @@ #include "datatypes.h" #include "xend_internal.h" #include "driver.h" -#include "virutil.h" #include "virsexpr.h" #include "xen_sxpr.h" #include "virbuffer.h" @@ -47,6 +46,7 @@ #include "virfile.h" #include "viruri.h" #include "device_conf.h" +#include "virstring.h" /* required for cpumap_t */ #include diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c index 8ac7cb0571..921c66aeba 100644 --- a/src/xen/xm_internal.c +++ b/src/xen/xm_internal.c @@ -45,10 +45,10 @@ #include "virhash.h" #include "virbuffer.h" #include "viruuid.h" -#include "virutil.h" #include "viralloc.h" #include "virlog.h" #include "count-one-bits.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_XENXM diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index 1135c4e673..7e64df690e 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -31,7 +31,6 @@ #include "virerror.h" #include "datatypes.h" #include "virauth.h" -#include "virutil.h" #include "viruuid.h" #include "viralloc.h" #include "virbuffer.h" @@ -39,6 +38,7 @@ #include "xenapi_driver.h" #include "xenapi_driver_private.h" #include "xenapi_utils.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_XENAPI diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c index 3b8384eb92..55fbb242e9 100644 --- a/src/xenapi/xenapi_utils.c +++ b/src/xenapi/xenapi_utils.c @@ -29,7 +29,6 @@ #include "domain_conf.h" #include "virerror.h" #include "datatypes.h" -#include "virutil.h" #include "viruuid.h" #include "viralloc.h" #include "virbuffer.h" @@ -37,6 +36,7 @@ #include "viruri.h" #include "xenapi_driver_private.h" #include "xenapi_utils.h" +#include "virstring.h" void xenSessionFree(xen_session *session) diff --git a/src/xenxs/xen_sxpr.c b/src/xenxs/xen_sxpr.c index 76e57ee685..9a76d0462c 100644 --- a/src/xenxs/xen_sxpr.c +++ b/src/xenxs/xen_sxpr.c @@ -37,6 +37,7 @@ #include "xenxs_private.h" #include "xen_sxpr.h" #include "virstoragefile.h" +#include "virstring.h" /* Get a domain id from a S-expression string */ int xenGetDomIdFromSxprString(const char *sexpr, int xendConfigVersion) diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c index 275e6ede58..57ce2e714f 100644 --- a/src/xenxs/xen_xm.c +++ b/src/xenxs/xen_xm.c @@ -38,6 +38,7 @@ #include "xen_sxpr.h" #include "domain_conf.h" #include "virstoragefile.h" +#include "virstring.h" /* Convenience method to grab a long int from the config file object */ static int xenXMConfigGetBool(virConfPtr conf, diff --git a/tests/commandtest.c b/tests/commandtest.c index ac369f97f7..6cb88c5072 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -31,13 +31,13 @@ #include "testutils.h" #include "internal.h" #include "nodeinfo.h" -#include "virutil.h" #include "viralloc.h" #include "vircommand.h" #include "virfile.h" #include "virpidfile.h" #include "virerror.h" #include "virthread.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/tests/cputest.c b/tests/cputest.c index ab96824b98..0105440772 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -38,6 +38,7 @@ #include "cpu_conf.h" #include "cpu/cpu.h" #include "cpu/cpu_map.h" +#include "virstring.h" static const char *abs_top_srcdir; diff --git a/tests/domainsnapshotxml2xmltest.c b/tests/domainsnapshotxml2xmltest.c index 694c382f59..9eddf458fe 100644 --- a/tests/domainsnapshotxml2xmltest.c +++ b/tests/domainsnapshotxml2xmltest.c @@ -16,6 +16,7 @@ # include "qemu/qemu_conf.h" # include "qemu/qemu_domain.h" # include "testutilsqemu.h" +# include "virstring.h" static virQEMUDriver driver; diff --git a/tests/esxutilstest.c b/tests/esxutilstest.c index e2baea2146..bb58a3ab28 100644 --- a/tests/esxutilstest.c +++ b/tests/esxutilstest.c @@ -10,7 +10,6 @@ # include "internal.h" # include "viralloc.h" -# include "virutil.h" # include "vmx/vmx.h" # include "esx/esx_util.h" # include "esx/esx_vi_types.h" diff --git a/tests/interfacexml2xmltest.c b/tests/interfacexml2xmltest.c index f969fa1782..9d86198bcb 100644 --- a/tests/interfacexml2xmltest.c +++ b/tests/interfacexml2xmltest.c @@ -12,7 +12,7 @@ #include "testutils.h" #include "interface_conf.h" #include "testutilsqemu.h" - +#include "virstring.h" static int testCompareXMLToXMLFiles(const char *xml) diff --git a/tests/libvirtdconftest.c b/tests/libvirtdconftest.c index 01e94153c6..df8d3d8dbc 100644 --- a/tests/libvirtdconftest.c +++ b/tests/libvirtdconftest.c @@ -29,6 +29,7 @@ #include "virerror.h" #include "virlog.h" #include "virconf.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c index 4870f4282b..827c2fd267 100644 --- a/tests/lxcxml2xmltest.c +++ b/tests/lxcxml2xmltest.c @@ -15,6 +15,7 @@ # include "internal.h" # include "lxc/lxc_conf.h" # include "testutilslxc.h" +# include "virstring.h" static virCapsPtr caps; static virDomainXMLOptionPtr xmlopt; diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index 88016ee119..520febacef 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -14,6 +14,7 @@ #include "vircommand.h" #include "viralloc.h" #include "network/bridge_driver.h" +#include "virstring.h" static int testCompareXMLToConfFiles(const char *inxml, const char *outconf, dnsmasqCapsPtr caps) diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 1063435651..5eca143ccc 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -12,6 +12,7 @@ #include "testutils.h" #include "network_conf.h" #include "testutilsqemu.h" +#include "virstring.h" static int testCompareXMLToXMLFiles(const char *inxml, const char *outxml, diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c index 38f2e9a027..e81c617974 100644 --- a/tests/nodedevxml2xmltest.c +++ b/tests/nodedevxml2xmltest.c @@ -12,6 +12,7 @@ #include "testutils.h" #include "node_device_conf.h" #include "testutilsqemu.h" +#include "virstring.h" static int testCompareXMLToXMLFiles(const char *xml) diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index d900eb9ae9..733d350a2f 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -8,8 +8,8 @@ #include "testutils.h" #include "internal.h" #include "nodeinfo.h" -#include "virutil.h" #include "virfile.h" +#include "virstring.h" #if ! (defined __linux__ && (defined(__x86_64__) || \ defined(__amd64__) || \ diff --git a/tests/nwfilterxml2xmltest.c b/tests/nwfilterxml2xmltest.c index a215bf8ab7..158bc9f4ce 100644 --- a/tests/nwfilterxml2xmltest.c +++ b/tests/nwfilterxml2xmltest.c @@ -15,6 +15,7 @@ #include "nwfilter_params.h" #include "nwfilter_conf.h" #include "testutilsqemu.h" +#include "virstring.h" static int testCompareXMLToXMLFiles(const char *inxml, const char *outxml, diff --git a/tests/openvzutilstest.c b/tests/openvzutilstest.c index 616b6be063..be0c74cbd5 100644 --- a/tests/openvzutilstest.c +++ b/tests/openvzutilstest.c @@ -10,8 +10,8 @@ # include "internal.h" # include "viralloc.h" -# include "virutil.h" # include "openvz/openvz_conf.h" +# include "virstring.h" static int testLocateConfFile(int vpsid ATTRIBUTE_UNUSED, char **conffile, diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index 9f1bb242d8..005aa0cfe8 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -14,8 +14,8 @@ # include "internal.h" # include "qemu/qemu_command.h" - # include "testutilsqemu.h" +# include "virstring.h" static virQEMUDriver driver; diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index eeba4d4201..fa56406f46 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -9,6 +9,7 @@ # include "qemu/qemu_capabilities.h" # include "viralloc.h" +# include "virstring.h" struct testInfo { const char *name; diff --git a/tests/qemumonitortest.c b/tests/qemumonitortest.c index a8fc57ac71..61ac2d69f1 100644 --- a/tests/qemumonitortest.c +++ b/tests/qemumonitortest.c @@ -11,7 +11,6 @@ # include "internal.h" # include "viralloc.h" -# include "virutil.h" # include "qemu/qemu_monitor.h" struct testEscapeString diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 43e7cb904a..c24a37fb99 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -30,9 +30,9 @@ #include "qemu/qemu_monitor.h" #include "rpc/virnetsocket.h" #include "viralloc.h" -#include "virutil.h" #include "virlog.h" #include "virerror.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 9699f775a5..128627308e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -19,6 +19,7 @@ # include "qemu/qemu_domain.h" # include "datatypes.h" # include "cpu/cpu_map.h" +# include "virstring.h" # include "testutilsqemu.h" diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index a81cfcf364..64c1c83023 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -16,6 +16,7 @@ # include "qemu/qemu_conf.h" # include "qemu/qemu_domain.h" # include "testutilsqemu.h" +# include "virstring.h" static virQEMUDriver driver; diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c index 4e9144befc..cd493e37e1 100644 --- a/tests/qemuxmlnstest.c +++ b/tests/qemuxmlnstest.c @@ -18,8 +18,8 @@ # include "qemu/qemu_domain.h" # include "datatypes.h" # include "cpu/cpu_map.h" - # include "testutilsqemu.h" +# include "virstring.h" static const char *abs_top_srcdir; static virQEMUDriver driver; diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c index f585f6fad5..e270a765c3 100644 --- a/tests/securityselinuxlabeltest.c +++ b/tests/securityselinuxlabeltest.c @@ -37,9 +37,8 @@ #include "virerror.h" #include "virfile.h" #include "virlog.h" -#include "virutil.h" #include "security/security_manager.h" - +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c index da8a12f3d7..dd4cd11270 100644 --- a/tests/securityselinuxtest.c +++ b/tests/securityselinuxtest.c @@ -31,11 +31,10 @@ #include "internal.h" #include "testutils.h" #include "viralloc.h" -#include "virutil.h" #include "virlog.h" #include "virerror.h" #include "security/security_manager.h" - +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index b7487efe17..f4d119e3b3 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -12,6 +12,7 @@ #include "xenxs/xen_sxpr.h" #include "testutils.h" #include "testutilsxen.h" +#include "virstring.h" static virCapsPtr caps; diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index 9be63c597f..0376e63b54 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -12,6 +12,7 @@ #include "testutils.h" #include "storage_conf.h" #include "testutilsqemu.h" +#include "virstring.h" static int testCompareXMLToXMLFiles(const char *inxml, const char *outxml) diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index 77ba800502..e1507b4495 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -5,6 +5,7 @@ #include "datatypes.h" #include "storage/storage_backend.h" #include "testutilsqemu.h" +#include "virstring.h" const char create_tool[] = "qemu-img"; diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c index 0902496de5..07c79c1cdd 100644 --- a/tests/storagevolxml2xmltest.c +++ b/tests/storagevolxml2xmltest.c @@ -12,6 +12,7 @@ #include "testutils.h" #include "storage_conf.h" #include "testutilsqemu.h" +#include "virstring.h" static int testCompareXMLToXMLFiles(const char *poolxml, const char *inxml, diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index 895520809c..dc0451b8d3 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -33,8 +33,8 @@ #include "virbuffer.h" #include "virsysinfo.h" #include "testutils.h" -#include "virutil.h" #include "virfile.h" +#include "virstring.h" #if defined (__linux__) diff --git a/tests/testutils.c b/tests/testutils.c index 0fb69ec928..b0806defb8 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -45,6 +45,7 @@ #include "virrandom.h" #include "dirname.h" #include "virprocess.h" +#include "virstring.h" #if TEST_OOM_TRACE # include diff --git a/tests/virauthconfigtest.c b/tests/virauthconfigtest.c index 67c5de817d..a27bae5539 100644 --- a/tests/virauthconfigtest.c +++ b/tests/virauthconfigtest.c @@ -24,7 +24,6 @@ #include #include "testutils.h" -#include "virutil.h" #include "virerror.h" #include "viralloc.h" #include "virlog.h" diff --git a/tests/virbuftest.c b/tests/virbuftest.c index 7f9ee665bf..c7a504b2f1 100644 --- a/tests/virbuftest.c +++ b/tests/virbuftest.c @@ -5,10 +5,10 @@ #include #include "internal.h" -#include "virutil.h" #include "testutils.h" #include "virbuffer.h" #include "viralloc.h" +#include "virstring.h" #define TEST_ERROR(...) \ do { \ diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index e2adef8901..4777fae847 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -28,7 +28,7 @@ # define __VIR_CGROUP_ALLOW_INCLUDE_PRIV_H__ # include "vircgrouppriv.h" -# include "virutil.h" +# include "virstring.h" # include "virerror.h" # include "virlog.h" # include "virfile.h" diff --git a/tests/virdrivermoduletest.c b/tests/virdrivermoduletest.c index bbceb966bd..1aae245af7 100644 --- a/tests/virdrivermoduletest.c +++ b/tests/virdrivermoduletest.c @@ -21,7 +21,6 @@ #include #include "testutils.h" -#include "virutil.h" #include "virerror.h" #include "viralloc.h" #include "virlog.h" diff --git a/tests/virhashtest.c b/tests/virhashtest.c index 6e4f2670a6..f36fc76c7c 100644 --- a/tests/virhashtest.c +++ b/tests/virhashtest.c @@ -10,9 +10,8 @@ #include "virhashdata.h" #include "testutils.h" #include "viralloc.h" -#include "virutil.h" #include "virlog.h" - +#include "virstring.h" #define testError(...) \ do { \ diff --git a/tests/viridentitytest.c b/tests/viridentitytest.c index e8987958e8..269a57d137 100644 --- a/tests/viridentitytest.c +++ b/tests/viridentitytest.c @@ -25,7 +25,6 @@ #include "testutils.h" #include "viridentity.h" -#include "virutil.h" #include "virerror.h" #include "viralloc.h" #include "virlog.h" diff --git a/tests/virkeyfiletest.c b/tests/virkeyfiletest.c index fb41840f86..8fe7e38f39 100644 --- a/tests/virkeyfiletest.c +++ b/tests/virkeyfiletest.c @@ -24,7 +24,6 @@ #include #include "testutils.h" -#include "virutil.h" #include "virerror.h" #include "viralloc.h" #include "virlog.h" diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c index e58fd1feee..96defe420f 100644 --- a/tests/virnetmessagetest.c +++ b/tests/virnetmessagetest.c @@ -24,7 +24,6 @@ #include #include "testutils.h" -#include "virutil.h" #include "virerror.h" #include "viralloc.h" #include "virlog.h" diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index aaa6acb6bb..5e2925da16 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -33,6 +33,7 @@ #include "viralloc.h" #include "virlog.h" #include "virfile.h" +#include "virstring.h" #include "rpc/virnetsocket.h" diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c index 1935602c97..a52850687d 100644 --- a/tests/virportallocatortest.c +++ b/tests/virportallocatortest.c @@ -54,8 +54,8 @@ int bind(int sockfd ATTRIBUTE_UNUSED, # include "virerror.h" # include "viralloc.h" # include "virlog.h" - # include "virportallocator.h" +# include "virstring.h" # define VIR_FROM_THIS VIR_FROM_RPC diff --git a/tests/virshtest.c b/tests/virshtest.c index b82a4c4901..fad67745be 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -6,8 +6,8 @@ #include "internal.h" #include "virxml.h" -#include "virutil.h" #include "testutils.h" +#include "virstring.h" #ifdef WIN32 diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 0e6ba9e75c..0016052e33 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -27,6 +27,7 @@ #include "virerror.h" #include "virlog.h" #include "virstoragefile.h" +#include "virstring.h" #define VIR_FROM_THIS VIR_FROM_NONE diff --git a/tests/virstringtest.c b/tests/virstringtest.c index 86d8986cd7..db1e8a9b49 100644 --- a/tests/virstringtest.c +++ b/tests/virstringtest.c @@ -23,7 +23,6 @@ #include #include "testutils.h" -#include "virutil.h" #include "virerror.h" #include "viralloc.h" #include "virlog.h" diff --git a/tests/virtimetest.c b/tests/virtimetest.c index 18f621a610..7768ecb265 100644 --- a/tests/virtimetest.c +++ b/tests/virtimetest.c @@ -24,7 +24,6 @@ #include #include "testutils.h" -#include "virutil.h" #include "virerror.h" #include "viralloc.h" #include "virlog.h" diff --git a/tests/viruritest.c b/tests/viruritest.c index 3cb88daee3..0bcd78d560 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -24,7 +24,6 @@ #include #include "testutils.h" -#include "virutil.h" #include "virerror.h" #include "viralloc.h" #include "virlog.h" diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index 0003f5f4a5..bd7cbc6a0b 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -11,6 +11,7 @@ # include "internal.h" # include "viralloc.h" # include "vmx/vmx.h" +# include "virstring.h" static virCapsPtr caps; static virDomainXMLOptionPtr xmlopt; diff --git a/tests/xencapstest.c b/tests/xencapstest.c index 381802ed70..e220234b6a 100644 --- a/tests/xencapstest.c +++ b/tests/xencapstest.c @@ -10,6 +10,7 @@ #include "testutils.h" #include "xen/xen_hypervisor.h" #include "virfile.h" +#include "virstring.h" static int testCompareFiles(virArch hostmachine, const char *xml_rel, diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index b7ff48ca46..8e0c59e459 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -35,6 +35,7 @@ #include "testutils.h" #include "testutilsxen.h" #include "viralloc.h" +#include "virstring.h" static virCapsPtr caps; static virDomainXMLOptionPtr xmlopt; diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c index 062ff075cd..ec196c41d4 100644 --- a/tests/xml2sexprtest.c +++ b/tests/xml2sexprtest.c @@ -14,6 +14,7 @@ #include "xenxs/xen_sxpr.h" #include "testutils.h" #include "testutilsxen.h" +#include "virstring.h" static virCapsPtr caps; static virDomainXMLOptionPtr xmlopt; diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c index fa4f6f9fd0..38b5a4de49 100644 --- a/tests/xml2vmxtest.c +++ b/tests/xml2vmxtest.c @@ -11,6 +11,7 @@ # include "internal.h" # include "viralloc.h" # include "vmx/vmx.h" +# include "virstring.h" static virCapsPtr caps; static virVMXContext ctx; diff --git a/tools/console.c b/tools/console.c index e423134751..9abfb584f8 100644 --- a/tools/console.c +++ b/tools/console.c @@ -39,7 +39,6 @@ # include "internal.h" # include "console.h" # include "virlog.h" -# include "virutil.h" # include "virfile.h" # include "viralloc.h" # include "virthread.h" diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index f7297f5ae1..5ed89d1d50 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -38,6 +38,7 @@ #include "virmacaddr.h" #include "virsh-domain.h" #include "virxml.h" +#include "virstring.h" static const char * vshDomainIOErrorToString(int error) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 5c8bcbaf15..9ac9bd14fb 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -44,7 +44,6 @@ #include "console.h" #include "viralloc.h" #include "vircommand.h" -#include "virutil.h" #include "virfile.h" #include "virjson.h" #include "virkeycode.h" diff --git a/tools/virsh-host.c b/tools/virsh-host.c index a7e31da613..a75d8440e9 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -34,10 +34,10 @@ #include "internal.h" #include "virbuffer.h" #include "viralloc.h" -#include "virutil.h" #include "virsh-domain.h" #include "virxml.h" #include "virtypedparam.h" +#include "virstring.h" /* * "capabilities" command diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index c022e1d2ed..706074faad 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -36,6 +36,7 @@ #include "viralloc.h" #include "virutil.h" #include "virxml.h" +#include "virstring.h" virInterfacePtr vshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd, diff --git a/tools/virsh-network.c b/tools/virsh-network.c index bc1a64a991..81267bcaa8 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -34,7 +34,6 @@ #include "internal.h" #include "virbuffer.h" #include "viralloc.h" -#include "virutil.h" #include "virxml.h" #include "conf/network_conf.h" diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index c196e7aead..8fa67fcc86 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -34,7 +34,6 @@ #include "internal.h" #include "virbuffer.h" #include "viralloc.h" -#include "virutil.h" #include "virxml.h" #include "conf/node_device_conf.h" diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index c1e91ea94c..f154366b39 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -34,9 +34,9 @@ #include "internal.h" #include "virbuffer.h" #include "viralloc.h" -#include "virutil.h" #include "virxml.h" #include "conf/storage_conf.h" +#include "virstring.h" virStoragePoolPtr vshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname, diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 44a1e03faa..4f5fa156da 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -36,7 +36,6 @@ #include "internal.h" #include "virbuffer.h" #include "viralloc.h" -#include "virutil.h" #include "virsh-domain.h" #include "virxml.h" #include "conf/snapshot_conf.h" diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 728bc23a92..a222cca62e 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -40,6 +40,7 @@ #include "virfile.h" #include "virsh-pool.h" #include "virxml.h" +#include "virstring.h" virStorageVolPtr vshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd, diff --git a/tools/virsh.c b/tools/virsh.c index ac86608a1a..22bcec2bed 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -57,7 +57,6 @@ #include "base64.h" #include "virbuffer.h" #include "console.h" -#include "virutil.h" #include "viralloc.h" #include "virxml.h" #include @@ -71,6 +70,7 @@ #include "virbitmap.h" #include "conf/domain_conf.h" #include "virtypedparam.h" +#include "virstring.h" #include "virsh-domain.h" #include "virsh-domain-monitor.h" diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c index 34a527f7c7..c17c2574d1 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -31,6 +31,7 @@ #include "viralloc.h" #include "virfile.h" #include "virt-host-validate-common.h" +#include "virstring.h" static bool quiet; -- 2.47.2