]> xenbits.xensource.com Git - libvirt.git/commitdiff
Rename memory.{c,h} to viralloc.{c,h}
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 12 Dec 2012 18:06:53 +0000 (18:06 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 21 Dec 2012 11:17:14 +0000 (11:17 +0000)
271 files changed:
cfg.mk
daemon/libvirtd-config.c
daemon/libvirtd.c
daemon/remote.c
daemon/stream.c
python/libvirt-override.c
python/typewrappers.c
src/Makefile.am
src/conf/capabilities.c
src/conf/cpu_conf.c
src/conf/device_conf.c
src/conf/domain_audit.c
src/conf/domain_conf.c
src/conf/domain_event.c
src/conf/interface_conf.c
src/conf/netdev_bandwidth_conf.c
src/conf/netdev_vlan_conf.c
src/conf/netdev_vport_profile_conf.c
src/conf/network_conf.c
src/conf/node_device_conf.c
src/conf/nwfilter_conf.c
src/conf/nwfilter_params.c
src/conf/secret_conf.c
src/conf/snapshot_conf.c
src/conf/storage_conf.c
src/conf/storage_encryption_conf.c
src/conf/virconsole.c
src/cpu/cpu.c
src/cpu/cpu_arm.c
src/cpu/cpu_generic.c
src/cpu/cpu_map.c
src/cpu/cpu_powerpc.c
src/cpu/cpu_s390.c
src/cpu/cpu_x86.c
src/datatypes.c
src/driver.c
src/esx/esx_device_monitor.c
src/esx/esx_driver.c
src/esx/esx_interface_driver.c
src/esx/esx_network_driver.c
src/esx/esx_nwfilter_driver.c
src/esx/esx_secret_driver.c
src/esx/esx_storage_backend_iscsi.c
src/esx/esx_storage_backend_vmfs.c
src/esx/esx_storage_driver.c
src/esx/esx_util.c
src/esx/esx_vi.c
src/esx/esx_vi_methods.c
src/esx/esx_vi_types.c
src/fdstream.c
src/hyperv/hyperv_device_monitor.c
src/hyperv/hyperv_driver.c
src/hyperv/hyperv_interface_driver.c
src/hyperv/hyperv_network_driver.c
src/hyperv/hyperv_nwfilter_driver.c
src/hyperv/hyperv_secret_driver.c
src/hyperv/hyperv_storage_driver.c
src/hyperv/hyperv_util.c
src/hyperv/hyperv_wmi.c
src/interface/interface_backend_netcf.c
src/interface/interface_backend_udev.c
src/libvirt.c
src/libxl/libxl_conf.c
src/libxl/libxl_driver.c
src/locking/domain_lock.c
src/locking/lock_daemon.c
src/locking/lock_daemon_config.c
src/locking/lock_driver_lockd.c
src/locking/lock_driver_nop.c
src/locking/lock_driver_sanlock.c
src/locking/lock_manager.c
src/locking/sanlock_helper.c
src/lxc/lxc_cgroup.c
src/lxc/lxc_conf.c
src/lxc/lxc_container.c
src/lxc/lxc_controller.c
src/lxc/lxc_domain.c
src/lxc/lxc_driver.c
src/lxc/lxc_fuse.h
src/lxc/lxc_hostdev.c
src/lxc/lxc_monitor.c
src/lxc/lxc_process.c
src/network/bridge_driver.c
src/node_device/node_device_driver.c
src/node_device/node_device_hal.c
src/node_device/node_device_linux_sysfs.c
src/node_device/node_device_udev.c
src/nodeinfo.c
src/nwfilter/nwfilter_dhcpsnoop.c
src/nwfilter/nwfilter_driver.c
src/nwfilter/nwfilter_ebiptables_driver.c
src/nwfilter/nwfilter_gentech_driver.c
src/nwfilter/nwfilter_learnipaddr.c
src/openvz/openvz_conf.c
src/openvz/openvz_driver.c
src/openvz/openvz_util.c
src/parallels/parallels_driver.c
src/parallels/parallels_network.c
src/parallels/parallels_storage.c
src/parallels/parallels_utils.c
src/phyp/phyp_driver.c
src/qemu/qemu_agent.c
src/qemu/qemu_capabilities.c
src/qemu/qemu_cgroup.c
src/qemu/qemu_command.c
src/qemu/qemu_conf.c
src/qemu/qemu_domain.c
src/qemu/qemu_driver.c
src/qemu/qemu_hostdev.c
src/qemu/qemu_hotplug.c
src/qemu/qemu_migration.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_text.c
src/qemu/qemu_process.c
src/remote/remote_driver.c
src/rpc/virkeepalive.c
src/rpc/virnetclient.c
src/rpc/virnetclientprogram.c
src/rpc/virnetclientstream.c
src/rpc/virnetmessage.c
src/rpc/virnetsaslcontext.c
src/rpc/virnetserver.c
src/rpc/virnetserverclient.c
src/rpc/virnetservermdns.c
src/rpc/virnetserverprogram.c
src/rpc/virnetserverservice.c
src/rpc/virnetsocket.c
src/rpc/virnetsshsession.c
src/rpc/virnettlscontext.c
src/secret/secret_driver.c
src/security/security_apparmor.c
src/security/security_dac.c
src/security/security_manager.c
src/security/security_selinux.c
src/security/security_stack.c
src/security/virt-aa-helper.c
src/storage/storage_backend.c
src/storage/storage_backend_disk.c
src/storage/storage_backend_fs.c
src/storage/storage_backend_iscsi.c
src/storage/storage_backend_logical.c
src/storage/storage_backend_mpath.c
src/storage/storage_backend_rbd.c
src/storage/storage_backend_scsi.c
src/storage/storage_backend_sheepdog.c
src/storage/storage_driver.c
src/test/test_driver.c
src/uml/uml_conf.c
src/uml/uml_driver.c
src/util/iohelper.c
src/util/memory.c [deleted file]
src/util/memory.h [deleted file]
src/util/pci.c
src/util/sexpr.c
src/util/stats_linux.c
src/util/storage_file.c
src/util/sysinfo.c
src/util/threadpool.c
src/util/threads-pthread.c
src/util/threads-win32.c
src/util/util.c
src/util/uuid.c
src/util/viralloc.c [new file with mode: 0644]
src/util/viralloc.h [new file with mode: 0644]
src/util/viraudit.c
src/util/virauth.c
src/util/virauthconfig.c
src/util/virbitmap.c
src/util/virbuffer.c
src/util/vircgroup.c
src/util/vircommand.c
src/util/virconf.c
src/util/virdbus.c
src/util/virdnsmasq.c
src/util/virebtables.c
src/util/vireventpoll.c
src/util/virfile.c
src/util/virhash.c
src/util/virhook.c
src/util/virinitctl.c
src/util/viriptables.c
src/util/virjson.c
src/util/virkeyfile.c
src/util/virlockspace.c
src/util/virlog.c
src/util/virnetdev.c
src/util/virnetdevbandwidth.c
src/util/virnetdevbridge.c
src/util/virnetdevmacvlan.c
src/util/virnetdevopenvswitch.c
src/util/virnetdevtap.c
src/util/virnetdevveth.c
src/util/virnetdevvlan.c
src/util/virnetdevvportprofile.c
src/util/virnetlink.c
src/util/virnodesuspend.c
src/util/virobject.c
src/util/virpidfile.c
src/util/virprocess.c
src/util/virstring.c
src/util/virterror.c
src/util/virtime.c
src/util/virtypedparam.c
src/util/viruri.c
src/util/virusb.c
src/util/xml.c
src/vbox/vbox_MSCOMGlue.c
src/vbox/vbox_XPCOMCGlue.c
src/vbox/vbox_tmpl.c
src/vmware/vmware_conf.c
src/vmware/vmware_driver.c
src/vmx/vmx.c
src/xen/block_stats.c
src/xen/xen_driver.c
src/xen/xen_hypervisor.c
src/xen/xen_inotify.c
src/xen/xend_internal.c
src/xen/xm_internal.c
src/xen/xs_internal.c
src/xenapi/xenapi_driver.c
src/xenapi/xenapi_utils.c
src/xenxs/xen_sxpr.c
src/xenxs/xen_xm.c
tests/commandhelper.c
tests/commandtest.c
tests/conftest.c
tests/cputest.c
tests/esxutilstest.c
tests/networkxml2conftest.c
tests/openvzutilstest.c
tests/qemuhelptest.c
tests/qemumonitortest.c
tests/qemumonitortestutils.c
tests/qemuxml2argvtest.c
tests/securityselinuxtest.c
tests/sockettest.c
tests/testutils.c
tests/testutils.h
tests/testutilslxc.c
tests/testutilsqemu.c
tests/utiltest.c
tests/virauthconfigtest.c
tests/virbuftest.c
tests/virdrivermoduletest.c
tests/virhashtest.c
tests/virkeyfiletest.c
tests/virlockspacetest.c
tests/virnetmessagetest.c
tests/virnetsockettest.c
tests/virnettlscontexttest.c
tests/virstringtest.c
tests/virtimetest.c
tests/viruritest.c
tests/vmx2xmltest.c
tests/xmconfigtest.c
tests/xml2vmxtest.c
tools/console.c
tools/virsh-domain-monitor.c
tools/virsh-domain.c
tools/virsh-host.c
tools/virsh-interface.c
tools/virsh-network.c
tools/virsh-nodedev.c
tools/virsh-nwfilter.c
tools/virsh-pool.c
tools/virsh-secret.c
tools/virsh-snapshot.c
tools/virsh-volume.c
tools/virsh.c
tools/virt-host-validate-common.c

diff --git a/cfg.mk b/cfg.mk
index f4431c05900e11e1b23b2991939f80ea8f7bbe1e..cdd02e4c78f1f8604be6f937cbd5224762c710c5 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -321,7 +321,7 @@ sc_prohibit_internal_functions:
 # Avoid raw malloc and free, except in documentation comments.
 sc_prohibit_raw_allocation:
        @prohibit='^.[^*].*\<((m|c|re)alloc|free) *\([^)]'              \
-       halt='use VIR_ macros from memory.h instead of malloc/free'     \
+       halt='use VIR_ macros from viralloc.h instead of malloc/free'   \
          $(_sc_search_regexp)
 
 # Avoid functions that can lead to double-close bugs.
@@ -785,7 +785,7 @@ exclude_file_name_regexp--sc_prohibit_fork_wrappers = \
 exclude_file_name_regexp--sc_prohibit_gethostname = ^src/util/util\.c$$
 
 exclude_file_name_regexp--sc_prohibit_internal_functions = \
-  ^src/(util/(memory|util|virfile)\.[hc]|esx/esx_vi\.c)$$
+  ^src/(util/(viralloc|util|virfile)\.[hc]|esx/esx_vi\.c)$$
 
 exclude_file_name_regexp--sc_prohibit_newline_at_end_of_diagnostic = \
   ^src/rpc/gendispatch\.pl$$
@@ -794,7 +794,7 @@ exclude_file_name_regexp--sc_prohibit_nonreentrant = \
   ^((po|tests)/|docs/.*py|run.in$$)
 
 exclude_file_name_regexp--sc_prohibit_raw_allocation = \
-  ^(src/util/memory\.[ch]|examples/.*)$$
+  ^(src/util/viralloc\.[ch]|examples/.*)$$
 
 exclude_file_name_regexp--sc_prohibit_readlink = \
   ^src/(util/util|lxc/lxc_container)\.c$$
index f61f08df3a9e3e6d27992cd9fca7ba21ff70ba46..b979a23240540ae6e65776468414927648cfea1a 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "libvirtd-config.h"
 #include "virconf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "rpc/virnetserver.h"
index 2a2897a3c127a04679f8aac1f843e53e122a2520..9f82c993384931f1e90a4aeb1558215680181287 100644 (file)
@@ -46,7 +46,7 @@
 #include "util.h"
 #include "uuid.h"
 #include "remote_driver.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virconf.h"
 #include "virnetlink.h"
 #include "virnetserver.h"
index bb38689604fd0259c64f15bd9b1dbc91d05c8f95..7c7f80622b27c8fb8481db681e8c13bf7ebc08b0 100644 (file)
@@ -33,7 +33,7 @@
 #include "libvirtd.h"
 #include "libvirt_internal.h"
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "util.h"
 #include "stream.h"
index d63e0092e19d474236a0efa4697f22f51e4ca53e..f208139ee4fcd4150305e47e4c60250abed4d556 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "stream.h"
 #include "remote.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virnetserverclient.h"
 #include "virterror_internal.h"
index eda8a1104eeb6e4e3563e6c2207afacc03ad041b..644f34ddfcbfb2a2065f576b8d1fb4462215b49a 100644 (file)
@@ -24,7 +24,7 @@
 #include "libvirt/virterror.h"
 #include "typewrappers.h"
 #include "libvirt.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virtypedparam.h"
 #include "ignore-value.h"
 #include "util.h"
index d633603c8f4ca7789225162708826a3bc16269b9..9ba8790c42eca9202b9d709d73f3461d6ecc3d60 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "typewrappers.h"
 
-#include "memory.h"
+#include "viralloc.h"
 
 #ifndef Py_CAPSULE_H
 typedef void(*PyCapsule_Destructor)(void *, void *);
index 59958c6679d8c7045936a5803cbc9def59e5824c..25c7cca96ca4147c120467f379d4c5c9e12d3622 100644 (file)
@@ -53,7 +53,6 @@ augeastest_DATA =
 # These files are not related to driver APIs. Simply generic
 # helper APIs for various purposes
 UTIL_SOURCES =                                                 \
-               util/memory.c util/memory.h                     \
                util/pci.c util/pci.h                           \
                util/processinfo.c util/processinfo.h           \
                util/sexpr.c util/sexpr.h                       \
@@ -66,6 +65,7 @@ UTIL_SOURCES =                                                        \
                util/threadpool.c util/threadpool.h             \
                util/uuid.c util/uuid.h                         \
                util/util.c util/util.h                         \
+               util/viralloc.c util/viralloc.h                 \
                util/virarch.h util/virarch.c                   \
                util/viratomic.h util/viratomic.c               \
                util/viraudit.c util/viraudit.h                 \
index 76db89a65bac95d08b8378329b886bffc9288500..694e9b93dc5e9a21cf4f9999c8c116ef1c6c610d 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "capabilities.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "uuid.h"
 #include "cpu_conf.h"
index 9b865712643e9ff5bcc67603d87ad5a4c1126e2e..601136149669ff98dd9f3e68ba9029f1abd81d05 100644 (file)
@@ -24,7 +24,7 @@
 #include <config.h>
 
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virbuffer.h"
 #include "cpu_conf.h"
index daf57bc380f8fd35d3f88f5c4c223be2a64be0ca..c3ca2d6d7b75e332099b41b5eb6c36302c8326f7 100644 (file)
@@ -23,7 +23,7 @@
 #include <config.h>
 #include "virterror_internal.h"
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "xml.h"
 #include "uuid.h"
 #include "util.h"
index a73c7231c273ee68bedabc000dca2993cf8a6450..8919e620f95378e6ef3cbfd199451a3711721991 100644 (file)
@@ -30,7 +30,7 @@
 #include "viraudit.h"
 #include "uuid.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 
 /* Return nn:mm in hex for block and character devices, and NULL
  * for other file types, stat failure, or allocation failure.  */
index 30b1a0fa4a9a079bafa4f00ed65130f7d27a7884..721a7f33054b16be201add9faeef648e85e82a90 100644 (file)
@@ -34,7 +34,7 @@
 #include "datatypes.h"
 #include "domain_conf.h"
 #include "snapshot_conf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "verify.h"
 #include "xml.h"
 #include "uuid.h"
index f1e247b7a78c4cd34a52e67d39d89078df15c89b..d5238088e14a339bab3acb4a33983aa409af58ee 100644 (file)
@@ -26,7 +26,7 @@
 #include "domain_event.h"
 #include "virlog.h"
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
index 738ef336ae32b15fc8fca868187ec9a31994e135..046a8a1780c81d63af6934a692f13ff1c2ae98d0 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "interface_conf.h"
 
-#include "memory.h"
+#include "viralloc.h"
 #include "xml.h"
 #include "uuid.h"
 #include "util.h"
index 15840b92d163c48d65a9c51cd16e9f7579c91e23..35f067c81ed2158a3aa3e91d1e3e4f7cd8657f21 100644 (file)
@@ -25,7 +25,7 @@
 #include "netdev_bandwidth_conf.h"
 #include "virterror_internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "domain_conf.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
index 6a0511af9a8060bb41d46be14d7e30d9c0a75cb8..8cee025678d229926278550fcb323e169d042d37 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "netdev_vlan_conf.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
index 94992e3087afe17b4a70be3a714935dfbb653889..a9a38d70230b3b6ffce7c2ead2c67d593edceddb 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "netdev_vport_profile_conf.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
index 42cb87e4004060db56ade3f1d36d8815efe15c1a..1932851807c9b43bbec46579b7b07ef2b373c75a 100644 (file)
@@ -37,7 +37,7 @@
 #include "netdev_vport_profile_conf.h"
 #include "netdev_bandwidth_conf.h"
 #include "netdev_vlan_conf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "xml.h"
 #include "uuid.h"
 #include "util.h"
index 50fcf0b59dadd6412671db9f7d5127ff44fb512e..85de50f3842d4479bce4a1a947354355f516ffdd 100644 (file)
 
 #include "virterror_internal.h"
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 
 #include "node_device_conf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "xml.h"
 #include "util.h"
 #include "virbuffer.h"
index 46580e9eb9083bb050f4ad93fafa25804a32dcd6..09a9d1cefa7f014c721d8943bd7552f18320cafa 100644 (file)
@@ -39,7 +39,7 @@
 #include "internal.h"
 
 #include "uuid.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "nwfilter_params.h"
index f8cf98025b203aa435ebe06b9878499b500dd165..142995297eae3c3bfb3396e5df19a9ed36b90bb0 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "internal.h"
 
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "nwfilter_params.h"
index 24d7aa0df5a34f36a6c287c832b1534e171e1a36..5188c7a653f2a6f5300423bede8b5c2b75be87e3 100644 (file)
@@ -26,7 +26,7 @@
 #include "virbuffer.h"
 #include "datatypes.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "secret_conf.h"
 #include "virterror_internal.h"
 #include "util.h"
index 63618102ea41c7b60aeabc74b39f84a46b3accb1..9c16a884d57f1b7c882cd9d16bb54cdae07b3c30 100644 (file)
@@ -35,7 +35,7 @@
 #include "datatypes.h"
 #include "domain_conf.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "netdev_bandwidth_conf.h"
 #include "netdev_vport_profile_conf.h"
 #include "nwfilter_conf.h"
index b81c08cf974a8bbf30f566a166983d72d8cda8f4..0e005888013d2252f3d6624d19d47dc64f828afa 100644 (file)
@@ -42,7 +42,7 @@
 #include "uuid.h"
 #include "virbuffer.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virfile.h"
 
 #define VIR_FROM_THIS VIR_FROM_STORAGE
index 0c2bded1e5f5e4a79d736e25f0f6a625b75b8c7c..8d3ceac196918db86614d25832bff4dc16792c1e 100644 (file)
@@ -28,7 +28,7 @@
 #include "internal.h"
 
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "storage_conf.h"
 #include "storage_encryption_conf.h"
 #include "util.h"
index 92179ccc2d01933c3567400313edbeb3c0ffcb64..757573d7992e71647f3f5841d345835f7442227c 100644 (file)
@@ -32,7 +32,7 @@
 #include "fdstream.h"
 #include "internal.h"
 #include "threads.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virpidfile.h"
 #include "virlog.h"
 #include "virterror_internal.h"
index be1f4cecae1ee81f31d646df27060e5e9c5932f7..302629dd6a52daa823ae893251d78c985f83ac53 100644 (file)
@@ -24,7 +24,7 @@
 #include <config.h>
 
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "xml.h"
 #include "cpu.h"
 #include "cpu_x86.h"
index 36c9db03078c2e4b4372d90c18cd840326aa3f63..cfe1a236cafdadcc9cc346ca46a8eb2d400892fb 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#include "memory.h"
+#include "viralloc.h"
 #include "cpu.h"
 
 #define VIR_FROM_THIS VIR_FROM_CPU
index b10ff47a2520baef32c8fb61bd17c1aec1760b65..5dfa6a21a4e9551c9f954ea54cd499ac990ca3fc 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <config.h>
 
-#include "memory.h"
+#include "viralloc.h"
 #include "virhash.h"
 #include "cpu.h"
 #include "cpu_generic.h"
index 8c4cfee5d3027b0e5fc7de5f1cf06a0f4db328e4..015be2e320a1042216a4edf7ec7d7bc417772a4c 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#include "memory.h"
+#include "viralloc.h"
 #include "cpu.h"
 #include "cpu_map.h"
 #include "configmake.h"
index 26991d80235e45bfcdee2d79b7419b99f6fe891c..cbc813b489b542734d0366f6a30c20083d0e89bc 100644 (file)
@@ -27,7 +27,7 @@
 #include <stdint.h>
 
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "cpu.h"
 
index ffbad036c5995c39e99ae5e7463e75be8847a8e8..998197c9049176d36cf44f5eddf8833201bcc9a4 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <config.h>
 
-#include "memory.h"
+#include "viralloc.h"
 #include "cpu.h"
 
 
index 2970573c774f8a3a180acb0a86fdcf7d975ab8cb..55e20c9a4624ffc7c3e508809e44be7ba1e19471 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdint.h>
 
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "cpu.h"
 #include "cpu_map.h"
index 73a2fd05f3aeaa8f11f08d3626bb55134907422e..0907c7daba5fd386fc12e636daddf4a7f54eadc6 100644 (file)
@@ -25,7 +25,7 @@
 #include "datatypes.h"
 #include "virterror_internal.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "uuid.h"
 #include "util.h"
 
index 4ef6fd2d5f9f87e4796364dd6bd2a9911f4a2dfd..23dc329cddc97efbe015b4c30607665353e665d9 100644 (file)
@@ -25,7 +25,7 @@
 #include <unistd.h>
 
 #include "driver.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "util.h"
 #include "configmake.h"
index 0ad95f51067a03582d975356447e4d796801a78d..854fc385950ab7d6325911399f5014f229ad49f9 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "esx_private.h"
index 488d18dd0ea86ba3faeac5482152deb92a0a85ba..346b9bc2210b2801a2ace6981dca75b387b0881a 100644 (file)
@@ -29,7 +29,7 @@
 #include "snapshot_conf.h"
 #include "virauth.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "vmx.h"
index 4760264441942fabee5ad807393909dca32c313f..fea67ab3caeb3d97ba204b19a3b49d787214468d 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "interface_conf.h"
index 3e25aa2df68abc2c0b57a7e738d545dee5bbbf4f..fec7e72af535c96f923b193b03cebd46d14646de 100644 (file)
@@ -27,7 +27,7 @@
 #include "md5.h"
 #include "internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "network_conf.h"
index f5e710d5a20d8dd7ad898afdd0116deaabadbfb5..7a05a5a2542094da55d0af02dcf6e1d8a4c55004 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "esx_private.h"
index 2a98644d263677a2afa877f90dc63f03b729d0dd..2969b1967d9b4f69d44d7e6c75fa15422e940928 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "esx_private.h"
index 5d4eb3cb7d50be3a1352af6e9a25fb451091df8d..9d481d25b2e5678dc59f803d3bf4a737193cd959 100644 (file)
@@ -29,7 +29,7 @@
 #include "internal.h"
 #include "md5.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "storage_conf.h"
index c8bba9e7a93fab5d80e930f1733c1b9223120824..bca637b5b18e3f6d480f533954891a8b86859e7c 100644 (file)
@@ -32,7 +32,7 @@
 #include "internal.h"
 #include "md5.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "storage_conf.h"
index e6c09aae68850228ded1381d135fb5bf85ea0bbe..13244695850cab5090d9af215228d428701c53b1 100644 (file)
@@ -26,7 +26,7 @@
 #include <config.h>
 
 #include "uuid.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "storage_conf.h"
 #include "esx_private.h"
 #include "esx_storage_driver.h"
index 6e27fe468c0556cb14b0b7d5bc7ce07697d9d155..bcda9df66c760d9e8a4b45da8e6d4c09a61524c4 100644 (file)
@@ -29,7 +29,7 @@
 #include "internal.h"
 #include "datatypes.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "vmx.h"
index 76192dfd5998f5a62542588733b826a45da17bc4..37b6e0f627c5edb94f6d6bbbf612382a33fd1216 100644 (file)
@@ -27,7 +27,7 @@
 #include <libxml/xpathInternals.h>
 
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "util.h"
 #include "uuid.h"
index a3870ee8da0b165e60650981d5b29d86f923319e..7ffca559d6df98b65079007c3a4a893a9a0f2bf8 100644 (file)
@@ -24,7 +24,7 @@
 #include <config.h>
 
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "esx_vi_methods.h"
index d0a2c6c427cc92a0adca73538765b3276622e249..b93223d634b2f2c21e912e460e8508191c1751a4 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "virbuffer.h"
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "util.h"
 #include "esx_vi.h"
index fdbd7a20ee28491741df775d2ab6b20500385a17..39e92b829cfaf8f2faa4f55cbb8fc098635508d6 100644 (file)
@@ -36,7 +36,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virfile.h"
 #include "configmake.h"
index 1fa98b2fb399f820e7703fd1112aacf8d8f2bcd5..d6edb76c71c694ade62a205b30df6ba7ddfec72c 100644 (file)
@@ -27,7 +27,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "hyperv_device_monitor.h"
index 95b0cd96eda3fe87510a44ae1b2158eca5a4a989..749c7f01f48bbbc0b59edf4d55c7c3be76f55af4 100644 (file)
@@ -28,7 +28,7 @@
 #include "domain_conf.h"
 #include "virauth.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "hyperv_driver.h"
index 6a3c2cbea35cb5234e2a70b94063e84dff9853d3..43c7dd7698224b223da4e2452680218829258b3d 100644 (file)
@@ -27,7 +27,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "hyperv_interface_driver.h"
index 2f9fcab0e04d82be2e188da0e85d973dd7c39185..06b051bc336d04bbc19bee32bb3a8788c788117a 100644 (file)
@@ -27,7 +27,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "hyperv_network_driver.h"
index c490522405bca13b51fde3520fa03ade32f82d2a..7452b7abed08938bc73ef996e35b3a17ab6cc968 100644 (file)
@@ -27,7 +27,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "hyperv_nwfilter_driver.h"
index 3d58b016d9df6b1d2df47495c8ae12e77b35bd8a..04a6adaf052f1352aa0d3a4d00af0a35f9901b0f 100644 (file)
@@ -27,7 +27,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "hyperv_secret_driver.h"
index 7fbc14ded02c433884c7bfca1be37c4cebf92365..b2817a2dd96efa39e04d67921f8df1ab1ce28260 100644 (file)
@@ -27,7 +27,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "hyperv_storage_driver.h"
index 1ef6dae4524f044085c813028bf316f018918bda..016d415ae961518e5dd34a68019ab55f361f98cd 100644 (file)
@@ -25,7 +25,7 @@
 #include "internal.h"
 #include "datatypes.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "hyperv_private.h"
index 069ebe68693837b7cc1864176d2d8b43be50ac3d..69e7283e9cbac99bbad499abcf024ea3fbd08530 100644 (file)
@@ -28,7 +28,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "uuid.h"
 #include "virbuffer.h"
index 1f42920f2c3cd5465d5230168bb438f6aa474028..74a749b357b55830636241f5bcd3c0205b1132a5 100644 (file)
@@ -29,7 +29,7 @@
 #include "datatypes.h"
 #include "interface_driver.h"
 #include "interface_conf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 
 #define VIR_FROM_THIS VIR_FROM_INTERFACE
index 9233e87a7f0b9399cea710db95a41f28121172c7..248b02e393bd0289ba863e4ecb9fff9a3053cb41 100644 (file)
@@ -27,7 +27,7 @@
 #include "datatypes.h"
 #include "interface_driver.h"
 #include "interface_conf.h"
-#include "memory.h"
+#include "viralloc.h"
 
 #define VIR_FROM_THIS VIR_FROM_INTERFACE
 
index d078304be84b719b709c0eeb949b5d15518b445d..ed7dcaef1faa46460fada477a11f1399f6b1853e 100644 (file)
@@ -51,7 +51,7 @@
 #include "driver.h"
 
 #include "uuid.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "configmake.h"
 #include "intprops.h"
 #include "virconf.h"
index 0ccab50a2aba6aea3c578bb6ecb4f60df452b7c4..5b20c395e91c8688b1e78aa74211faae8880d596 100644 (file)
@@ -36,7 +36,7 @@
 #include "datatypes.h"
 #include "virfile.h"
 #include "virstring.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "uuid.h"
 #include "capabilities.h"
 #include "libxl_driver.h"
index b7e6630f3d704dad893b0e1dc9931d410f5f991e..4db2614004215039b367a3afbec5706d31dc7f2c 100644 (file)
@@ -36,7 +36,7 @@
 #include "virconf.h"
 #include "datatypes.h"
 #include "virfile.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "uuid.h"
 #include "vircommand.h"
 #include "libxl.h"
index 00861cfec067de30236cbf71c3749d3d7e42d089..0ae9750092dc66690e056d22dc4b30464612f6a0 100644 (file)
@@ -22,7 +22,7 @@
 #include <config.h>
 
 #include "domain_lock.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "uuid.h"
 #include "virterror_internal.h"
 #include "virlog.h"
index 3c2a50c15a240b6d81fb16ad5c93bc8f2d7c92b8..3d90c57a3c887f8ec1423507e28581c599bd29a0 100644 (file)
@@ -39,7 +39,7 @@
 #include "virprocess.h"
 #include "virterror_internal.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virconf.h"
 #include "rpc/virnetserver.h"
 #include "virrandom.h"
index 9557b8c2bb4fd3c65c07e8159954f36db1c91739..e370dd465c0919b3b6b3fa25ca9e8bab707fd03e 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "lock_daemon_config.h"
 #include "virconf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "rpc/virnetserver.h"
index d5d721d6d3ec787e79d0807fa7c706dee2a36ec4..cee530d80d8bd82ddbf8ccc1906e46ce292ede3a 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "lock_driver.h"
 #include "virconf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "util.h"
index 745a0bf41c63b66964905101d93cabaa71183392..cf0f49a3bc0007ea52692d30872f316d83c9ba93 100644 (file)
@@ -22,7 +22,7 @@
 #include <config.h>
 
 #include "lock_driver_nop.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 
index 1e8df2625d1d7a3d410433d5071927563e715771..e5204440d5aadf092800bb43e75977f05ec89c85 100644 (file)
@@ -39,7 +39,7 @@
 #include "lock_driver.h"
 #include "virlog.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virfile.h"
 #include "md5.h"
index f038d4e27f3f23d8deb6467adf35081dea14a4ae..f938b04a58dc8744bac883d97c27bb4aeb686ace 100644 (file)
@@ -26,7 +26,7 @@
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "uuid.h"
 
 #if HAVE_DLFCN_H
index ad69312c2f2daa9947f48e4dd9d66f8d977113f0..3e400b7605a733b9d257b5525ad6318e37ad548d 100644 (file)
@@ -6,7 +6,7 @@
 #include "configmake.h"
 #include "internal.h"
 #include "virconf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "domain_conf.h"
 
 
index d023b84b1b929cbaf6c208736bbce41fabe9783a..74f31566539f69ff6421521ef1beb07fa5822be8 100644 (file)
@@ -26,7 +26,7 @@
 #include "virfile.h"
 #include "virterror_internal.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "vircgroup.h"
 
 #define VIR_FROM_THIS VIR_FROM_LXC
index a5ba2f75687409eac360bc59f50d23cc6302bf4f..ede79d154f45378f7a438444e9e60dd23fa5463d 100644 (file)
@@ -30,7 +30,7 @@
 #include "nodeinfo.h"
 #include "virterror_internal.h"
 #include "virconf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "configmake.h"
index 760d3af631ca603d8263ff1ae585d479d9f9fb67..6b66fdebabdcd1436c9e98d5b300ec48a5ac2847 100644 (file)
@@ -57,7 +57,7 @@
 #include "virlog.h"
 #include "lxc_container.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virnetdevveth.h"
 #include "uuid.h"
 #include "virfile.h"
index f0e08e33919ff8a0ce31746d2a2e186a92445974..4520a5f0d9d26e70aea6d94bf6c0a5214d586fa8 100644 (file)
@@ -62,7 +62,7 @@
 #include "lxc_fuse.h"
 #include "virnetdev.h"
 #include "virnetdevveth.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virfile.h"
 #include "virpidfile.h"
index 77a64dd134c08db3e038fabb647bccf61e0e80cf..fab150630d833d42aada1dc3147493ee824755ab 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "lxc_domain.h"
 
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virterror_internal.h"
 
index 826532838be3b29646272167138e69274103a09b..a595dd99f1c634e2816584402bb645996a320bee 100644 (file)
@@ -45,7 +45,7 @@
 #include "lxc_domain.h"
 #include "lxc_driver.h"
 #include "lxc_process.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virnetdevbridge.h"
 #include "virnetdevveth.h"
index a888122069c0dd7ed28367886076efb7ee7128ba..987801710648ccae916936a0224d4c5213a068b2 100644 (file)
@@ -33,7 +33,7 @@
 
 # include "lxc_conf.h"
 # include "util.h"
-# include "memory.h"
+# include "viralloc.h"
 
 struct virLXCMeminfo {
     unsigned long long memtotal;
index aa450ecfe8eb039b69313350cf5e4bb575e8229e..f01fc5630c242bce4eeb1e45fdf577af059d1861 100644 (file)
@@ -24,9 +24,9 @@
 #include <config.h>
 
 #include "lxc_hostdev.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virterror_internal.h"
-#include "memory.h"
 
 #define VIR_FROM_THIS VIR_FROM_LXC
 
index 9eb587d8af4b4d0e904663a0b7ffee4833cc4f63..90637ebd1ff2577dfe1cbad12a971f656e7ec31c 100644 (file)
@@ -25,7 +25,7 @@
 #include "lxc_protocol.h"
 #include "lxc_monitor_dispatch.h"
 
-#include "memory.h"
+#include "viralloc.h"
 
 #include "virterror_internal.h"
 #include "virlog.h"
index 762a23de2f2a1d58d7819852062bc2341274b652..00bc1c62beea54ec132e77c91637eeed436846a2 100644 (file)
@@ -38,7 +38,7 @@
 #include "virtime.h"
 #include "domain_nwfilter.h"
 #include "network/bridge_driver.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "domain_audit.h"
 #include "virterror_internal.h"
 #include "virlog.h"
index e33650384fd9717b39dce77b5289769752d4d5a3..2265e5f3c6a19063831a2adfe378ec456202c0fb 100644 (file)
@@ -54,7 +54,7 @@
 #include "virpidfile.h"
 #include "util.h"
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "uuid.h"
 #include "viriptables.h"
 #include "virlog.h"
index 48360e3b73afd044b1b596f8a82a9d3a1962faaf..d91481652213a3ea306584991be8e1cef2f501ae 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "virterror_internal.h"
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "node_device_conf.h"
 #include "node_device_hal.h"
index 59ba5c384c325768d2f57f6b62036dd07c0d0cd8..6f89f169d53dbee87ba0e531cc18069396bb6bd0 100644 (file)
@@ -33,7 +33,7 @@
 #include "virterror_internal.h"
 #include "driver.h"
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "uuid.h"
 #include "pci.h"
 #include "virlog.h"
index fbe0da517b431c94d3393569708c617c7082d04c..be5d3ed9f185870a327652a6c54dc56a706a2692 100644 (file)
@@ -29,7 +29,7 @@
 #include "node_device_driver.h"
 #include "node_device_hal.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virfile.h"
 
index fef00ad131b7b7b968a5d7fa1029ae412e48a0f7..81a11d7120ec32a02f0c017b1224c2cab3f9cd4d 100644 (file)
@@ -33,7 +33,7 @@
 #include "driver.h"
 #include "datatypes.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "uuid.h"
 #include "util.h"
 #include "virbuffer.h"
index 0a456fa5dc67455925ea236ad993905f12889e74..71a52afcc6809ce7ec3dd7d4bbde2e62e2d69524 100644 (file)
@@ -44,7 +44,7 @@
 #endif
 
 #include "c-ctype.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "nodeinfo.h"
 #include "physmem.h"
 #include "util.h"
index 68aa233fbfc80e2216d2519eec22db5efd1f7fc0..a798e951d2f599a38e4b9ef65ff9d30dfd4989ec 100644 (file)
@@ -54,7 +54,7 @@
 #include <netinet/udp.h>
 #include <net/if.h>
 
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "datatypes.h"
 #include "virterror_internal.h"
index 7fde656bf7b24f2557ca3ac4748fff5672832810..4b1188db288bcfb029d98d22d3054a78e444bafb 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "virterror_internal.h"
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "domain_conf.h"
 #include "domain_nwfilter.h"
 #include "nwfilter_conf.h"
index 23a43d2da312ed98fb2dfb9d9e44e7e011fd360d..092ae5a15d20846e5caa6d8b9e71718c326bf6a3 100644 (file)
@@ -31,7 +31,7 @@
 #include "internal.h"
 
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virterror_internal.h"
 #include "domain_conf.h"
index 6be4a930f81c3b3cb865eebc2526a3e6401eb643..2b4cc8e3192230526003d5fbaaede93e2c7d9a2b 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "internal.h"
 
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "domain_conf.h"
 #include "virterror_internal.h"
index 110eae845e32149b35e7e64355ccaf1e9f090b5f..8c4bbcfb79e67f06fb3407cec4aa1b76edd92df6 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "intprops.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "datatypes.h"
 #include "virnetdev.h"
index 5448a331efe254fda35133d597f3fc6b498cc6f0..7e42b51f5ea209a4323c234623edd6e22648b62b 100644 (file)
@@ -47,7 +47,7 @@
 #include "openvz_util.h"
 #include "uuid.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "nodeinfo.h"
 #include "virfile.h"
index e51bf296c13277fa5d938caa65c41e4881d572de..4c884998e248768576b1a3b6d2edea2c4db267ee 100644 (file)
@@ -52,7 +52,7 @@
 #include "util.h"
 #include "openvz_conf.h"
 #include "nodeinfo.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virfile.h"
 #include "virtypedparam.h"
 #include "virlog.h"
index 4163e196724ae01660aaf2b32d0594d8b1ec65b9..51b22c9492ad8c20db8249af76177cb3196ca0ff 100644 (file)
@@ -28,7 +28,7 @@
 #include "virterror_internal.h"
 #include "vircommand.h"
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 
 #include "openvz_conf.h"
 #include "openvz_util.h"
index cc65117b0e98f2a90e418810beaa74ed06319389..e3d2711a7954d4febafd87e4927d9c9f8404a1d8 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "datatypes.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virlog.h"
 #include "vircommand.h"
index 40706aafa054714bcf9214bd709aeee936d3de04..4729f187dfa26433e7f51218466ac4bd9d5fdf48 100644 (file)
@@ -23,7 +23,7 @@
 #include <config.h>
 
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "md5.h"
 
index 90fa10434872305daf112a1a683a60a5bd0de061..f546d28d6d36b90c0eebd440918016ec239f64a0 100644 (file)
@@ -31,7 +31,7 @@
 #include <libgen.h>
 
 #include "datatypes.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "configmake.h"
 #include "storage_file.h"
 #include "virterror_internal.h"
index b032882ea75e91dcdb8979397929b77710a0cfae..9e317b11920d61cb16d8a1a40e50a90c2019d958 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "vircommand.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virjson.h"
 
 #include "parallels_utils.h"
index f1d994c02e42ee4f30d6b69c3690661c9e2a7b57..b09156ff3f6a55f4df0700c289b36e1f890d1123 100644 (file)
@@ -47,7 +47,7 @@
 #include "util.h"
 #include "datatypes.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "driver.h"
 #include "libvirt/libvirt.h"
index 421e43f0945ef489d2e401b5b1ed288b77b5cf46..ec1e3002e06ac5dd4365f06b73f80be597eeba04 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "qemu_agent.h"
 #include "qemu_command.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virterror_internal.h"
 #include "virjson.h"
index 592ddd1e73aee2630773e6190a448ed374530328..ba2e30f0a0c8032f942cf9e30d3b5592e4408ca5 100644 (file)
@@ -24,7 +24,7 @@
 #include <config.h>
 
 #include "qemu_capabilities.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virterror_internal.h"
 #include "util.h"
index 80ceee5459de10968356c10f72713d3d51b7f8c4..de4a5be9617c62ed6b417974c808c96783c42d6e 100644 (file)
@@ -28,7 +28,7 @@
 #include "qemu_process.h"
 #include "vircgroup.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "util.h"
 #include "domain_audit.h"
index 52a96b941cfe75ce81eaf787c53c4f513eb9e451..2a5b08d3cba4f87cde0385fc80c538aef83f1bd7 100644 (file)
@@ -28,7 +28,7 @@
 #include "qemu_capabilities.h"
 #include "qemu_bridge_filter.h"
 #include "cpu/cpu.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virterror_internal.h"
 #include "util.h"
index 2073fd5acb3d015b2e91c909e43f834d7498199a..9e0789f835b96c841443a757cbe00db27b75a45e 100644 (file)
@@ -43,7 +43,7 @@
 #include "virbuffer.h"
 #include "virconf.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "datatypes.h"
 #include "xml.h"
 #include "nodeinfo.h"
index e6eaa58413df01ba189c1ca2026435562c88a5cf..8dcadbc57951a9be98f28be7bf635e1c3c3ff54f 100644 (file)
@@ -27,7 +27,7 @@
 #include "qemu_command.h"
 #include "qemu_capabilities.h"
 #include "qemu_migration.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virterror_internal.h"
 #include "c-ctype.h"
index 4d81a730ecb3eeeff22ff1611b64d239dfd4a9fa..d97fc165826e72e1af2864195c1c6b247df72e0b 100644 (file)
@@ -66,7 +66,7 @@
 #include "nodeinfo.h"
 #include "stats_linux.h"
 #include "capabilities.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "uuid.h"
 #include "domain_conf.h"
 #include "domain_audit.h"
index 94b5ae003acc9e83b9b206283d5b6870f52f39d2..051f0d914a81b8f40acc6c434edadf5e09b571a2 100644 (file)
@@ -26,7 +26,7 @@
 #include "qemu_hostdev.h"
 #include "virlog.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "pci.h"
 #include "virusb.h"
 #include "virnetdev.h"
index f8420c4c3d325af5c980a74278366b6bb0ad715a..37e3ada129fe3a6fbe99c4b9e1290882f997373f 100644 (file)
@@ -35,7 +35,7 @@
 #include "virlog.h"
 #include "datatypes.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "pci.h"
 #include "virfile.h"
 #include "qemu_cgroup.h"
index 4248298ee81e7ec46b7ddfa295d785f10a4af2b0..ff453beaef5cc7214f22a99fa70299d9cabea9a7 100644 (file)
@@ -38,7 +38,7 @@
 #include "domain_audit.h"
 #include "virlog.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virfile.h"
 #include "datatypes.h"
index 920453d27028722b39c682c72dcdb951e15e01f1..5ca1f899945f12e2fd99a2f069aeaa0d7cde9346 100644 (file)
@@ -32,7 +32,7 @@
 #include "qemu_monitor_text.h"
 #include "qemu_monitor_json.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virfile.h"
 #include "virprocess.h"
index e14134b47a29cb57c749336b47a582dd3bac165f..0137291dddf0f1d176f72be80cbab4dcbc155c10 100644 (file)
@@ -35,7 +35,7 @@
 #include "qemu_monitor_json.h"
 #include "qemu_command.h"
 #include "qemu_capabilities.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "driver.h"
 #include "datatypes.h"
index 28690b16cbfc117851deccf33e43f28efd760413..82e9108d8aefa299919e29a39ee4f5e215255bc2 100644 (file)
@@ -34,7 +34,7 @@
 #include "qemu_command.h"
 #include "c-ctype.h"
 #include "c-strcasestr.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "driver.h"
 #include "datatypes.h"
index 00ff24302e8fbc156e48e8999ff55ccaa42dd83c..c43c968e7611d0f1cdc61366842b7f6fccd6044c 100644 (file)
@@ -53,7 +53,7 @@
 #include "datatypes.h"
 #include "virlog.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virhook.h"
 #include "virfile.h"
 #include "virpidfile.h"
index 1e9151ab6cfc6cd3aea7f4750a64f16a71dc28fb..2edf6e64633a2634c8f8e8c8c7e172c6736d0386 100644 (file)
@@ -38,7 +38,7 @@
 #include "remote_driver.h"
 #include "remote_protocol.h"
 #include "qemu_protocol.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virfile.h"
 #include "vircommand.h"
index 8fc1cba46b7bb193bdc9a6a588514b303340cedb..91af3157fdd08f5ec78b2b509f93b438dd22dbd5 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <config.h>
 
-#include "memory.h"
+#include "viralloc.h"
 #include "threads.h"
 #include "virfile.h"
 #include "virlog.h"
index 7370ae06d73d07c7a490b2bd359c7b384427c20c..b4fe4d94e5067cd8a591fb06b502e66be34b5e99 100644 (file)
@@ -30,7 +30,7 @@
 #include "virnetclient.h"
 #include "virnetsocket.h"
 #include "virkeepalive.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "threads.h"
 #include "virfile.h"
 #include "virlog.h"
index dec3943a892c73f64e6a5c2973cffcc6a050efb6..739697103b1d21c2ab632907ae7ac1d043a65d48 100644 (file)
@@ -28,7 +28,7 @@
 #include "virnetclient.h"
 #include "virnetprotocol.h"
 
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "util.h"
index 26dc2924c703d5316a2c733399cdecb68fb1d3c8..4877b0caf6d41dd7853ab4e77340980b74777aa3 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "virnetclientstream.h"
 #include "virnetclient.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "threads.h"
index 16d8e61ba6bf9419cac81ab151a635927e3101b6..f273811aba69e74c5464962b9bb3d0c07baba508 100644 (file)
@@ -24,7 +24,7 @@
 #include <unistd.h>
 
 #include "virnetmessage.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "virfile.h"
index e880127fcc4e101513466458911943d35b5cfd9c..adc4f1e6082a722d3090d8a7e51b9cb6ba4a9895 100644 (file)
@@ -26,7 +26,7 @@
 #include "virnetmessage.h"
 
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "threads.h"
 #include "virlog.h"
 
index 6d3532ad6e4a3ba3a27fe6ec418db857ca8fa18a..67cd4b5444ca08916f88a4da98c29885d66727df 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "virnetserver.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "threads.h"
 #include "threadpool.h"
index 9642ea5496551d2b163cec0f8277cf7180a4118a..7f028b87e7793d18b807c03af891a05fc523173d 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "virlog.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "threads.h"
 #include "virkeepalive.h"
 
index c17b65dd30501e8b426a4e08f594f052c70c27f3..daef2b4a2f42f939ac731a62078a3c53050e6f15 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "virnetservermdns.h"
 #include "vireventpoll.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 
index 5b96c34039689137349730156f1b4067547ba134..287282e321659fca2936634fc4d5bfdd5af33852 100644 (file)
@@ -26,7 +26,7 @@
 #include "virnetserverprogram.h"
 #include "virnetserverclient.h"
 
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "virfile.h"
index a9362adaf5f87661ca4461866b9b92c6db8404fc..92b5cef9bb3cc1c1d7aae7cae7d5082e18f30c3c 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "virnetserverservice.h"
 
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "threads.h"
 
index aa8f4b9c472a9b206c71f20b35c05627ab099e64..8c62a2a4adf55182c2286fe519ad7b3230018e05 100644 (file)
@@ -42,7 +42,7 @@
 #include "c-ctype.h"
 #include "virnetsocket.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "virfile.h"
index 734acaaba45a2c1360856c08b20993a4c69f673f..8a7d5f9a3d48f75bfcb7c04ee419b58107e5f28a 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "internal.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "configmake.h"
 #include "threads.h"
index 29310030df58d8e4f7a4735cd9968d0fce53ba6a..d9354e0b762082e31653f1e27b247063a450cdc4 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "virnettlscontext.h"
 
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "util.h"
 #include "virlog.h"
index 415935801fd8a77e19ffadbaa54c58e1151602ec..fb2024b1d2024363bcf2f77475c1b33805fbbc06 100644 (file)
@@ -33,7 +33,7 @@
 #include "datatypes.h"
 #include "driver.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "secret_conf.h"
 #include "secret_driver.h"
 #include "threads.h"
index 92620919ea4b879c8e0e79cb484ac7896645874d..b2678ca47e8302b3710c1f0cc5ac9276856dcf17 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "security_apparmor.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "uuid.h"
index 931ae4ee56aabee13447aa33fdbc2ce48a50daed..7084e33b6183d98475ecc41745feb6ba5fc63cc8 100644 (file)
@@ -26,7 +26,7 @@
 #include "security_dac.h"
 #include "virterror_internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "pci.h"
 #include "virusb.h"
index c675715c6881d1f89dfbf0450ff7ff1dd696be3f..d6a3f644740350bff86505be1f66c91e9ae9b4b5 100644 (file)
@@ -27,7 +27,7 @@
 #include "security_stack.h"
 #include "security_dac.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 
 #define VIR_FROM_THIS VIR_FROM_SECURITY
index 11f839f3339df28796a6ca0b2c2c7b9f0d7b99ac..ad43bc8493ee26786e4a207da04faa0cbb53215b 100644 (file)
@@ -35,7 +35,7 @@
 #include "security_selinux.h"
 #include "virterror_internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "pci.h"
 #include "virusb.h"
index 65d42406a60c4214f880812ceabf4beddeac81dd..341237204a28a38da7485ead44c020fe76cbf8f3 100644 (file)
@@ -23,7 +23,7 @@
 #include "security_stack.h"
 
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 
 #define VIR_FROM_THIS VIR_FROM_SECURITY
 
index cedffbd60c808830d5506d19f2ee239836b73ed5..32959173fddc3f1bc9169bb7e65efd5313107086 100644 (file)
@@ -42,7 +42,7 @@
 #include "internal.h"
 #include "virbuffer.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "vircommand.h"
 
 #include "security_driver.h"
index 899caeb5ed684328d6b4b94ab108df186d3b2612..cdc5bda77b15dd62a2132faec9f0e46880a64bef 100644 (file)
@@ -48,7 +48,7 @@
 #include "datatypes.h"
 #include "virterror_internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "internal.h"
 #include "secret_conf.h"
 #include "uuid.h"
index 7e1d3ecbb628f3d4a452ff528c47648732c42bdd..8759b3a8cd68875d5f2efdd2afe1210b50b30cab 100644 (file)
@@ -30,7 +30,7 @@
 #include "virlog.h"
 #include "storage_backend_disk.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "vircommand.h"
 #include "configmake.h"
 
index 78b50f003c27def6b0e035aeb712532a8ea7b664..f7b46566ab17a06dfbfa1d03ae3dff17eb89e40a 100644 (file)
@@ -46,7 +46,7 @@
 #include "storage_conf.h"
 #include "storage_file.h"
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "xml.h"
 #include "virfile.h"
 #include "virlog.h"
index 46659af4030374186b100cda5f9614bc33f9981b..ecb8f8e42d95e5497c8b11e970c7162f276bf16e 100644 (file)
@@ -38,7 +38,7 @@
 #include "storage_backend_scsi.h"
 #include "storage_backend_iscsi.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virfile.h"
 #include "vircommand.h"
index f28c663661ccc217b2c0737e932771ce6efa8fb7..83b517cde466af772e39037d07cfdc132bf202da 100644 (file)
@@ -35,7 +35,7 @@
 #include "storage_backend_logical.h"
 #include "storage_conf.h"
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virfile.h"
 
index 1ca120fb330cd6e7a2218d45bf62cbd0496ff21e..0e5d0329e5950568b208ea6cbb806eedc0fdd3a1 100644 (file)
@@ -32,7 +32,7 @@
 #include "virterror_internal.h"
 #include "storage_conf.h"
 #include "storage_backend.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virfile.h"
 
index 4e58911f8f5ca9e71fc792eefd15bbec7c47d721..e1f07abb4bc0cac4496243c7944fdaef3c2d336d 100644 (file)
@@ -26,7 +26,7 @@
 #include "storage_backend_rbd.h"
 #include "storage_conf.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "base64.h"
 #include "uuid.h"
index 32713be0c5557a98456e032602223852cd626813..1db8fdd6b35771b46277568d7f733637b2096b95 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "virterror_internal.h"
 #include "storage_backend_scsi.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virfile.h"
 #include "vircommand.h"
index 05deeeb161d8adb95daf7582e3779e4006cd55c8..d3b9d87afa56b9020df77c6460646771bfdbd1ad 100644 (file)
@@ -31,7 +31,7 @@
 #include "storage_conf.h"
 #include "vircommand.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 
 #define VIR_FROM_THIS VIR_FROM_STORAGE
index 6076f6cbbb7b76dff303734410157c3bbd8be1d5..aebf8bb546a29c86d3b84354dbe15f947d4a77bd 100644 (file)
@@ -42,7 +42,7 @@
 #include "util.h"
 #include "storage_driver.h"
 #include "storage_conf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "storage_backend.h"
 #include "virlog.h"
 #include "virfile.h"
index 8dd56948077d45fa93313b4b2e46a760f413566d..0856cdbaa612801950faaccd552edbf637e58a45 100644 (file)
@@ -39,7 +39,7 @@
 #include "util.h"
 #include "uuid.h"
 #include "capabilities.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "network_conf.h"
 #include "interface_conf.h"
 #include "domain_conf.h"
index 6b14f231e33a3d3110aeff083a2ae3cd15d002a8..496f2795368d5d84577646208ea7ed37b7a2a76e 100644 (file)
@@ -39,7 +39,7 @@
 #include "virbuffer.h"
 #include "virconf.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "nodeinfo.h"
 #include "virlog.h"
 #include "domain_nwfilter.h"
index 90c9b662cae034e2ad34301ac46825c373ce855c..cece114b00e5619e4ab5fc380be6a5a374aea355 100644 (file)
@@ -51,7 +51,7 @@
 #include "nodeinfo.h"
 #include "stats_linux.h"
 #include "capabilities.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "uuid.h"
 #include "domain_conf.h"
 #include "domain_audit.h"
index a9c8b4cefa4c96c38f32c6c2f0980e6f0dc6eb78..1b16d5c960759fb1a4a7ff8e9d8ff117d771c138 100644 (file)
@@ -36,7 +36,7 @@
 #include "util.h"
 #include "threads.h"
 #include "virfile.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "configmake.h"
 #include "virrandom.h"
diff --git a/src/util/memory.c b/src/util/memory.c
deleted file mode 100644 (file)
index 186d3b6..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- * memory.c: safer memory allocation
- *
- * Copyright (C) 2010-2012 Red Hat, Inc.
- * Copyright (C) 2008 Daniel P. Berrange
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include <config.h>
-#include <stdlib.h>
-
-#include "memory.h"
-#include "virlog.h"
-
-#if TEST_OOM
-static int testMallocNext = 0;
-static int testMallocFailFirst = 0;
-static int testMallocFailLast = 0;
-static void (*testMallocHook)(int, void*) = NULL;
-static void *testMallocHookData = NULL;
-
-void virAllocTestInit(void)
-{
-    testMallocNext = 1;
-    testMallocFailFirst = 0;
-    testMallocFailLast = 0;
-}
-
-int virAllocTestCount(void)
-{
-    return testMallocNext - 1;
-}
-
-void virAllocTestHook(void (*func)(int, void*), void *data)
-{
-    testMallocHook = func;
-    testMallocHookData = data;
-}
-
-void virAllocTestOOM(int n, int m)
-{
-    testMallocNext = 1;
-    testMallocFailFirst = n;
-    testMallocFailLast = n + m - 1;
-}
-
-static int virAllocTestFail(void)
-{
-    int fail = 0;
-    if (testMallocNext == 0)
-        return 0;
-
-    fail =
-        testMallocNext >= testMallocFailFirst &&
-        testMallocNext <= testMallocFailLast;
-
-    if (fail && testMallocHook)
-        (testMallocHook)(testMallocNext, testMallocHookData);
-
-    testMallocNext++;
-    return fail;
-}
-#endif
-
-
-/**
- * virAlloc:
- * @ptrptr: pointer to pointer for address of allocated memory
- * @size: number of bytes to allocate
- *
- * Allocate  'size' bytes of memory. Return the address of the
- * allocated memory in 'ptrptr'. The newly allocated memory is
- * filled with zeros.
- *
- * Returns -1 on failure to allocate, zero on success
- */
-int virAlloc(void *ptrptr, size_t size)
-{
-#if TEST_OOM
-    if (virAllocTestFail()) {
-        *(void **)ptrptr = NULL;
-        return -1;
-    }
-#endif
-
-    *(void **)ptrptr = calloc(1, size);
-    if (*(void **)ptrptr == NULL)
-        return -1;
-    return 0;
-}
-
-/**
- * virAllocN:
- * @ptrptr: pointer to pointer for address of allocated memory
- * @size: number of bytes to allocate
- * @count: number of elements to allocate
- *
- * Allocate an array of memory 'count' elements long,
- * each with 'size' bytes. Return the address of the
- * allocated memory in 'ptrptr'.  The newly allocated
- * memory is filled with zeros.
- *
- * Returns -1 on failure to allocate, zero on success
- */
-int virAllocN(void *ptrptr, size_t size, size_t count)
-{
-#if TEST_OOM
-    if (virAllocTestFail()) {
-        *(void **)ptrptr = NULL;
-        return -1;
-    }
-#endif
-
-    *(void**)ptrptr = calloc(count, size);
-    if (*(void**)ptrptr == NULL)
-        return -1;
-    return 0;
-}
-
-/**
- * virReallocN:
- * @ptrptr: pointer to pointer for address of allocated memory
- * @size: number of bytes to allocate
- * @count: number of elements in array
- *
- * Resize the block of memory in 'ptrptr' to be an array of
- * 'count' elements, each 'size' bytes in length. Update 'ptrptr'
- * with the address of the newly allocated memory. On failure,
- * 'ptrptr' is not changed and still points to the original memory
- * block. Any newly allocated memory in 'ptrptr' is uninitialized.
- *
- * Returns -1 on failure to allocate, zero on success
- */
-int virReallocN(void *ptrptr, size_t size, size_t count)
-{
-    void *tmp;
-#if TEST_OOM
-    if (virAllocTestFail())
-        return -1;
-#endif
-
-    if (xalloc_oversized(count, size)) {
-        errno = ENOMEM;
-        return -1;
-    }
-    tmp = realloc(*(void**)ptrptr, size * count);
-    if (!tmp && (size * count))
-        return -1;
-    *(void**)ptrptr = tmp;
-    return 0;
-}
-
-/**
- * virExpandN:
- * @ptrptr: pointer to pointer for address of allocated memory
- * @size: number of bytes per element
- * @countptr: pointer to number of elements in array
- * @add: number of elements to add
- *
- * Resize the block of memory in 'ptrptr' to be an array of
- * '*countptr' + 'add' elements, each 'size' bytes in length.
- * Update 'ptrptr' and 'countptr'  with the details of the newly
- * allocated memory. On failure, 'ptrptr' and 'countptr' are not
- * changed. Any newly allocated memory in 'ptrptr' is zero-filled.
- *
- * Returns -1 on failure to allocate, zero on success
- */
-int virExpandN(void *ptrptr, size_t size, size_t *countptr, size_t add)
-{
-    int ret;
-
-    if (*countptr + add < *countptr) {
-        errno = ENOMEM;
-        return -1;
-    }
-    ret = virReallocN(ptrptr, size, *countptr + add);
-    if (ret == 0) {
-        memset(*(char **)ptrptr + (size * *countptr), 0, size * add);
-        *countptr += add;
-    }
-    return ret;
-}
-
-/**
- * virResizeN:
- * @ptrptr: pointer to pointer for address of allocated memory
- * @size: number of bytes per element
- * @allocptr: pointer to number of elements allocated in array
- * @count: number of elements currently used in array
- * @add: minimum number of additional elements to support in array
- *
- * If 'count' + 'add' is larger than '*allocptr', then resize the
- * block of memory in 'ptrptr' to be an array of at least 'count' +
- * 'add' elements, each 'size' bytes in length. Update 'ptrptr' and
- * 'allocptr' with the details of the newly allocated memory. On
- * failure, 'ptrptr' and 'allocptr' are not changed. Any newly
- * allocated memory in 'ptrptr' is zero-filled.
- *
- * Returns -1 on failure to allocate, zero on success
- */
-int virResizeN(void *ptrptr, size_t size, size_t *allocptr, size_t count,
-               size_t add)
-{
-    size_t delta;
-
-    if (count + add < count) {
-        errno = ENOMEM;
-        return -1;
-    }
-    if (count + add <= *allocptr)
-        return 0;
-
-    delta = count + add - *allocptr;
-    if (delta < *allocptr / 2)
-        delta = *allocptr / 2;
-    return virExpandN(ptrptr, size, allocptr, delta);
-}
-
-/**
- * virShrinkN:
- * @ptrptr: pointer to pointer for address of allocated memory
- * @size: number of bytes per element
- * @countptr: pointer to number of elements in array
- * @toremove: number of elements to remove
- *
- * Resize the block of memory in 'ptrptr' to be an array of
- * '*countptr' - 'toremove' elements, each 'size' bytes in length.
- * Update 'ptrptr' and 'countptr'  with the details of the newly
- * allocated memory. If 'toremove' is larger than 'countptr', free
- * the entire array.
- */
-void virShrinkN(void *ptrptr, size_t size, size_t *countptr, size_t toremove)
-{
-    if (toremove < *countptr)
-        ignore_value(virReallocN(ptrptr, size, *countptr -= toremove));
-    else {
-        virFree(ptrptr);
-        *countptr = 0;
-    }
-}
-
-/**
- * virInsertElementsN:
- * @ptrptr:   pointer to hold address of allocated memory
- * @size:     the size of one element in bytes
- * @at:       index within array where new elements should be added
- * @countptr: variable tracking number of elements currently allocated
- * @add:      number of elements to add
- * @newelems: pointer to array of one or more new elements to move into
- *            place (the originals will be zeroed out if successful
- *            and if clearOriginal is true)
- * @clearOriginal: false if the new item in the array should be copied
- *            from the original, and the original left intact.
- *            true if the original should be 0'd out on success.
- * @inPlace:  false if we should expand the allocated memory before
- *            moving, true if we should assume someone else *has
- *            already* done that.
- *
- * Re-allocate an array of *countptr elements, each sizeof(*ptrptr) bytes
- * long, to be *countptr+add elements long, then appropriately move
- * the elements starting at ptrptr[at] up by add elements, copy the
- * items from newelems into ptrptr[at], then store the address of
- * allocated memory in *ptrptr and the new size in *countptr.  If
- * newelems is NULL, the new elements at ptrptr[at] are instead filled
- * with zero.
- *
- * Returns -1 on failure, 0 on success
- */
-int
-virInsertElementsN(void *ptrptr, size_t size, size_t at,
-                   size_t *countptr,
-                   size_t add, void *newelems,
-                   bool clearOriginal, bool inPlace)
-{
-    if (at > *countptr) {
-        VIR_WARN("out of bounds index - count %zu at %zu add %zu",
-                 *countptr, at, add);
-        return -1;
-    }
-
-    if (inPlace) {
-        *countptr += add;
-    } else if (virExpandN(ptrptr, size, countptr, add) < 0) {
-        return -1;
-    }
-
-    /* memory was successfully re-allocated. Move up all elements from
-     * ptrptr[at] to the end (if we're not "inserting" at the end
-     * already), memcpy in the new elements, and clear the elements
-     * from their original location. Remember that *countptr has
-     * already been updated with new element count!
-     */
-    if (at < *countptr - add) {
-        memmove(*(char**)ptrptr + (size * (at + add)),
-                *(char**)ptrptr + (size * at),
-                size * (*countptr - add - at));
-    }
-
-    if (newelems) {
-        memcpy(*(char**)ptrptr + (size * at), newelems, size * add);
-        if (clearOriginal)
-           memset((char*)newelems, 0, size * add);
-    } else if (inPlace || (at < *countptr - add)) {
-        /* NB: if inPlace, assume memory at the end wasn't initialized */
-        memset(*(char**)ptrptr + (size * at), 0, size * add);
-    }
-
-    return 0;
-}
-
-/**
- * virDeleteElementsN:
- * @ptrptr:   pointer to hold address of allocated memory
- * @size:     the size of one element in bytes
- * @at:       index within array where new elements should be deleted
- * @countptr: variable tracking number of elements currently allocated
- * @remove:   number of elements to remove
- * @inPlace:  false if we should shrink the allocated memory when done,
- *            true if we should assume someone else will do that.
- *
- * Re-allocate an array of *countptr elements, each sizeof(*ptrptr)
- * bytes long, to be *countptr-remove elements long, then store the
- * address of allocated memory in *ptrptr and the new size in *countptr.
- * If *countptr <= remove, the entire array is freed.
- *
- * Returns -1 on failure, 0 on success
- */
-int
-virDeleteElementsN(void *ptrptr, size_t size, size_t at,
-                   size_t *countptr, size_t remove,
-                   bool inPlace)
-{
-    if (at + remove > *countptr) {
-        VIR_WARN("out of bounds index - count %zu at %zu remove %zu",
-                 *countptr, at, remove);
-        return -1;
-    }
-
-    /* First move down the elements at the end that won't be deleted,
-     * then realloc. We assume that the items being deleted have
-     * already been cleared.
-    */
-    memmove(*(char**)ptrptr + (size * at),
-            *(char**)ptrptr + (size * (at + remove)),
-            size * (*countptr - remove - at));
-    if (inPlace)
-        *countptr -= remove;
-    else
-        virShrinkN(ptrptr, size, countptr, remove);
-    return 0;
-}
-
-/**
- * Vir_Alloc_Var:
- * @ptrptr: pointer to hold address of allocated memory
- * @struct_size: size of initial struct
- * @element_size: size of array elements
- * @count: number of array elements to allocate
- *
- * Allocate struct_size bytes plus an array of 'count' elements, each
- * of size element_size.  This sort of allocation is useful for
- * receiving the data of certain ioctls and other APIs which return a
- * struct in which the last element is an array of undefined length.
- * The caller of this type of API is expected to know the length of
- * the array that will be returned and allocate a suitable buffer to
- * contain the returned data.  C99 refers to these variable length
- * objects as structs containing flexible array members.
- *
- * Returns -1 on failure, 0 on success
- */
-int virAllocVar(void *ptrptr, size_t struct_size, size_t element_size, size_t count)
-{
-    size_t alloc_size = 0;
-
-#if TEST_OOM
-    if (virAllocTestFail())
-        return -1;
-#endif
-
-    if (VIR_ALLOC_VAR_OVERSIZED(struct_size, count, element_size)) {
-        errno = ENOMEM;
-        return -1;
-    }
-
-    alloc_size = struct_size + (element_size * count);
-    *(void **)ptrptr = calloc(1, alloc_size);
-    if (*(void **)ptrptr == NULL)
-        return -1;
-    return 0;
-}
-
-
-/**
- * virFree:
- * @ptrptr: pointer to pointer for address of memory to be freed
- *
- * Release the chunk of memory in the pointer pointed to by
- * the 'ptrptr' variable. After release, 'ptrptr' will be
- * updated to point to NULL.
- */
-void virFree(void *ptrptr)
-{
-    int save_errno = errno;
-
-    free(*(void**)ptrptr);
-    *(void**)ptrptr = NULL;
-    errno = save_errno;
-}
diff --git a/src/util/memory.h b/src/util/memory.h
deleted file mode 100644 (file)
index 8398105..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * memory.c: safer memory allocation
- *
- * Copyright (C) 2010-2012 Red Hat, Inc.
- * Copyright (C) 2008 Daniel P. Berrange
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-
-#ifndef __VIR_MEMORY_H_
-# define __VIR_MEMORY_H_
-
-# include "internal.h"
-
-/* Return 1 if an array of N objects, each of size S, cannot exist due
-   to size arithmetic overflow.  S must be positive and N must be
-   nonnegative.  This is a macro, not an inline function, so that it
-   works correctly even when SIZE_MAX < N.
-
-   By gnulib convention, SIZE_MAX represents overflow in size
-   calculations, so the conservative dividend to use here is
-   SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value.
-   However, malloc (SIZE_MAX) fails on all known hosts where
-   sizeof(ptrdiff_t) <= sizeof(size_t), so do not bother to test for
-   exactly-SIZE_MAX allocations on such hosts; this avoids a test and
-   branch when S is known to be 1.  */
-# ifndef xalloc_oversized
-#  define xalloc_oversized(n, s) \
-    ((size_t) (sizeof(ptrdiff_t) <= sizeof(size_t) ? -1 : -2) / (s) < (n))
-# endif
-
-
-
-/* Don't call these directly - use the macros below */
-int virAlloc(void *ptrptr, size_t size) ATTRIBUTE_RETURN_CHECK
-    ATTRIBUTE_NONNULL(1);
-int virAllocN(void *ptrptr, size_t size, size_t count) ATTRIBUTE_RETURN_CHECK
-    ATTRIBUTE_NONNULL(1);
-int virReallocN(void *ptrptr, size_t size, size_t count) ATTRIBUTE_RETURN_CHECK
-    ATTRIBUTE_NONNULL(1);
-int virExpandN(void *ptrptr, size_t size, size_t *count, size_t add)
-    ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
-int virResizeN(void *ptrptr, size_t size, size_t *alloc, size_t count,
-               size_t desired)
-    ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
-void virShrinkN(void *ptrptr, size_t size, size_t *count, size_t toremove)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
-int virInsertElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr,
-                       size_t add, void *newelem,
-                       bool clearOriginal, bool inPlace)
-    ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
-int virDeleteElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr,
-                       size_t remove, bool inPlace)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
-int virAllocVar(void *ptrptr,
-                size_t struct_size,
-                size_t element_size,
-                size_t count) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1);
-void virFree(void *ptrptr) ATTRIBUTE_NONNULL(1);
-
-/**
- * VIR_ALLOC:
- * @ptr: pointer to hold address of allocated memory
- *
- * Allocate sizeof(*ptr) bytes of memory and store
- * the address of allocated memory in 'ptr'. Fill the
- * newly allocated memory with zeros.
- *
- * Returns -1 on failure, 0 on success
- */
-# define VIR_ALLOC(ptr) virAlloc(&(ptr), sizeof(*(ptr)))
-
-/**
- * VIR_ALLOC_N:
- * @ptr: pointer to hold address of allocated memory
- * @count: number of elements to allocate
- *
- * Allocate an array of 'count' elements, each sizeof(*ptr)
- * bytes long and store the address of allocated memory in
- * 'ptr'. Fill the newly allocated memory with zeros.
- *
- * Returns -1 on failure, 0 on success
- */
-# define VIR_ALLOC_N(ptr, count) virAllocN(&(ptr), sizeof(*(ptr)), (count))
-
-/**
- * VIR_REALLOC_N:
- * @ptr: pointer to hold address of allocated memory
- * @count: number of elements to allocate
- *
- * Re-allocate an array of 'count' elements, each sizeof(*ptr)
- * bytes long and store the address of allocated memory in
- * 'ptr'. If 'ptr' grew, the added memory is uninitialized.
- *
- * Returns -1 on failure, 0 on success
- */
-# define VIR_REALLOC_N(ptr, count) virReallocN(&(ptr), sizeof(*(ptr)), (count))
-
-/**
- * VIR_EXPAND_N:
- * @ptr: pointer to hold address of allocated memory
- * @count: variable tracking number of elements currently allocated
- * @add: number of elements to add
- *
- * Re-allocate an array of 'count' elements, each sizeof(*ptr)
- * bytes long, to be 'count' + 'add' elements long, then store the
- * address of allocated memory in 'ptr' and the new size in 'count'.
- * The new elements are filled with zero.
- *
- * Returns -1 on failure, 0 on success
- */
-# define VIR_EXPAND_N(ptr, count, add) \
-    virExpandN(&(ptr), sizeof(*(ptr)), &(count), add)
-
-/**
- * VIR_RESIZE_N:
- * @ptr: pointer to hold address of allocated memory
- * @alloc: variable tracking number of elements currently allocated
- * @count: number of elements currently in use
- * @add: minimum number of elements to additionally support
- *
- * Blindly using VIR_EXPAND_N(array, alloc, 1) in a loop scales
- * quadratically, because every iteration must copy contents from
- * all prior iterations.  But amortized linear scaling can be achieved
- * by tracking allocation size separately from the number of used
- * elements, and growing geometrically only as needed.
- *
- * If 'count' + 'add' is larger than 'alloc', then geometrically reallocate
- * the array of 'alloc' elements, each sizeof(*ptr) bytes long, and store
- * the address of allocated memory in 'ptr' and the new size in 'alloc'.
- * The new elements are filled with zero.
- *
- * Returns -1 on failure, 0 on success
- */
-# define VIR_RESIZE_N(ptr, alloc, count, add) \
-    virResizeN(&(ptr), sizeof(*(ptr)), &(alloc), count, add)
-
-/**
- * VIR_SHRINK_N:
- * @ptr: pointer to hold address of allocated memory
- * @count: variable tracking number of elements currently allocated
- * @remove: number of elements to remove
- *
- * Re-allocate an array of 'count' elements, each sizeof(*ptr)
- * bytes long, to be 'count' - 'remove' elements long, then store the
- * address of allocated memory in 'ptr' and the new size in 'count'.
- * If 'count' <= 'remove', the entire array is freed.
- *
- * No return value.
- */
-# define VIR_SHRINK_N(ptr, count, remove) \
-    virShrinkN(&(ptr), sizeof(*(ptr)), &(count), remove)
-
-/*
- * VIR_TYPEMATCH:
- *
- * The following macro seems a bit cryptic, so it needs a thorough
- * explanation. Its purpose is to check for assignment compatibility
- * and identical size between two values without creating any side
- * effects (by doing something silly like actually assigning one to
- * the other). Note that it takes advantage of the C89-guaranteed
- * property of sizeof() - it cannot have any side effects, so anything
- * that happens inside sizeof() will not have any effect at runtime.
- *
- * VIR_TYPEMATCH evaluates to "1" if the two passed values are both
- * assignment-compatible and the same size, and otherwise generates a
- * compile-time error. It determines the result by performing the
- * following three operations:
- *
- *    * sizeof(*(a) = *(b)) assures that *a and *b are
- *      assignment-compatible (they may still have a different size
- *      though! e.g. longVar = intVar) (If not, there is a compile-time
- *      error. If so, the result of that subexpression is sizeof(*(a)),
- *      i.e. one element of the array)
- *
- *    * sizeof(*(a) = *(b)) == sizeof(*(b)) checks if *a and *b are also
- *      of the same size (so that, e.g. you don't accidentally copy an
- *      int plus the random bytes following it into an array of long). It
- *      evaluates to 1 if they are the same, and 0 otherwise.
- *
- *    * sizeof(char[2 * (result of previous step) - 1]) evaluates to 1
- *      if the previous step was successful (char [(2*1) - 1] i.e.
- *      char[1]), or generates a compile error if it wasn't successful
- *      (char[2*0 -1] i.e. char[-1], which isn't valid in C).
- *
- * So VIR_TYPECHECK(a, b) will either abort the compile with an error,
- * or evaluate to "1", and in the meantime check that we've actually
- * added the correct &'s and/or *'s to the arguments. (Whew!)
-*/
-# define VIR_TYPEMATCH(a, b) \
-    sizeof(char[2 * (sizeof(*(a) = *(b)) == sizeof(*(b))) - 1])
-
-/**
- * VIR_INSERT_ELEMENT:
- * @ptr:     pointer to array of objects (*not* ptr to ptr)
- * @at:      index within array where new elements should be added
- * @count:   variable tracking number of elements currently allocated
- * @newelem: the new element to move into place (*not* a pointer to
- *           the element, but the element itself).
- *           (the original will be zeroed out if successful)
- *
- * Re-allocate an array of 'count' elements, each sizeof(*ptr) bytes
- * long, to be 'count' + 1 elements long, then appropriately move
- * the elements starting at ptr[at] up by 1 element, copy the
- * item 'newelem' into ptr[at], then store the address of
- * allocated memory in 'ptr' and the new size in 'count'.
- *
- * VIR_INSERT_ELEMENT_COPY is identical, but doesn't clear out the
- *   original element to 0 on success, so there are two copies of the
- *   element. This is useful if the "element" is actually just a
- *   pointer to the real data, and you want to maintain a reference to
- *   it for use after the insert is completed; but if the "element" is
- *   an object that points to other allocated memory, having multiple
- *   copies can cause problems (e.g. double free).
- *
- * VIR_INSERT_ELEMENT_*INPLACE are identical, but assume any necessary
- *   memory re-allocation has already been done.
- *
- * VIR_INSERT_ELEMENT_* all need to send "1" as the "add" argument to
- * virInsertElementsN (which has the currently-unused capability of
- * inserting multiple items at once). We use this to our advantage by
- * replacing it with VIR_TYPECHECK(ptr, &newelem) so that we can be
- * assured ptr and &newelem are of compatible types.
- *
- * Returns -1 on failure, 0 on success
- *
- *
- */
-# define VIR_INSERT_ELEMENT(ptr, at, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count),    \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, false)
-# define VIR_INSERT_ELEMENT_COPY(ptr, at, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, false)
-# define VIR_INSERT_ELEMENT_INPLACE(ptr, at, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, true)
-# define VIR_INSERT_ELEMENT_COPY_INPLACE(ptr, at, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, true)
-
-/**
- * VIR_APPEND_ELEMENT:
- * @ptr:     pointer to array of objects (*not* ptr to ptr)
- * @count:   variable tracking number of elements currently allocated
- * @newelem: the new element to move into place (*not* a pointer to
- *           the element, but the element itself).
- *           (the original will be zeroed out if successful)
- *
- * Re-allocate an array of 'count' elements, each sizeof(*ptr) bytes
- * long, to be 'count' + 1 elements long, then copy the item from
- * 'newelem' into ptr[count+1], and store the address of allocated
- * memory in 'ptr' and the new size in 'count'. If 'newelem' is NULL,
- * the new element at ptr[at] is instead filled with zero.
- *
- * VIR_APPEND_ELEMENT_COPY is identical, but doesn't clear out the
- *   original element to 0 on success, so there are two copies of the
- *   element. This is useful if the "element" is actually just a
- *   pointer to the real data, and you want to maintain a reference to
- *   it for use after the append is completed; but if the "element" is
- *   an object that points to other allocated memory, having multiple
- *   copies can cause problems (e.g. double free).
- *
- * VIR_APPEND_ELEMENT_*INPLACE are identical, but assume any
- *   necessary memory re-allocation has already been done.
- *
- * VIR_APPEND_ELEMENT_* all need to send "1" as the "add" argument to
- * virInsertElementsN (which has the currently-unused capability of
- * inserting multiple items at once). We use this to our advantage by
- * replacing it with VIR_TYPECHECK(ptr, &newelem) so that we can be
- * assured ptr and &newelem are of compatible types.
- *
- * Returns -1 on failure, 0 on success
- *
- *
- */
-# define VIR_APPEND_ELEMENT(ptr, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), count, &(count),  \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, false)
-# define VIR_APPEND_ELEMENT_COPY(ptr, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), count, &(count),  \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, false)
-# define VIR_APPEND_ELEMENT_INPLACE(ptr, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), count, &(count),  \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, true)
-# define VIR_APPEND_ELEMENT_COPY_INPLACE(ptr, count, newelem) \
-    virInsertElementsN(&(ptr), sizeof(*(ptr)), count, &(count),  \
-                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, true)
-
-/**
- * VIR_DELETE_ELEMENT:
- * @ptr:   pointer to array of objects (*not* ptr to ptr)
- * @at:    index within array where new elements should be deleted
- * @count: variable tracking number of elements currently allocated
- *
- * Re-allocate an array of 'count' elements, each sizeof(*ptr)
- * bytes long, to be 'count' - 1 elements long, then store the
- * address of allocated memory in 'ptr' and the new size in 'count'.
- * If 'count' <= 1, the entire array is freed.
- *
- * VIR_DELETE_ELEMENT_INPLACE is identical, but assumes any
- *   necessary memory re-allocation will be done later.
- *
- * Returns -1 on failure, 0 on success
- */
-# define VIR_DELETE_ELEMENT(ptr, at, count) \
-    virDeleteElementsN(&(ptr), sizeof(*(ptr)), at, &(count), 1, false)
-# define VIR_DELETE_ELEMENT_INPLACE(ptr, at, count) \
-    virDeleteElementsN(&(ptr), sizeof(*(ptr)), at, &(count), 1, true)
-
-/*
- * VIR_ALLOC_VAR_OVERSIZED:
- * @M: size of base structure
- * @N: number of array elements in trailing array
- * @S: size of trailing array elements
- *
- * Check to make sure that the requested allocation will not cause
- * arithmetic overflow in the allocation size.  The check is
- * essentially the same as that in gnulib's xalloc_oversized.
- */
-# define VIR_ALLOC_VAR_OVERSIZED(M, N, S) ((((size_t)-1) - (M)) / (S) < (N))
-
-/**
- * VIR_ALLOC_VAR:
- * @ptr: pointer to hold address of allocated memory
- * @type: element type of trailing array
- * @count: number of array elements to allocate
- *
- * Allocate sizeof(*ptr) bytes plus an array of 'count' elements, each
- * sizeof('type').  This sort of allocation is useful for receiving
- * the data of certain ioctls and other APIs which return a struct in
- * which the last element is an array of undefined length.  The caller
- * of this type of API is expected to know the length of the array
- * that will be returned and allocate a suitable buffer to contain the
- * returned data.  C99 refers to these variable length objects as
- * structs containing flexible array members.
-
- * Returns -1 on failure, 0 on success
- */
-# define VIR_ALLOC_VAR(ptr, type, count) \
-    virAllocVar(&(ptr), sizeof(*(ptr)), sizeof(type), (count))
-
-/**
- * VIR_FREE:
- * @ptr: pointer holding address to be freed
- *
- * Free the memory stored in 'ptr' and update to point
- * to NULL.
- */
-/* The ternary ensures that ptr is a pointer and not an integer type,
- * while evaluating ptr only once.  For now, we intentionally cast
- * away const, since a number of callers safely pass const char *.
- */
-# define VIR_FREE(ptr) virFree((void *) (1 ? (const void *) &(ptr) : (ptr)))
-
-
-# if TEST_OOM
-void virAllocTestInit(void);
-int virAllocTestCount(void);
-void virAllocTestOOM(int n, int m);
-void virAllocTestHook(void (*func)(int, void*), void *data);
-# endif
-
-
-
-#endif /* __VIR_MEMORY_H_ */
index 7adce758b7a8540a6c8b5496972708deed579769..e4009fa87e51a0de4e022a212e08b848d43ab935 100644 (file)
@@ -35,7 +35,7 @@
 #include <stdlib.h>
 
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "vircommand.h"
 #include "virterror_internal.h"
 #include "virfile.h"
index f72b7d7a156a20ab4f0a6da0660be3072b0f082a..ae0cc186ee88e37e8600606a47dd33d278fae191 100644 (file)
@@ -20,7 +20,7 @@
 #include "virterror_internal.h"
 #include "sexpr.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 
 #define VIR_FROM_THIS VIR_FROM_SEXPR
 
index 2dfc30d846e4242f734b26c386beb11f0e135af3..67ef82e589c6c5275114d921e7e47803b2afc920 100644 (file)
@@ -36,7 +36,7 @@
 # include "datatypes.h"
 # include "util.h"
 # include "stats_linux.h"
-# include "memory.h"
+# include "viralloc.h"
 # include "virfile.h"
 
 # define VIR_FROM_THIS VIR_FROM_STATS_LINUX
index 6c3390b6c48c7c434ba3ad9f9a747d01825c8d31..a020bb257778baa603e36917eab09950cc05ec5e 100644 (file)
@@ -35,7 +35,7 @@
 # include <sys/statfs.h>
 #endif
 #include "dirname.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "virfile.h"
index f07c2d8344b365d0b970c00c768d5b9259910677..6da87ce7bb5b5f61b844e3c566498b68bc121d84 100644 (file)
@@ -34,7 +34,7 @@
 #include "sysinfo.h"
 #include "util.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "vircommand.h"
 
 #define VIR_FROM_THIS VIR_FROM_SYSINFO
index ffbbe7207b977844c583a9bf69ab8d8842a424e0..9d3d5d26cd999054396a2ef2a51658ee3e39e33a 100644 (file)
@@ -26,7 +26,7 @@
 #include <config.h>
 
 #include "threadpool.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "threads.h"
 #include "virterror_internal.h"
 
index 44e8bc050aac319a21b48af5bf5dd4ccb0e6e2bc..37d8902eaafae2e400fd6a8ad7003d449b5299c9 100644 (file)
@@ -27,7 +27,7 @@
 # include <sys/syscall.h>
 #endif
 
-#include "memory.h"
+#include "viralloc.h"
 
 
 /* Nothing special required for pthreads */
index 142aa4f32bed4eb70fcd5f9b14173259f0c807fd..c9f16c1eb7c765ecd5920b9d6ad6f83ba9b9a93e 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <process.h>
 
-#include "memory.h"
+#include "viralloc.h"
 
 struct virThreadLocalData {
     DWORD key;
index f941dfdb7949554e771fe5366e965121ec2960c8..c070d94a420e933637e47fd02f392d2fb9a4523f 100644 (file)
@@ -80,7 +80,7 @@
 #include "virbuffer.h"
 #include "util.h"
 #include "storage_file.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "threads.h"
 #include "verify.h"
 #include "virfile.h"
index 6efc7be91477dcbdb08e336e815c4de50191d17f..5232ba93ddb9898821a09cf15568dc4967ba32f8 100644 (file)
@@ -38,7 +38,7 @@
 #include "util.h"
 #include "virterror_internal.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virfile.h"
 #include "virrandom.h"
 
diff --git a/src/util/viralloc.c b/src/util/viralloc.c
new file mode 100644 (file)
index 0000000..58d4bcd
--- /dev/null
@@ -0,0 +1,422 @@
+/*
+ * viralloc.c: safer memory allocation
+ *
+ * Copyright (C) 2010-2012 Red Hat, Inc.
+ * Copyright (C) 2008 Daniel P. Berrange
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <config.h>
+#include <stdlib.h>
+
+#include "viralloc.h"
+#include "virlog.h"
+
+#if TEST_OOM
+static int testMallocNext = 0;
+static int testMallocFailFirst = 0;
+static int testMallocFailLast = 0;
+static void (*testMallocHook)(int, void*) = NULL;
+static void *testMallocHookData = NULL;
+
+void virAllocTestInit(void)
+{
+    testMallocNext = 1;
+    testMallocFailFirst = 0;
+    testMallocFailLast = 0;
+}
+
+int virAllocTestCount(void)
+{
+    return testMallocNext - 1;
+}
+
+void virAllocTestHook(void (*func)(int, void*), void *data)
+{
+    testMallocHook = func;
+    testMallocHookData = data;
+}
+
+void virAllocTestOOM(int n, int m)
+{
+    testMallocNext = 1;
+    testMallocFailFirst = n;
+    testMallocFailLast = n + m - 1;
+}
+
+static int virAllocTestFail(void)
+{
+    int fail = 0;
+    if (testMallocNext == 0)
+        return 0;
+
+    fail =
+        testMallocNext >= testMallocFailFirst &&
+        testMallocNext <= testMallocFailLast;
+
+    if (fail && testMallocHook)
+        (testMallocHook)(testMallocNext, testMallocHookData);
+
+    testMallocNext++;
+    return fail;
+}
+#endif
+
+
+/**
+ * virAlloc:
+ * @ptrptr: pointer to pointer for address of allocated memory
+ * @size: number of bytes to allocate
+ *
+ * Allocate  'size' bytes of memory. Return the address of the
+ * allocated memory in 'ptrptr'. The newly allocated memory is
+ * filled with zeros.
+ *
+ * Returns -1 on failure to allocate, zero on success
+ */
+int virAlloc(void *ptrptr, size_t size)
+{
+#if TEST_OOM
+    if (virAllocTestFail()) {
+        *(void **)ptrptr = NULL;
+        return -1;
+    }
+#endif
+
+    *(void **)ptrptr = calloc(1, size);
+    if (*(void **)ptrptr == NULL)
+        return -1;
+    return 0;
+}
+
+/**
+ * virAllocN:
+ * @ptrptr: pointer to pointer for address of allocated memory
+ * @size: number of bytes to allocate
+ * @count: number of elements to allocate
+ *
+ * Allocate an array of memory 'count' elements long,
+ * each with 'size' bytes. Return the address of the
+ * allocated memory in 'ptrptr'.  The newly allocated
+ * memory is filled with zeros.
+ *
+ * Returns -1 on failure to allocate, zero on success
+ */
+int virAllocN(void *ptrptr, size_t size, size_t count)
+{
+#if TEST_OOM
+    if (virAllocTestFail()) {
+        *(void **)ptrptr = NULL;
+        return -1;
+    }
+#endif
+
+    *(void**)ptrptr = calloc(count, size);
+    if (*(void**)ptrptr == NULL)
+        return -1;
+    return 0;
+}
+
+/**
+ * virReallocN:
+ * @ptrptr: pointer to pointer for address of allocated memory
+ * @size: number of bytes to allocate
+ * @count: number of elements in array
+ *
+ * Resize the block of memory in 'ptrptr' to be an array of
+ * 'count' elements, each 'size' bytes in length. Update 'ptrptr'
+ * with the address of the newly allocated memory. On failure,
+ * 'ptrptr' is not changed and still points to the original memory
+ * block. Any newly allocated memory in 'ptrptr' is uninitialized.
+ *
+ * Returns -1 on failure to allocate, zero on success
+ */
+int virReallocN(void *ptrptr, size_t size, size_t count)
+{
+    void *tmp;
+#if TEST_OOM
+    if (virAllocTestFail())
+        return -1;
+#endif
+
+    if (xalloc_oversized(count, size)) {
+        errno = ENOMEM;
+        return -1;
+    }
+    tmp = realloc(*(void**)ptrptr, size * count);
+    if (!tmp && (size * count))
+        return -1;
+    *(void**)ptrptr = tmp;
+    return 0;
+}
+
+/**
+ * virExpandN:
+ * @ptrptr: pointer to pointer for address of allocated memory
+ * @size: number of bytes per element
+ * @countptr: pointer to number of elements in array
+ * @add: number of elements to add
+ *
+ * Resize the block of memory in 'ptrptr' to be an array of
+ * '*countptr' + 'add' elements, each 'size' bytes in length.
+ * Update 'ptrptr' and 'countptr'  with the details of the newly
+ * allocated memory. On failure, 'ptrptr' and 'countptr' are not
+ * changed. Any newly allocated memory in 'ptrptr' is zero-filled.
+ *
+ * Returns -1 on failure to allocate, zero on success
+ */
+int virExpandN(void *ptrptr, size_t size, size_t *countptr, size_t add)
+{
+    int ret;
+
+    if (*countptr + add < *countptr) {
+        errno = ENOMEM;
+        return -1;
+    }
+    ret = virReallocN(ptrptr, size, *countptr + add);
+    if (ret == 0) {
+        memset(*(char **)ptrptr + (size * *countptr), 0, size * add);
+        *countptr += add;
+    }
+    return ret;
+}
+
+/**
+ * virResizeN:
+ * @ptrptr: pointer to pointer for address of allocated memory
+ * @size: number of bytes per element
+ * @allocptr: pointer to number of elements allocated in array
+ * @count: number of elements currently used in array
+ * @add: minimum number of additional elements to support in array
+ *
+ * If 'count' + 'add' is larger than '*allocptr', then resize the
+ * block of memory in 'ptrptr' to be an array of at least 'count' +
+ * 'add' elements, each 'size' bytes in length. Update 'ptrptr' and
+ * 'allocptr' with the details of the newly allocated memory. On
+ * failure, 'ptrptr' and 'allocptr' are not changed. Any newly
+ * allocated memory in 'ptrptr' is zero-filled.
+ *
+ * Returns -1 on failure to allocate, zero on success
+ */
+int virResizeN(void *ptrptr, size_t size, size_t *allocptr, size_t count,
+               size_t add)
+{
+    size_t delta;
+
+    if (count + add < count) {
+        errno = ENOMEM;
+        return -1;
+    }
+    if (count + add <= *allocptr)
+        return 0;
+
+    delta = count + add - *allocptr;
+    if (delta < *allocptr / 2)
+        delta = *allocptr / 2;
+    return virExpandN(ptrptr, size, allocptr, delta);
+}
+
+/**
+ * virShrinkN:
+ * @ptrptr: pointer to pointer for address of allocated memory
+ * @size: number of bytes per element
+ * @countptr: pointer to number of elements in array
+ * @toremove: number of elements to remove
+ *
+ * Resize the block of memory in 'ptrptr' to be an array of
+ * '*countptr' - 'toremove' elements, each 'size' bytes in length.
+ * Update 'ptrptr' and 'countptr'  with the details of the newly
+ * allocated memory. If 'toremove' is larger than 'countptr', free
+ * the entire array.
+ */
+void virShrinkN(void *ptrptr, size_t size, size_t *countptr, size_t toremove)
+{
+    if (toremove < *countptr)
+        ignore_value(virReallocN(ptrptr, size, *countptr -= toremove));
+    else {
+        virFree(ptrptr);
+        *countptr = 0;
+    }
+}
+
+/**
+ * virInsertElementsN:
+ * @ptrptr:   pointer to hold address of allocated memory
+ * @size:     the size of one element in bytes
+ * @at:       index within array where new elements should be added
+ * @countptr: variable tracking number of elements currently allocated
+ * @add:      number of elements to add
+ * @newelems: pointer to array of one or more new elements to move into
+ *            place (the originals will be zeroed out if successful
+ *            and if clearOriginal is true)
+ * @clearOriginal: false if the new item in the array should be copied
+ *            from the original, and the original left intact.
+ *            true if the original should be 0'd out on success.
+ * @inPlace:  false if we should expand the allocated memory before
+ *            moving, true if we should assume someone else *has
+ *            already* done that.
+ *
+ * Re-allocate an array of *countptr elements, each sizeof(*ptrptr) bytes
+ * long, to be *countptr+add elements long, then appropriately move
+ * the elements starting at ptrptr[at] up by add elements, copy the
+ * items from newelems into ptrptr[at], then store the address of
+ * allocated memory in *ptrptr and the new size in *countptr.  If
+ * newelems is NULL, the new elements at ptrptr[at] are instead filled
+ * with zero.
+ *
+ * Returns -1 on failure, 0 on success
+ */
+int
+virInsertElementsN(void *ptrptr, size_t size, size_t at,
+                   size_t *countptr,
+                   size_t add, void *newelems,
+                   bool clearOriginal, bool inPlace)
+{
+    if (at > *countptr) {
+        VIR_WARN("out of bounds index - count %zu at %zu add %zu",
+                 *countptr, at, add);
+        return -1;
+    }
+
+    if (inPlace) {
+        *countptr += add;
+    } else if (virExpandN(ptrptr, size, countptr, add) < 0) {
+        return -1;
+    }
+
+    /* memory was successfully re-allocated. Move up all elements from
+     * ptrptr[at] to the end (if we're not "inserting" at the end
+     * already), memcpy in the new elements, and clear the elements
+     * from their original location. Remember that *countptr has
+     * already been updated with new element count!
+     */
+    if (at < *countptr - add) {
+        memmove(*(char**)ptrptr + (size * (at + add)),
+                *(char**)ptrptr + (size * at),
+                size * (*countptr - add - at));
+    }
+
+    if (newelems) {
+        memcpy(*(char**)ptrptr + (size * at), newelems, size * add);
+        if (clearOriginal)
+           memset((char*)newelems, 0, size * add);
+    } else if (inPlace || (at < *countptr - add)) {
+        /* NB: if inPlace, assume memory at the end wasn't initialized */
+        memset(*(char**)ptrptr + (size * at), 0, size * add);
+    }
+
+    return 0;
+}
+
+/**
+ * virDeleteElementsN:
+ * @ptrptr:   pointer to hold address of allocated memory
+ * @size:     the size of one element in bytes
+ * @at:       index within array where new elements should be deleted
+ * @countptr: variable tracking number of elements currently allocated
+ * @remove:   number of elements to remove
+ * @inPlace:  false if we should shrink the allocated memory when done,
+ *            true if we should assume someone else will do that.
+ *
+ * Re-allocate an array of *countptr elements, each sizeof(*ptrptr)
+ * bytes long, to be *countptr-remove elements long, then store the
+ * address of allocated memory in *ptrptr and the new size in *countptr.
+ * If *countptr <= remove, the entire array is freed.
+ *
+ * Returns -1 on failure, 0 on success
+ */
+int
+virDeleteElementsN(void *ptrptr, size_t size, size_t at,
+                   size_t *countptr, size_t remove,
+                   bool inPlace)
+{
+    if (at + remove > *countptr) {
+        VIR_WARN("out of bounds index - count %zu at %zu remove %zu",
+                 *countptr, at, remove);
+        return -1;
+    }
+
+    /* First move down the elements at the end that won't be deleted,
+     * then realloc. We assume that the items being deleted have
+     * already been cleared.
+    */
+    memmove(*(char**)ptrptr + (size * at),
+            *(char**)ptrptr + (size * (at + remove)),
+            size * (*countptr - remove - at));
+    if (inPlace)
+        *countptr -= remove;
+    else
+        virShrinkN(ptrptr, size, countptr, remove);
+    return 0;
+}
+
+/**
+ * Vir_Alloc_Var:
+ * @ptrptr: pointer to hold address of allocated memory
+ * @struct_size: size of initial struct
+ * @element_size: size of array elements
+ * @count: number of array elements to allocate
+ *
+ * Allocate struct_size bytes plus an array of 'count' elements, each
+ * of size element_size.  This sort of allocation is useful for
+ * receiving the data of certain ioctls and other APIs which return a
+ * struct in which the last element is an array of undefined length.
+ * The caller of this type of API is expected to know the length of
+ * the array that will be returned and allocate a suitable buffer to
+ * contain the returned data.  C99 refers to these variable length
+ * objects as structs containing flexible array members.
+ *
+ * Returns -1 on failure, 0 on success
+ */
+int virAllocVar(void *ptrptr, size_t struct_size, size_t element_size, size_t count)
+{
+    size_t alloc_size = 0;
+
+#if TEST_OOM
+    if (virAllocTestFail())
+        return -1;
+#endif
+
+    if (VIR_ALLOC_VAR_OVERSIZED(struct_size, count, element_size)) {
+        errno = ENOMEM;
+        return -1;
+    }
+
+    alloc_size = struct_size + (element_size * count);
+    *(void **)ptrptr = calloc(1, alloc_size);
+    if (*(void **)ptrptr == NULL)
+        return -1;
+    return 0;
+}
+
+
+/**
+ * virFree:
+ * @ptrptr: pointer to pointer for address of memory to be freed
+ *
+ * Release the chunk of memory in the pointer pointed to by
+ * the 'ptrptr' variable. After release, 'ptrptr' will be
+ * updated to point to NULL.
+ */
+void virFree(void *ptrptr)
+{
+    int save_errno = errno;
+
+    free(*(void**)ptrptr);
+    *(void**)ptrptr = NULL;
+    errno = save_errno;
+}
diff --git a/src/util/viralloc.h b/src/util/viralloc.h
new file mode 100644 (file)
index 0000000..37ec5ee
--- /dev/null
@@ -0,0 +1,380 @@
+/*
+ * viralloc.h: safer memory allocation
+ *
+ * Copyright (C) 2010-2012 Red Hat, Inc.
+ * Copyright (C) 2008 Daniel P. Berrange
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#ifndef __VIR_MEMORY_H_
+# define __VIR_MEMORY_H_
+
+# include "internal.h"
+
+/* Return 1 if an array of N objects, each of size S, cannot exist due
+   to size arithmetic overflow.  S must be positive and N must be
+   nonnegative.  This is a macro, not an inline function, so that it
+   works correctly even when SIZE_MAX < N.
+
+   By gnulib convention, SIZE_MAX represents overflow in size
+   calculations, so the conservative dividend to use here is
+   SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value.
+   However, malloc (SIZE_MAX) fails on all known hosts where
+   sizeof(ptrdiff_t) <= sizeof(size_t), so do not bother to test for
+   exactly-SIZE_MAX allocations on such hosts; this avoids a test and
+   branch when S is known to be 1.  */
+# ifndef xalloc_oversized
+#  define xalloc_oversized(n, s) \
+    ((size_t) (sizeof(ptrdiff_t) <= sizeof(size_t) ? -1 : -2) / (s) < (n))
+# endif
+
+
+
+/* Don't call these directly - use the macros below */
+int virAlloc(void *ptrptr, size_t size) ATTRIBUTE_RETURN_CHECK
+    ATTRIBUTE_NONNULL(1);
+int virAllocN(void *ptrptr, size_t size, size_t count) ATTRIBUTE_RETURN_CHECK
+    ATTRIBUTE_NONNULL(1);
+int virReallocN(void *ptrptr, size_t size, size_t count) ATTRIBUTE_RETURN_CHECK
+    ATTRIBUTE_NONNULL(1);
+int virExpandN(void *ptrptr, size_t size, size_t *count, size_t add)
+    ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+int virResizeN(void *ptrptr, size_t size, size_t *alloc, size_t count,
+               size_t desired)
+    ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+void virShrinkN(void *ptrptr, size_t size, size_t *count, size_t toremove)
+    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3);
+int virInsertElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr,
+                       size_t add, void *newelem,
+                       bool clearOriginal, bool inPlace)
+    ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+int virDeleteElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr,
+                       size_t remove, bool inPlace)
+    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4);
+int virAllocVar(void *ptrptr,
+                size_t struct_size,
+                size_t element_size,
+                size_t count) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1);
+void virFree(void *ptrptr) ATTRIBUTE_NONNULL(1);
+
+/**
+ * VIR_ALLOC:
+ * @ptr: pointer to hold address of allocated memory
+ *
+ * Allocate sizeof(*ptr) bytes of memory and store
+ * the address of allocated memory in 'ptr'. Fill the
+ * newly allocated memory with zeros.
+ *
+ * Returns -1 on failure, 0 on success
+ */
+# define VIR_ALLOC(ptr) virAlloc(&(ptr), sizeof(*(ptr)))
+
+/**
+ * VIR_ALLOC_N:
+ * @ptr: pointer to hold address of allocated memory
+ * @count: number of elements to allocate
+ *
+ * Allocate an array of 'count' elements, each sizeof(*ptr)
+ * bytes long and store the address of allocated memory in
+ * 'ptr'. Fill the newly allocated memory with zeros.
+ *
+ * Returns -1 on failure, 0 on success
+ */
+# define VIR_ALLOC_N(ptr, count) virAllocN(&(ptr), sizeof(*(ptr)), (count))
+
+/**
+ * VIR_REALLOC_N:
+ * @ptr: pointer to hold address of allocated memory
+ * @count: number of elements to allocate
+ *
+ * Re-allocate an array of 'count' elements, each sizeof(*ptr)
+ * bytes long and store the address of allocated memory in
+ * 'ptr'. If 'ptr' grew, the added memory is uninitialized.
+ *
+ * Returns -1 on failure, 0 on success
+ */
+# define VIR_REALLOC_N(ptr, count) virReallocN(&(ptr), sizeof(*(ptr)), (count))
+
+/**
+ * VIR_EXPAND_N:
+ * @ptr: pointer to hold address of allocated memory
+ * @count: variable tracking number of elements currently allocated
+ * @add: number of elements to add
+ *
+ * Re-allocate an array of 'count' elements, each sizeof(*ptr)
+ * bytes long, to be 'count' + 'add' elements long, then store the
+ * address of allocated memory in 'ptr' and the new size in 'count'.
+ * The new elements are filled with zero.
+ *
+ * Returns -1 on failure, 0 on success
+ */
+# define VIR_EXPAND_N(ptr, count, add) \
+    virExpandN(&(ptr), sizeof(*(ptr)), &(count), add)
+
+/**
+ * VIR_RESIZE_N:
+ * @ptr: pointer to hold address of allocated memory
+ * @alloc: variable tracking number of elements currently allocated
+ * @count: number of elements currently in use
+ * @add: minimum number of elements to additionally support
+ *
+ * Blindly using VIR_EXPAND_N(array, alloc, 1) in a loop scales
+ * quadratically, because every iteration must copy contents from
+ * all prior iterations.  But amortized linear scaling can be achieved
+ * by tracking allocation size separately from the number of used
+ * elements, and growing geometrically only as needed.
+ *
+ * If 'count' + 'add' is larger than 'alloc', then geometrically reallocate
+ * the array of 'alloc' elements, each sizeof(*ptr) bytes long, and store
+ * the address of allocated memory in 'ptr' and the new size in 'alloc'.
+ * The new elements are filled with zero.
+ *
+ * Returns -1 on failure, 0 on success
+ */
+# define VIR_RESIZE_N(ptr, alloc, count, add) \
+    virResizeN(&(ptr), sizeof(*(ptr)), &(alloc), count, add)
+
+/**
+ * VIR_SHRINK_N:
+ * @ptr: pointer to hold address of allocated memory
+ * @count: variable tracking number of elements currently allocated
+ * @remove: number of elements to remove
+ *
+ * Re-allocate an array of 'count' elements, each sizeof(*ptr)
+ * bytes long, to be 'count' - 'remove' elements long, then store the
+ * address of allocated memory in 'ptr' and the new size in 'count'.
+ * If 'count' <= 'remove', the entire array is freed.
+ *
+ * No return value.
+ */
+# define VIR_SHRINK_N(ptr, count, remove) \
+    virShrinkN(&(ptr), sizeof(*(ptr)), &(count), remove)
+
+/*
+ * VIR_TYPEMATCH:
+ *
+ * The following macro seems a bit cryptic, so it needs a thorough
+ * explanation. Its purpose is to check for assignment compatibility
+ * and identical size between two values without creating any side
+ * effects (by doing something silly like actually assigning one to
+ * the other). Note that it takes advantage of the C89-guaranteed
+ * property of sizeof() - it cannot have any side effects, so anything
+ * that happens inside sizeof() will not have any effect at runtime.
+ *
+ * VIR_TYPEMATCH evaluates to "1" if the two passed values are both
+ * assignment-compatible and the same size, and otherwise generates a
+ * compile-time error. It determines the result by performing the
+ * following three operations:
+ *
+ *    * sizeof(*(a) = *(b)) assures that *a and *b are
+ *      assignment-compatible (they may still have a different size
+ *      though! e.g. longVar = intVar) (If not, there is a compile-time
+ *      error. If so, the result of that subexpression is sizeof(*(a)),
+ *      i.e. one element of the array)
+ *
+ *    * sizeof(*(a) = *(b)) == sizeof(*(b)) checks if *a and *b are also
+ *      of the same size (so that, e.g. you don't accidentally copy an
+ *      int plus the random bytes following it into an array of long). It
+ *      evaluates to 1 if they are the same, and 0 otherwise.
+ *
+ *    * sizeof(char[2 * (result of previous step) - 1]) evaluates to 1
+ *      if the previous step was successful (char [(2*1) - 1] i.e.
+ *      char[1]), or generates a compile error if it wasn't successful
+ *      (char[2*0 -1] i.e. char[-1], which isn't valid in C).
+ *
+ * So VIR_TYPECHECK(a, b) will either abort the compile with an error,
+ * or evaluate to "1", and in the meantime check that we've actually
+ * added the correct &'s and/or *'s to the arguments. (Whew!)
+*/
+# define VIR_TYPEMATCH(a, b) \
+    sizeof(char[2 * (sizeof(*(a) = *(b)) == sizeof(*(b))) - 1])
+
+/**
+ * VIR_INSERT_ELEMENT:
+ * @ptr:     pointer to array of objects (*not* ptr to ptr)
+ * @at:      index within array where new elements should be added
+ * @count:   variable tracking number of elements currently allocated
+ * @newelem: the new element to move into place (*not* a pointer to
+ *           the element, but the element itself).
+ *           (the original will be zeroed out if successful)
+ *
+ * Re-allocate an array of 'count' elements, each sizeof(*ptr) bytes
+ * long, to be 'count' + 1 elements long, then appropriately move
+ * the elements starting at ptr[at] up by 1 element, copy the
+ * item 'newelem' into ptr[at], then store the address of
+ * allocated memory in 'ptr' and the new size in 'count'.
+ *
+ * VIR_INSERT_ELEMENT_COPY is identical, but doesn't clear out the
+ *   original element to 0 on success, so there are two copies of the
+ *   element. This is useful if the "element" is actually just a
+ *   pointer to the real data, and you want to maintain a reference to
+ *   it for use after the insert is completed; but if the "element" is
+ *   an object that points to other allocated memory, having multiple
+ *   copies can cause problems (e.g. double free).
+ *
+ * VIR_INSERT_ELEMENT_*INPLACE are identical, but assume any necessary
+ *   memory re-allocation has already been done.
+ *
+ * VIR_INSERT_ELEMENT_* all need to send "1" as the "add" argument to
+ * virInsertElementsN (which has the currently-unused capability of
+ * inserting multiple items at once). We use this to our advantage by
+ * replacing it with VIR_TYPECHECK(ptr, &newelem) so that we can be
+ * assured ptr and &newelem are of compatible types.
+ *
+ * Returns -1 on failure, 0 on success
+ *
+ *
+ */
+# define VIR_INSERT_ELEMENT(ptr, at, count, newelem) \
+    virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count),    \
+                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, false)
+# define VIR_INSERT_ELEMENT_COPY(ptr, at, count, newelem) \
+    virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \
+                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, false)
+# define VIR_INSERT_ELEMENT_INPLACE(ptr, at, count, newelem) \
+    virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \
+                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, true)
+# define VIR_INSERT_ELEMENT_COPY_INPLACE(ptr, at, count, newelem) \
+    virInsertElementsN(&(ptr), sizeof(*(ptr)), at, &(count), \
+                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, true)
+
+/**
+ * VIR_APPEND_ELEMENT:
+ * @ptr:     pointer to array of objects (*not* ptr to ptr)
+ * @count:   variable tracking number of elements currently allocated
+ * @newelem: the new element to move into place (*not* a pointer to
+ *           the element, but the element itself).
+ *           (the original will be zeroed out if successful)
+ *
+ * Re-allocate an array of 'count' elements, each sizeof(*ptr) bytes
+ * long, to be 'count' + 1 elements long, then copy the item from
+ * 'newelem' into ptr[count+1], and store the address of allocated
+ * memory in 'ptr' and the new size in 'count'. If 'newelem' is NULL,
+ * the new element at ptr[at] is instead filled with zero.
+ *
+ * VIR_APPEND_ELEMENT_COPY is identical, but doesn't clear out the
+ *   original element to 0 on success, so there are two copies of the
+ *   element. This is useful if the "element" is actually just a
+ *   pointer to the real data, and you want to maintain a reference to
+ *   it for use after the append is completed; but if the "element" is
+ *   an object that points to other allocated memory, having multiple
+ *   copies can cause problems (e.g. double free).
+ *
+ * VIR_APPEND_ELEMENT_*INPLACE are identical, but assume any
+ *   necessary memory re-allocation has already been done.
+ *
+ * VIR_APPEND_ELEMENT_* all need to send "1" as the "add" argument to
+ * virInsertElementsN (which has the currently-unused capability of
+ * inserting multiple items at once). We use this to our advantage by
+ * replacing it with VIR_TYPECHECK(ptr, &newelem) so that we can be
+ * assured ptr and &newelem are of compatible types.
+ *
+ * Returns -1 on failure, 0 on success
+ *
+ *
+ */
+# define VIR_APPEND_ELEMENT(ptr, count, newelem) \
+    virInsertElementsN(&(ptr), sizeof(*(ptr)), count, &(count),  \
+                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, false)
+# define VIR_APPEND_ELEMENT_COPY(ptr, count, newelem) \
+    virInsertElementsN(&(ptr), sizeof(*(ptr)), count, &(count),  \
+                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, false)
+# define VIR_APPEND_ELEMENT_INPLACE(ptr, count, newelem) \
+    virInsertElementsN(&(ptr), sizeof(*(ptr)), count, &(count),  \
+                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, true)
+# define VIR_APPEND_ELEMENT_COPY_INPLACE(ptr, count, newelem) \
+    virInsertElementsN(&(ptr), sizeof(*(ptr)), count, &(count),  \
+                       VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, true)
+
+/**
+ * VIR_DELETE_ELEMENT:
+ * @ptr:   pointer to array of objects (*not* ptr to ptr)
+ * @at:    index within array where new elements should be deleted
+ * @count: variable tracking number of elements currently allocated
+ *
+ * Re-allocate an array of 'count' elements, each sizeof(*ptr)
+ * bytes long, to be 'count' - 1 elements long, then store the
+ * address of allocated memory in 'ptr' and the new size in 'count'.
+ * If 'count' <= 1, the entire array is freed.
+ *
+ * VIR_DELETE_ELEMENT_INPLACE is identical, but assumes any
+ *   necessary memory re-allocation will be done later.
+ *
+ * Returns -1 on failure, 0 on success
+ */
+# define VIR_DELETE_ELEMENT(ptr, at, count) \
+    virDeleteElementsN(&(ptr), sizeof(*(ptr)), at, &(count), 1, false)
+# define VIR_DELETE_ELEMENT_INPLACE(ptr, at, count) \
+    virDeleteElementsN(&(ptr), sizeof(*(ptr)), at, &(count), 1, true)
+
+/*
+ * VIR_ALLOC_VAR_OVERSIZED:
+ * @M: size of base structure
+ * @N: number of array elements in trailing array
+ * @S: size of trailing array elements
+ *
+ * Check to make sure that the requested allocation will not cause
+ * arithmetic overflow in the allocation size.  The check is
+ * essentially the same as that in gnulib's xalloc_oversized.
+ */
+# define VIR_ALLOC_VAR_OVERSIZED(M, N, S) ((((size_t)-1) - (M)) / (S) < (N))
+
+/**
+ * VIR_ALLOC_VAR:
+ * @ptr: pointer to hold address of allocated memory
+ * @type: element type of trailing array
+ * @count: number of array elements to allocate
+ *
+ * Allocate sizeof(*ptr) bytes plus an array of 'count' elements, each
+ * sizeof('type').  This sort of allocation is useful for receiving
+ * the data of certain ioctls and other APIs which return a struct in
+ * which the last element is an array of undefined length.  The caller
+ * of this type of API is expected to know the length of the array
+ * that will be returned and allocate a suitable buffer to contain the
+ * returned data.  C99 refers to these variable length objects as
+ * structs containing flexible array members.
+
+ * Returns -1 on failure, 0 on success
+ */
+# define VIR_ALLOC_VAR(ptr, type, count) \
+    virAllocVar(&(ptr), sizeof(*(ptr)), sizeof(type), (count))
+
+/**
+ * VIR_FREE:
+ * @ptr: pointer holding address to be freed
+ *
+ * Free the memory stored in 'ptr' and update to point
+ * to NULL.
+ */
+/* The ternary ensures that ptr is a pointer and not an integer type,
+ * while evaluating ptr only once.  For now, we intentionally cast
+ * away const, since a number of callers safely pass const char *.
+ */
+# define VIR_FREE(ptr) virFree((void *) (1 ? (const void *) &(ptr) : (ptr)))
+
+
+# if TEST_OOM
+void virAllocTestInit(void);
+int virAllocTestCount(void);
+void virAllocTestOOM(int n, int m);
+void virAllocTestHook(void (*func)(int, void*), void *data);
+# endif
+
+
+
+#endif /* __VIR_MEMORY_H_ */
index c4e0129716d2dc14a8a2affe0bf0a4bca5714986..a807b7604120f23922c03e0ededf71adfc37c8ab 100644 (file)
@@ -32,7 +32,7 @@
 #include "viraudit.h"
 #include "util.h"
 #include "virfile.h"
-#include "memory.h"
+#include "viralloc.h"
 
 /* Provide the macros in case the header file is old.
    FIXME: should be removed. */
index a1bad6aa5f240af6e4d82b210386fd549a47ceac..c4c5676f43fb572e77b89bc1911df10c2319c4be 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "virauth.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "datatypes.h"
 #include "virterror_internal.h"
index 46ba04051de971d312418ebbc72e25655330eb6e..a0f0be56d093c38962ff0e45350046236fe2c342 100644 (file)
@@ -25,7 +25,7 @@
 #include "virauthconfig.h"
 
 #include "virkeyfile.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virlog.h"
 #include "virterror_internal.h"
index ec1483f104a3b1ef47c6274d57544ca4c8f54d13..a7ba60e1acc0b3f707b05eed64e31531845e8688 100644 (file)
@@ -31,7 +31,7 @@
 #include <sys/types.h>
 
 #include "virbitmap.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virbuffer.h"
 #include "util.h"
 #include "c-ctype.h"
index c856c529a69a2e944931e3ddca93485681e4c707..969dcbf6b9408be31400b93396257084dfd8f6f1 100644 (file)
@@ -31,7 +31,7 @@
 #define __VIR_BUFFER_C__
 
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 
 
 /* If adding more fields, ensure to edit buf.h to match
index 82e661346834a543adaaf5166fd6de50a2453180..5c628cc8907c6a712034d3e5d129f945ba2108cc 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "vircgroup.h"
 #include "virlog.h"
 #include "virfile.h"
index 7bed04e2451e658de9b2c74ddfdfd762c93b09b7..6e17a8d9aa58ea411487273ef7d4b9fa44aba186 100644 (file)
@@ -34,7 +34,7 @@
 #endif
 
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "util.h"
 #include "virlog.h"
index 84d3c698b8363f8ca9c782b3b3d781a8a9090f82..2cd92b5c855e56bacb11e873049eb9d17228896b 100644 (file)
@@ -36,7 +36,7 @@
 #include "util.h"
 #include "c-ctype.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virfile.h"
 
 #define VIR_FROM_THIS VIR_FROM_CONF
index b6c66422337d3620d1d9531265ba478dc32cdb1b..34c46b2c97c659d0026981237c5b11c8df368218 100644 (file)
@@ -22,7 +22,7 @@
 #include <config.h>
 
 #include "virdbus.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "threads.h"
index e1c3133ea54b2dd172d01483440bce89ca0f385c..e71a0728068eb9417b0578a71a55c2625b58797c 100644 (file)
@@ -45,7 +45,7 @@
 #include "virdnsmasq.h"
 #include "util.h"
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "virfile.h"
index e8fdb8c584be354a1f80562f03298d7b111176ef..99afa50b58e78d2112bc221a514252a580d830ce 100644 (file)
@@ -44,7 +44,7 @@
 #include "internal.h"
 #include "virebtables.h"
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "threads.h"
index bdd405ff84500df6a9012a9a69cfb038ca2d88a6..535b2d44f6578dba3622c51084877f300be07ef8 100644 (file)
@@ -34,7 +34,7 @@
 #include "threads.h"
 #include "virlog.h"
 #include "vireventpoll.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virfile.h"
 #include "virterror_internal.h"
index 30294a2917c6e3c57082511e4d4cd9c7d073c754..f20ce64a517a70df2cdf2867d6c9b1892cede3fc 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "vircommand.h"
 #include "configmake.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 
index 077abcac8a79813f66e6ec46a7cb756cd1864b10..a1234c4baea6bee0a26bc80e255c5b7cddd57a8f 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "virterror_internal.h"
 #include "virhash.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virhashcode.h"
 #include "virrandom.h"
index b005f392fff741b504343d32c6661af3dc1e9d2e..140a78d19ef6aff699159c4a45aa8e62869ff47e 100644 (file)
@@ -34,7 +34,7 @@
 #include "virhook.h"
 #include "util.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virfile.h"
 #include "configmake.h"
 #include "vircommand.h"
index e8949af3da7704fbbe45ac292df1a1a62416bd7c..91a948f3f8ff1c92694447bf9595e36b2397a229 100644 (file)
@@ -30,7 +30,7 @@
 #include "virinitctl.h"
 #include "virterror_internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virfile.h"
 
 #define VIR_FROM_THIS VIR_FROM_INITCTL
index 13dd31e24225f94027b9ab27c8a7804f252b1fdf..7929073d74d40240b05db861ab899eac0cf13477 100644 (file)
@@ -42,7 +42,7 @@
 #include "internal.h"
 #include "viriptables.h"
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "threads.h"
index b0d5a1523bd6b036f250622149b4731c85fbe43a..652e38dc60ce28c93c6d8c3f897b35880d5f7fe1 100644 (file)
@@ -24,7 +24,7 @@
 #include <config.h>
 
 #include "virjson.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virlog.h"
 #include "util.h"
index b43b92de53bda0176bcf3b14a6045a14f9918c7e..fc61cf50e28d96435610dcd28cd919d7c9055dd5 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "c-ctype.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virhash.h"
 #include "virkeyfile.h"
index b6522946ae508d31bb02e9956e2d0065e3fb25c5..509b1624789e4957d182ebd5504bb2b4416f0dee 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "virlockspace.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "util.h"
 #include "virfile.h"
index 3e0f7059ba9bcc3478b1aba63ebf931b5a95febf..73a3f55afb9e6015c26ed8539f36c8e9a0d022a0 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "virterror_internal.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virbuffer.h"
 #include "threads.h"
index 5846aff5dba7d52307e3c1f883febb19696869d0..95a78977fbefa657f390a26f61884732307cef65 100644 (file)
@@ -27,7 +27,7 @@
 #include "virfile.h"
 #include "virterror_internal.h"
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "pci.h"
 #include "virlog.h"
 
index bd75a9d5b2d1ea16dccadb22bdb6620272aa168b..9cc885849cf65c93f08d84c5366468a4e1604319 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "virnetdevbandwidth.h"
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
index 2c4a9eb125532578154be7058fd5cb29097fe515..eb341a278c9b14456ab7bdd009307ba751d8b88b 100644 (file)
@@ -26,7 +26,7 @@
 #include "virterror_internal.h"
 #include "util.h"
 #include "virfile.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "intprops.h"
 
 #include <sys/ioctl.h>
index 8d2574c88a4375231c06965b6f1e75102bf6aa00..0f7107b5a152e53e86590fd9a9575739aed0acdf 100644 (file)
@@ -56,7 +56,7 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode, VIR_NETDEV_MACVLAN_MODE_LAST,
 #  define MACVLAN_MODE_PASSTHRU 8
 # endif
 
-# include "memory.h"
+# include "viralloc.h"
 # include "virlog.h"
 # include "uuid.h"
 # include "virfile.h"
index 983a240654dccad77bb83fcef5b0b7c8ff3bb302..b876a4e6152a7cd0fd39d4376313bac776bab466 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "virnetdevopenvswitch.h"
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 #include "virmacaddr.h"
 
index 644e9a4187a8a017880496a94bdd48b4331f5ad2..339d636e7085d77010f29fc6f18be7f2838425ec 100644 (file)
@@ -30,7 +30,7 @@
 #include "virterror_internal.h"
 #include "virfile.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "util.h"
 
index 630b7c92a12fc358122583e47ca16e784f4fd3e6..c6568b73c27ee6d0036c0316f5a7eb1b9afbab63 100644 (file)
@@ -26,7 +26,7 @@
 #include <sys/wait.h>
 
 #include "virnetdevveth.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "vircommand.h"
 #include "virterror_internal.h"
index 7a6ff9b1ce16535b731811460a95e3ee71027012..53c6b6500933970d735d8c9f89deabfa9652167d 100644 (file)
@@ -24,7 +24,7 @@
 #include "internal.h"
 #include "virterror_internal.h"
 #include "virnetdevvlan.h"
-#include "memory.h"
+#include "viralloc.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
 
index 834b9b9f30d3beee2089115d26603cff211a703e..60acabd5584da66f07a5fceafab7c4382e5440c6 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "virnetdevvportprofile.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 
 #define VIR_FROM_THIS VIR_FROM_NET
 
index 830e9b9084e4a8cdddfcca7dd8cd75321201a758..b132d9a59103728080c75e37d96a36eecd77ef16 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "virnetlink.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "threads.h"
 #include "virmacaddr.h"
 #include "virterror_internal.h"
index e37a2d6f630a7fc220abf45296a5a45b57662b10..1528cf185f7bb2165c1578b275695c3458945834 100644 (file)
@@ -26,7 +26,7 @@
 #include "threads.h"
 #include "datatypes.h"
 
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virterror_internal.h"
 
index aa80cabb80deb7760540370e9fdadb09222c23af..5cdd2e87239d2d284dc03f5fcf85e06d09436899 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "virobject.h"
 #include "threads.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "viratomic.h"
 #include "virterror_internal.h"
 #include "virlog.h"
index 6ec97603bf2e51dadd2453befab697d08e980fa6..3b3322b3dcf4aba563b2866cc9a30ad2af26a46b 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "virpidfile.h"
 #include "virfile.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "intprops.h"
 #include "virlog.h"
index 3c0ed8a2eea9f39e46096fd17321472d524e191a..8070b8bff0b72467e1105fd14acc5e357c18dd85 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "virprocess.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "util.h"
 
index 228c3fb418f6809506fc5408c041b076fe13661f..5607b3e217aa996cca2b331c82f45689ae56da7d 100644 (file)
@@ -22,7 +22,7 @@
 #include <config.h>
 
 #include "virstring.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virbuffer.h"
 #include "virterror_internal.h"
 
index 6e3301bef72f3d11ff8f893f981ec02ccee7ac3e..ce2d837acc8f7b1e0021c92fccfe4c8b9442bf15 100644 (file)
@@ -30,7 +30,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "threads.h"
 #include "util.h"
 
index a2610c444cc353ae57c580bf1938d4f29c44502c..f9fc2820cfeb32a3b75610acd61a47e00ed3a481 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "virtime.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virterror_internal.h"
 
 #define VIR_FROM_THIS VIR_FROM_NONE
index 7f0a44be8366d568edd5957c8f8a2ed80b454375..e08530e17fab817f4d4cd0deabcfac68503b6cc8 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <stdarg.h>
 
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virterror_internal.h"
 
index dd3b87819a89836cdc01b5bb5c6b4c6545c19e22..f48079d947f8a7af94fa16c7d0dc1944df9ec474 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "viruri.h"
 
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virterror_internal.h"
 #include "virbuffer.h"
index d0e30246b931a7131eda01ac9c8e6c6f6c12ff41..c3dd50eaf09b203d72e6e1535c60203a2169e8ef 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "virusb.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virterror_internal.h"
 
index 5b08b1f0973b9b2f93c9c91419a36b7a5f3e0ea7..caf26a3d926552b30e857c824d5249c49b5f9772 100644 (file)
@@ -34,7 +34,7 @@
 #include "xml.h"
 #include "virbuffer.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virfile.h"
 
 #define VIR_FROM_THIS VIR_FROM_XML
index 3194b7c7f6bfe9dbc22250727920b79b277707cb..cab4398bececf65975185c590af73ab82064d9e0 100644 (file)
@@ -30,7 +30,7 @@
 #define nsCID CLSID
 
 #include "internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virlog.h"
 #include "virterror_internal.h"
index 5f7028305b01437d0382b399465110800711a41b..5296127e4b1301b95b0f3fbcc042b1a673f7ce38 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "vbox_XPCOMCGlue.h"
 #include "internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virlog.h"
 #include "virterror_internal.h"
index 3a456467efd6949e51a1cfaaf5480b6630329d3c..e39a9de69c555805ec430037d6e6705660c10490 100644 (file)
@@ -49,7 +49,7 @@
 #include "storage_conf.h"
 #include "storage_file.h"
 #include "uuid.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "nodeinfo.h"
 #include "virlog.h"
 #include "vbox_driver.h"
index f82fcb3246e83ad42acc9e4aa5d5084e77d51230..6c8e9249ef2915cfa4145a5625ec86122b5100be 100644 (file)
@@ -26,7 +26,7 @@
 #include "vircommand.h"
 #include "cpu/cpu.h"
 #include "dirname.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "nodeinfo.h"
 #include "virfile.h"
 #include "uuid.h"
index d9a1333faf5154c372dfc94bb1b1336c072b7a1f..233804ed511a7e45e29ceb8ac67bfc60f94b497e 100644 (file)
@@ -27,7 +27,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "virfile.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "uuid.h"
 #include "vircommand.h"
index e34e15e4a43d906af27937fcc0393d091891d908..4d55f0b442b936f18f68693b958701b4eb4e6d19 100644 (file)
@@ -28,7 +28,7 @@
 #include "internal.h"
 #include "virterror_internal.h"
 #include "virconf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "vmx.h"
index e50b5ff3ede8bf22dca58768074eecfd8ca61780..126283b93def5b51785afa418e92718ede5b8029 100644 (file)
@@ -42,7 +42,7 @@
 # include "datatypes.h"
 # include "util.h"
 # include "block_stats.h"
-# include "memory.h"
+# include "viralloc.h"
 # include "virfile.h"
 
 # define VIR_FROM_THIS VIR_FROM_STATS_LINUX
index c281c009e5c64b7e54f8b99c4382dfdbcc585986..94df1169378b17f4ca84e720d1f5794b045ee252 100644 (file)
@@ -55,7 +55,7 @@
 #endif
 #include "xml.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "node_device_conf.h"
 #include "pci.h"
 #include "uuid.h"
index d6d387453cbd3343d2752beb2439ff4002730391..183788826a3367727518a1bdf0fc2d07d5bfb4ef 100644 (file)
@@ -75,7 +75,7 @@
 #include "xend_internal.h"
 #include "virbuffer.h"
 #include "capabilities.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "threads.h"
 #include "virfile.h"
 #include "virnodesuspend.h"
index 073663f46accae19135c89ab2f5c783021bf7952..35a625ceae29757a79852943939a3eb7b633b4aa 100644 (file)
@@ -30,7 +30,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "driver.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "xen_driver.h"
 #include "virconf.h"
 #include "domain_conf.h"
index 0364f846ea448fde390578f3ebea2d42c35f22db..a4005f4e086f91a8a754e453e399d283228337cf 100644 (file)
@@ -42,7 +42,7 @@
 #include "xen_driver.h"
 #include "xen_hypervisor.h"
 #include "xs_internal.h" /* To extract VNC port & Serial console TTY */
-#include "memory.h"
+#include "viralloc.h"
 #include "count-one-bits.h"
 #include "virfile.h"
 #include "viruri.h"
index fc7b581304d747eb9b8beac0046af1fa476af1ed..2109972425bd53572f03497f818aefbd491ff8f9 100644 (file)
@@ -46,7 +46,7 @@
 #include "virbuffer.h"
 #include "uuid.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "count-one-bits.h"
 
index 4cc82d8d49960e3355da1590df27ae57999c9222..e41496607572c9189eb1d9f62ee7e66df3a55ef9 100644 (file)
@@ -44,7 +44,7 @@
 #include "virterror_internal.h"
 #include "datatypes.h"
 #include "driver.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "uuid.h"
 #include "xen_driver.h"
index 502c6534e615ae6638fec28e4453d9dea856c056..d49181c0af8a98231f7a7d368427a0f548d3c904 100644 (file)
@@ -33,7 +33,7 @@
 #include "virauth.h"
 #include "util.h"
 #include "uuid.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virbuffer.h"
 #include "viruri.h"
 #include "xenapi_driver.h"
index 6f51100e44e99f448a7281da24cf1cc35e41ec15..33aa4d7559138708e4e4980ff1668689502c1f7e 100644 (file)
@@ -31,7 +31,7 @@
 #include "datatypes.h"
 #include "util.h"
 #include "uuid.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virbuffer.h"
 #include "virlog.h"
 #include "viruri.h"
index 2aa384dc7291c4ea8b16595cc7dea5ed62dc9c96..0cbc248d50dda8e1cfd7ed054fd243dcc728d916 100644 (file)
@@ -29,7 +29,7 @@
 #include "internal.h"
 #include "virterror_internal.h"
 #include "virconf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "verify.h"
 #include "uuid.h"
 #include "virlog.h"
index 5e284df7cf1920a61aca94c7059bad57fc92f409..8a64aad13d47dd9c7dbbe494d23ad2aa417588f4 100644 (file)
@@ -28,7 +28,7 @@
 #include "internal.h"
 #include "virterror_internal.h"
 #include "virconf.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "verify.h"
 #include "uuid.h"
 #include "sexpr.h"
index 2100aa0e21386e502e34a2c9bc950069848c67a1..3c7fef550a6c436b1d5483e8abd218ab33099e55 100644 (file)
@@ -28,7 +28,7 @@
 
 #include "internal.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virfile.h"
 #include "testutils.h"
 
index f76bc54f2ae0f3b682a11a27708d7a8f3b33d740..b15c1688d4183dbe26c0428a6f50c12508e85a88 100644 (file)
@@ -32,7 +32,7 @@
 #include "internal.h"
 #include "nodeinfo.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "vircommand.h"
 #include "virfile.h"
 #include "virpidfile.h"
index aacc5265dd9184aa047812bc974a1f0a9c835d37..d5467e800b0961f3521941d48eb82185776e0877 100644 (file)
@@ -6,7 +6,7 @@
 #include <string.h>
 #include <errno.h>
 #include "virconf.h"
-#include "memory.h"
+#include "viralloc.h"
 
 int main(int argc, char **argv)
 {
index 4a54c9fce7ccfbc35f1fa6c0238beea42eb2e863..62994094d1f75d75e9795ea900f6e8cf51791e58 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "internal.h"
 #include "xml.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virbuffer.h"
 #include "testutils.h"
 #include "cpu_conf.h"
index 201b930edc01a96e65a09e961018c028aca03756..b65009b7880ed5a1a416de5152634e65f5f641f3 100644 (file)
@@ -7,7 +7,7 @@
 # include <unistd.h>
 
 # include "internal.h"
-# include "memory.h"
+# include "viralloc.h"
 # include "testutils.h"
 # include "util.h"
 # include "vmx/vmx.h"
index dc0e06478fb9cac0f9f18a38c7147772a33b89ea..397954089ebdf5525ba6668c1d1254a585248f41 100644 (file)
@@ -12,7 +12,7 @@
 #include "testutils.h"
 #include "network_conf.h"
 #include "vircommand.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "network/bridge_driver.h"
 
 static int
index 305c7b13a9b52449488973ea8f53e3d4f6c24de6..80701a23a6eb2a267cf2195ce71cdf7a2cde7bb2 100644 (file)
@@ -7,7 +7,7 @@
 # include <unistd.h>
 
 # include "internal.h"
-# include "memory.h"
+# include "viralloc.h"
 # include "testutils.h"
 # include "util.h"
 # include "openvz/openvz_conf.h"
index caa7d645afd7e2bdae69db5eb5107bc976370822..252ad3a7f69e4267b96a000624ad2fdb4833b651 100644 (file)
@@ -7,7 +7,7 @@
 
 # include "testutils.h"
 # include "qemu/qemu_capabilities.h"
-# include "memory.h"
+# include "viralloc.h"
 
 struct testInfo {
     const char *name;
index 82f861b36ba927892dade7d303f9c5d36151100a..21a6828c16c869713a10ff5ab6208ba6161c5ebb 100644 (file)
@@ -8,7 +8,7 @@
 #ifdef WITH_QEMU
 
 # include "internal.h"
-# include "memory.h"
+# include "viralloc.h"
 # include "testutils.h"
 # include "util.h"
 # include "qemu/qemu_monitor.h"
index e4194ded3f7c73647f5f9b81a46eeca2f7da0532..1e3f0da5fcf80a3b4778f0aa4408fecda3ac343b 100644 (file)
@@ -29,7 +29,7 @@
 #include "threads.h"
 #include "qemu/qemu_monitor.h"
 #include "rpc/virnetsocket.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virlog.h"
 #include "virterror_internal.h"
index 1555b6efc17ffc5ee5a56f88126c14bd7021906a..9e2c4e44d5d51554970624b99584117ad2f95a9f 100644 (file)
@@ -12,7 +12,7 @@
 
 # include "internal.h"
 # include "testutils.h"
-# include "util/memory.h"
+# include "viralloc.h"
 # include "qemu/qemu_capabilities.h"
 # include "qemu/qemu_command.h"
 # include "qemu/qemu_domain.h"
index f8a248129b664ddc5fd01332b5f61a9a64975922..0e4959e6dc98500a8a8df39356bbf0c41a92fe65 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "internal.h"
 #include "testutils.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virlog.h"
 #include "virterror_internal.h"
index c6a175fa4e640b307038e5a4849408e523ad58ae..156ef454c6289261427b1dab746bda09a056ce51 100644 (file)
@@ -28,7 +28,7 @@
 #include "virsocketaddr.h"
 #include "testutils.h"
 #include "virlog.h"
-#include "memory.h"
+#include "viralloc.h"
 
 static void testQuietError(void *userData ATTRIBUTE_UNUSED,
                            virErrorPtr error ATTRIBUTE_UNUSED)
index 96e24d47435fef988397387cc245454274c307bc..7bb88f0debd94126a2295342d3cd15cfc012e309 100644 (file)
@@ -39,7 +39,7 @@
 #include <limits.h>
 #include "testutils.h"
 #include "internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "threads.h"
 #include "virterror_internal.h"
index 82837ab7778dba29445f5ac9f11829d8fa82e918..581bd3e3caedb7fb4e3e2c6323a74f775138086e 100644 (file)
@@ -24,7 +24,7 @@
 # define __VIT_TEST_UTILS_H__
 
 # include <stdio.h>
-# include "memory.h"
+# include "viralloc.h"
 
 # define EXIT_AM_SKIP 77 /* tell Automake we're skipping a test */
 # define EXIT_AM_HARDFAIL 99 /* tell Automake that the framework is broken */
index ea2a558896e287ad64743158f456c67cabc5e0fe..b0a258053e4cdf0a265daa51a9207e397f647aa2 100644 (file)
@@ -4,7 +4,7 @@
 
 # include "testutilslxc.h"
 # include "testutils.h"
-# include "memory.h"
+# include "viralloc.h"
 # include "domain_conf.h"
 
 
index 2ad9b2eee1ae2ec82b30c2a43a8d9009d3a2cadf..573927df572c3d940862a26e07f245a30eb423d0 100644 (file)
@@ -4,7 +4,7 @@
 
 # include "testutilsqemu.h"
 # include "testutils.h"
-# include "memory.h"
+# include "viralloc.h"
 # include "cpu_conf.h"
 # include "qemu/qemu_driver.h"
 # include "qemu/qemu_domain.h"
index 774a2f7dd442dc8083cb7fd7b35230de5f8bdb93..4fbb25ca7025c7f58d380e937fba3a7d091c1b78 100644 (file)
@@ -6,7 +6,7 @@
 #include <unistd.h>
 
 #include "internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "testutils.h"
 #include "util.h"
 
index 74cc18700eed5e8ed659bef092e8db8d7a724f57..9e7dac5859bb5d420ba50b5515fcc7aca08ce8e6 100644 (file)
@@ -26,7 +26,7 @@
 #include "testutils.h"
 #include "util.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 
 #include "virauthconfig.h"
index 53b9bbe7493765ae9522e3d793a8225cdeb84c73..ec93939c4318d1424cb06dec5ba79c47c494da83 100644 (file)
@@ -8,7 +8,7 @@
 #include "util.h"
 #include "testutils.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 
 #define TEST_ERROR(...)                             \
     do {                                            \
index 440ee8e1d811bb092f836bb3c1c6b4c343be04e0..e06179fbee5246dd0c99c954c6aa97893de65eaa 100644 (file)
@@ -23,7 +23,7 @@
 #include "testutils.h"
 #include "util.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "driver.h"
 
index 7de16d0c029005a87bb315fb77ee1cc222ebaa2e..a2a40c6dfe95c7387d36b44483071593fa431ff3 100644 (file)
@@ -9,7 +9,7 @@
 #include "virhash.h"
 #include "virhashdata.h"
 #include "testutils.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virlog.h"
 
index c6aca862a9412a6103b771817d0aee1dcf58b445..ad5a516a6d4667333008d997c38372a8e3802a8e 100644 (file)
@@ -26,7 +26,7 @@
 #include "testutils.h"
 #include "util.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 
 #include "virkeyfile.h"
index c95f5d84e5bea057c8637fd6842051819a0486bd..80478d94b97181f15d4a4ee89b6fd58e17660783 100644 (file)
@@ -27,7 +27,7 @@
 #include "testutils.h"
 #include "util.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 
 #include "virlockspace.h"
index c20f5e6e588391208ddb0da27abab480a1c4d3f1..e3517e88c8efe01d994e99035ca67fd310ec1940 100644 (file)
@@ -26,7 +26,7 @@
 #include "testutils.h"
 #include "util.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 
 #include "rpc/virnetmessage.h"
index ba281e990fa4d603c0552c37dc2527d9435b9c9e..399c4fdc4cb68394a0e1d5a74a0a4c8ecac965df 100644 (file)
@@ -30,7 +30,7 @@
 #include "testutils.h"
 #include "util.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virfile.h"
 
index 023665907b31e6d52a58a2c554d35be43a97fce9..27078ea6b4ad0a4e6698d6f75693d46814ddd6b9 100644 (file)
@@ -29,7 +29,7 @@
 #include "testutils.h"
 #include "util.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 #include "virfile.h"
 #include "vircommand.h"
index 27e490ffe1032d33d9190f00b52c7051317e29d2..a8f4c793401bbdd86b4f17e6f20e0b01000e902c 100644 (file)
@@ -25,7 +25,7 @@
 #include "testutils.h"
 #include "util.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 
 #include "virstring.h"
index c8e9a2e8c8f4ad50c273f51f77fdd61989090a21..7d7a2d6ffe839eaf51a3874175ec283727b47d24 100644 (file)
@@ -26,7 +26,7 @@
 #include "testutils.h"
 #include "util.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 
 #include "virtime.h"
index 46964b3a416bb692533693395ba862c4e2d39210..57d38955e2cb29c695f7471f5b0e6f6850160de2 100644 (file)
@@ -26,7 +26,7 @@
 #include "testutils.h"
 #include "util.h"
 #include "virterror_internal.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virlog.h"
 
 #include "viruri.h"
index c44e61fc070205ecf013d8a49825364e539faaab..03a8989983299a95db857a6b60bfc3fbd9854f4c 100644 (file)
@@ -7,7 +7,7 @@
 # include <unistd.h>
 
 # include "internal.h"
-# include "memory.h"
+# include "viralloc.h"
 # include "testutils.h"
 # include "vmx/vmx.h"
 
index 3de68fdb84cb5e477c0e3dca08d55a508595bb96..a3943e2d7b7aeda11e0d80d1af94f930cb9f2478 100644 (file)
@@ -34,7 +34,7 @@
 #include "xenxs/xen_xm.h"
 #include "testutils.h"
 #include "testutilsxen.h"
-#include "memory.h"
+#include "viralloc.h"
 
 static virCapsPtr caps;
 
index 334f321037c571c5350ae06a32346864def64558..653ab6cef3c21e82757e692cb2587af00c3164c8 100644 (file)
@@ -7,7 +7,7 @@
 # include <unistd.h>
 
 # include "internal.h"
-# include "memory.h"
+# include "viralloc.h"
 # include "testutils.h"
 # include "vmx/vmx.h"
 
index dbdaab747a5a33719c5e9b49af203ad16601f726..1d21189ad35f4f0cd20e8fd45c47184c3c24d7ad 100644 (file)
@@ -41,7 +41,7 @@
 # include "virlog.h"
 # include "util.h"
 # include "virfile.h"
-# include "memory.h"
+# include "viralloc.h"
 # include "threads.h"
 # include "virterror_internal.h"
 
index 0006c11c8699c5c075de39f7da79289a9b66c88f..a44398849cd6b3632e2015516198a19cd099a3c2 100644 (file)
@@ -34,7 +34,7 @@
 #include "internal.h"
 #include "conf/domain_conf.h"
 #include "intprops.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virmacaddr.h"
 #include "virsh-domain.h"
 #include "xml.h"
index 76d9d51c283ae4fd7315e65226be5162b3fdd0ee..b0b0c9452770e7bed8dc1bccb3f33154ea12c019 100644 (file)
@@ -42,7 +42,7 @@
 #include "c-ctype.h"
 #include "conf/domain_conf.h"
 #include "console.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virfile.h"
 #include "virkeycode.h"
index 6f129d1f11231f5e9b886581913240aaed8cea5e..2d59a75d065bf14106c593b6e79963cf31622212 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "internal.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virsh-domain.h"
 #include "xml.h"
index 956fee8e244e39deee3ea797bdc563593d80918b..40216c6b418163db0e02f3b04ed5a70037b19760 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "internal.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "xml.h"
 
index c5d494a37ed203af9fb7f12a275e4780d443cdc4..66ee7e357cc73332edb525c5715eee2e1af175f8 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "internal.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "xml.h"
 #include "conf/network_conf.h"
index 52cd874cc1f2e6516c8d222357aa096b6ab02299..7e569b3fc3a603cf27f9675da049e9585cb3f3f2 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "internal.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "xml.h"
 #include "conf/node_device_conf.h"
index 3108d1b082bbff50c44d46f6f542da6290ab6bc6..c3dba0c662cfbbd97725bdb2166bc87ef7dd442a 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "internal.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "xml.h"
 
index 4a78467f384f104a105d49e8c6244c2ae71fc780..6e296044cdbc120f417b878629b33ae2557d6952 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "internal.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "xml.h"
 #include "conf/storage_conf.h"
index ee79b972ea309d1a7fce2e838562d761e571ab13..d81e8cef8439da14c5e247905cf5adf118cf95fc 100644 (file)
@@ -34,7 +34,7 @@
 #include "internal.h"
 #include "base64.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "xml.h"
 
index d6a381de883f24cec08b8dca0b78c0df19c8e830..3fecde6bad53dca2a207c4deb6104c7a84d4c406 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "internal.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virsh-domain.h"
 #include "xml.h"
index 1bad6b1a3d232a4793f48ac8a6a5629e2d7439a6..ebfe52d8f55e34aefd7dc07a63167dd2a612bd01 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "internal.h"
 #include "virbuffer.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "util.h"
 #include "virfile.h"
 #include "virsh-pool.h"
index 5cb2e063a1c8c01b8f75aea95e29f239eb02a783..e894aff43974d76031d09eabd9b3a146524f94de 100644 (file)
@@ -59,7 +59,7 @@
 #include "virbuffer.h"
 #include "console.h"
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "xml.h"
 #include "libvirt/libvirt-qemu.h"
 #include "virfile.h"
index 5bbb5e9fda623308d28dee2b38ac33673fac3dfe..cd75ebad96cd2b3664f3c17ee43885fdc02451b3 100644 (file)
@@ -28,7 +28,7 @@
 #include <sys/utsname.h>
 
 #include "util.h"
-#include "memory.h"
+#include "viralloc.h"
 #include "virfile.h"
 #include "virt-host-validate-common.h"