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

[libvirt] [PATCH v2 01/37] 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 f0f78f5..d499ded 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 5e3ae21..efb564e 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 38b7346..9f81a0f 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 e5e3f2c..8c79680 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 244b7ec..856789a 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 c7ec92f..5340b63 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 bdc5f1d..6aaee75 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 099b1cb..f49dc21 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 d81744c..40910d6 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 a8b5dfd..51cb1fa 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 3a0f23a..21f7ce2 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 7ca9c86..fd3c292 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 b830cd0..87249cb 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 47f51f9..c275339 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 d910a27..8abfa53 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 8fe4e03..f9303c1 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 b61010d..08222de 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 48998ec..5d04cff 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 7aebc8d..2509c0d 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 a81a91b..5bcfe12 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 bd5684d..5b54a28 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 b58385d..9f2012e 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 60b8034..567a4ac 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 88dff1b..c710bbd 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 1802324..025d4a8 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 5f392ee..b253db2 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 4940c23..14d525e 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 0e1dbb1..d3cf5f2 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 0a5fe05..c35fcd2 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 0f3421c..7dc0618 100644
--- a/src/esx/esx_device_monitor.c
+++ b/src/esx/esx_device_monitor.c
@@ -25,7 +25,6 @@
 #include <config.h>
 
 #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 50ff723..dcf64b8 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 44055a1..fe5194c 100644
--- a/src/esx/esx_interface_driver.c
+++ b/src/esx/esx_interface_driver.c
@@ -25,7 +25,6 @@
 #include <config.h>
 
 #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 c5be208..fd57b61 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 03b7417..3b932de 100644
--- a/src/esx/esx_nwfilter_driver.c
+++ b/src/esx/esx_nwfilter_driver.c
@@ -25,7 +25,6 @@
 #include <config.h>
 
 #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 2e36e15..5607a2e 100644
--- a/src/esx/esx_secret_driver.c
+++ b/src/esx/esx_secret_driver.c
@@ -24,7 +24,6 @@
 #include <config.h>
 
 #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 a3336a2..941e800 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 329022e..dea6716 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 4d2019b..4566fec 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 d84ce19..ee48159 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 d1f91ff..7f40308 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 53dde97..6f8ce53 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 c362a12..83ea72a 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 3b381de..7031fdb 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 477b661..62123a4 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 336d722..e23f53a 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 e748971..0343238 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 09d9b9e..3f9f8f5 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 b701dc6..5acc4d8 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 9bc5b81..a55b939 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 33ba21f..65fc83d 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 79c57ee..7daad16 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 2daa0b4..15b37a3 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 a7e1eeb..98660dc 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 212d0fc..7361743 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 97e5d74..0d8ef39 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 12b06e2..c3d59bd 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 4c99088..8a92802 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 4b72a05..28a4f15 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 95f7d61..48c6d56 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 ae60caf..82bbe6b 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 <dlfcn.h>
diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index 4a661da..bc3b0d1 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 ac0f69c..ff4069a 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 740b872..f1800eb 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 0becdc7..84a97de 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 fbd0d56..b6df99c 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 ccc9b92..a42c39a 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 6d11eda..a205d69 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 ab07a1e..b10e81c 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 1a81ae3..b561e85 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 c9bd68b..95df2e5 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 fd91430..71c7172 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 f98841e..c3c97d7 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 a5b5608..95c2f33 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 5012b14..df11e89 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 7892807..7eec3de 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 0e39574..ac94355 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 b399092..14fd32c 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 a6f96c7..49fae28 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 f8bec62..e6d7146 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 e126967..c29a5ba 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 7a9436f..23109d3 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 271f370..4c98e43 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 0b589ab..4236ed5 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 f5c66ba..85eb650 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 8c8c38b..d116b23 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 3bc1141..ab4db9a 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 2acf535..a3a8d1f 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 891984a..386751b 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 d23bdfc..e2201ec 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 7c3f317..c16b90d 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 d927716..e31141a 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 <sys/time.h>
 #include <fcntl.h>
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2d3b24a..1e184dd 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 f5fa1c4..24ff142 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 6ad1c30..0732614 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 1b1d4a1..4deb2d6 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 daade3d..696961b 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 f12d7d5..54a55b9 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 f66304c..13212d0 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 d49082c..8ae5c6c 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 58fb0b4..2bde5c7 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 c4fd9ee..e950d7f 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 9ce99f8..27750fc 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 eed0439..7f5975d 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 646c8ff..377b9f4 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 4fa0384..a2deafb 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 0366c17..4143495 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 87a09c7..201fff6 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 3c9515f..b526919 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 d4aabb6..b85a5a9 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 1faf1ae..6da2d12 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 c1684f7..8288b1e 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 f6b76ed..cf25919 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 4cf6647..316043f 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 6049063..6e742f7 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 e815192..ca23d4b 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 987d218..154a56a 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 15fa29c..dfa5673 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 f190eb7..990f0b1 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 d964fb2..f60f106 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 4fa7927..a55b5b1 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 9b0aba6..66c00b2 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 2230bcb..33ba852 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 0f4bb4f..5dd4e1f 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 c26e340..fdcefe1 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 1d1f084..4259cb3 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 998c302..c81555a 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 98521ec..f6f27d9 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 18568fe..a402139 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 2e63d83..4f05633 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 65c0ac3..6bc6fed 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 8a329a9..af4da8c 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 fbaeedd..25a0501 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 a63a125..96bf4cf 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 1618ffa..3322454 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 19d6161..06a1356 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 e6a3b1b..92138d3 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 4ff0f3a..620a460 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 <fcntl.h>
 #include <unistd.h>
diff --git a/src/util/virlog.c b/src/util/virlog.c
index e31abb0..bd47b38 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 7ffaac1..bb06dcc 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 <sys/ioctl.h>
 #include <net/if.h>
diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c
index 2c5b63a..ccc1449 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 9d46cc4..130829c 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 <sys/ioctl.h>
 #include <sys/socket.h>
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index e76e94c..0c4fcbd 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 4fe077a..2aee445 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 3216ea0..0852e4d 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 fac95ec..0cd2e31 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 <sys/ioctl.h>
 #include <net/if.h>
diff --git a/src/util/virnetdevveth.c b/src/util/virnetdevveth.c
index 3f81655..5daf21e 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 13ccbab..883aa46 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 97bba74..6ed6a90 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 14c9f9f..298d57c 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 fb81805..73f5123 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 6c5bc91..f46d702 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 81dfbe6..23b6781 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 7ee450b..d6a0d93 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 <netdb.h>
 
diff --git a/src/util/virstatslinux.c b/src/util/virstatslinux.c
index d3e1a02..60b72dc 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 aabb5c8..c7bb85a 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 122ebb8..9b4cb01 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -21,6 +21,10 @@
 
 #include <config.h>
 
+#include <stdlib.h>
+#include <stdio.h>
+
+#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 2ceadc6..457caa2 100644
--- a/src/util/virstring.h
+++ b/src/util/virstring.h
@@ -22,6 +22,8 @@
 #ifndef __VIR_STRING_H__
 # define __VIR_STRING_H__
 
+# include <stdarg.h>
+
 # 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 ba0c245..2efe634 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 b54a4e8..37c639c 100644
--- a/src/util/virtime.c
+++ b/src/util/virtime.c
@@ -37,7 +37,6 @@
 #include <sys/time.h>
 
 #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 fbe5e9d..b5504b5 100644
--- a/src/util/virtpm.c
+++ b/src/util/virtpm.c
@@ -24,7 +24,7 @@
 
 #include <sys/stat.h>
 
-#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 c196321..a9f8a33 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 2888cb0..2a75425 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 6e43f8e..3192634 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 b9de33c..dc14c15 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -29,7 +29,6 @@
 #include <dirent.h>
 #include <stdio.h>
 #include <stdarg.h>
-#include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -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 39033db..8a2d25c 100644
--- a/src/util/virutil.h
+++ b/src/util/virutil.h
@@ -30,7 +30,6 @@
 # include <unistd.h>
 # include <sys/select.h>
 # include <sys/types.h>
-# include <stdarg.h>
 
 # 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 aa55a33..26120b6 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 b5fb821..6cebfaf 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 2b568e2..e0b606f 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 dc1e8c3..30721fd 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 315ba9c..43ddac8 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 573fb33..4fb61a8 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 00852be..1e2634e 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 f520a85..c6c2f0d 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -33,6 +33,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 9f5823c..8c18ed5 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 8971d4c..526786b 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 9dbbe07..e15f7f2 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 860bf11..97f44ab 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 <xen/dom0_ops.h>
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 8ac7cb0..921c66a 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 1135c4e..7e64df6 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 3b8384e..55fbb24 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 76e57ee..9a76d04 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 275e6ed..57ce2e7 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 ac369f9..6cb88c5 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 ab96824..0105440 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 694c382..9eddf45 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 e2baea2..bb58a3a 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 f969fa1..9d86198 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 01e9415..df8d3d8 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 4870f42..827c2fd 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 88016ee..520feba 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 1063435..5eca143 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 38f2e9a..e81c617 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 d900eb9..733d350 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 a215bf8..158bc9f 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 616b6be..be0c74c 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 9f1bb24..005aa0c 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 eeba4d4..fa56406 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 a8fc57a..61ac2d6 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 43e7cb9..c24a37f 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 9699f77..1286273 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 a81cfcf..64c1c83 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 4e9144b..cd493e3 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 f585f6f..e270a76 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 da8a12f..dd4cd11 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 b7487ef..f4d119e 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 9be63c5..0376e63 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 77ba800..e1507b4 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 0902496..07c79c1 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 8955208..dc0451b 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 0fb69ec..b0806de 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 <execinfo.h>
diff --git a/tests/virauthconfigtest.c b/tests/virauthconfigtest.c
index 67c5de8..a27bae5 100644
--- a/tests/virauthconfigtest.c
+++ b/tests/virauthconfigtest.c
@@ -24,7 +24,6 @@
 #include <signal.h>
 
 #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 7f9ee66..c7a504b 100644
--- a/tests/virbuftest.c
+++ b/tests/virbuftest.c
@@ -5,10 +5,10 @@
 #include <string.h>
 
 #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 e2adef8..4777fae 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 bbceb96..1aae245 100644
--- a/tests/virdrivermoduletest.c
+++ b/tests/virdrivermoduletest.c
@@ -21,7 +21,6 @@
 #include <config.h>
 
 #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 6e4f267..f36fc76 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 e898795..269a57d 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 fb41840..8fe7e38 100644
--- a/tests/virkeyfiletest.c
+++ b/tests/virkeyfiletest.c
@@ -24,7 +24,6 @@
 #include <signal.h>
 
 #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 e58fd1f..96defe4 100644
--- a/tests/virnetmessagetest.c
+++ b/tests/virnetmessagetest.c
@@ -24,7 +24,6 @@
 #include <signal.h>
 
 #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 aaa6acb..5e2925d 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 1935602..a528506 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 b82a4c4..fad6774 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 0e6ba9e..0016052 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 86d8986..db1e8a9 100644
--- a/tests/virstringtest.c
+++ b/tests/virstringtest.c
@@ -23,7 +23,6 @@
 #include <stdlib.h>
 
 #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 18f621a..7768ecb 100644
--- a/tests/virtimetest.c
+++ b/tests/virtimetest.c
@@ -24,7 +24,6 @@
 #include <signal.h>
 
 #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 3cb88da..0bcd78d 100644
--- a/tests/viruritest.c
+++ b/tests/viruritest.c
@@ -24,7 +24,6 @@
 #include <signal.h>
 
 #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 0003f5f..bd7cbc6 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 381802e..e220234 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 b7ff48c..8e0c59e 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 062ff07..ec196c4 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 fa4f6f9..38b5a4d 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 e423134..9abfb58 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 f7297f5..5ed89d1 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 5c8bcba..9ac9bd1 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 a7e31da..a75d844 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 c022e1d..706074f 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 bc1a64a..81267bc 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 c196e7a..8fa67fc 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 c1e91ea..f154366 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 44a1e03..4f5fa15 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 0ca295f..0aaa21e 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 6ec2f7b..de2e57a 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 <libvirt/libvirt-qemu.h>
@@ -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 34a527f..c17c257 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;
 
-- 
1.8.1.5


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