In preparation for patch 12 later in this series adding new virFile APIs.
* src/util/files.h, src/util/files.c: Move...
* src/util/virfile.h, src/util/virfile.c: ...here, and rename
functions to virFile prefix. Macro names are intentionally
left alone.
* *.c: All '#include "files.h"' uses changed.
* src/Makefile.am (UTIL_SOURCES): Reflect rename.
* cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
* src/libvirt_private.syms: Likewise.
* docs/hacking.html.in: Likewise.
* HACKING: Regenerate.
---
v2: new patch
HACKING | 2 +-
cfg.mk | 2 +-
daemon/libvirtd.c | 2 +-
docs/hacking.html.in | 2 +-
src/Makefile.am | 2 +-
src/conf/domain_conf.c | 2 +-
src/conf/network_conf.c | 2 +-
src/conf/nwfilter_conf.c | 2 +-
src/conf/storage_conf.c | 2 +-
src/conf/storage_encryption_conf.c | 2 +-
src/fdstream.c | 2 +-
src/libvirt_private.syms | 12 ++++++------
src/libxl/libxl_conf.c | 2 +-
src/libxl/libxl_driver.c | 2 +-
src/locking/lock_driver_sanlock.c | 2 +-
src/lxc/lxc_container.c | 2 +-
src/lxc/lxc_controller.c | 2 +-
src/lxc/lxc_driver.c | 2 +-
src/node_device/node_device_linux_sysfs.c | 2 +-
src/nodeinfo.c | 2 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 2 +-
src/openvz/openvz_conf.c | 2 +-
src/openvz/openvz_driver.c | 2 +-
src/phyp/phyp_driver.c | 2 +-
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_conf.c | 2 +-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_migration.c | 2 +-
src/qemu/qemu_monitor.c | 2 +-
src/qemu/qemu_process.c | 2 +-
src/remote/remote_driver.c | 2 +-
src/rpc/virnetclient.c | 2 +-
src/rpc/virnetserver.c | 2 +-
src/rpc/virnetsocket.c | 2 +-
src/secret/secret_driver.c | 2 +-
src/security/security_apparmor.c | 2 +-
src/security/security_selinux.c | 2 +-
src/security/virt-aa-helper.c | 2 +-
src/storage/storage_backend.c | 2 +-
src/storage/storage_backend_fs.c | 2 +-
src/storage/storage_backend_iscsi.c | 2 +-
src/storage/storage_backend_logical.c | 2 +-
src/storage/storage_backend_mpath.c | 2 +-
src/storage/storage_backend_scsi.c | 2 +-
src/storage/storage_driver.c | 2 +-
src/test/test_driver.c | 2 +-
src/uml/uml_conf.c | 2 +-
src/uml/uml_driver.c | 2 +-
src/util/bridge.c | 2 +-
src/util/cgroup.c | 2 +-
src/util/command.c | 2 +-
src/util/conf.c | 2 +-
src/util/dnsmasq.c | 2 +-
src/util/event_poll.c | 2 +-
src/util/hooks.c | 2 +-
src/util/interface.c | 2 +-
src/util/iohelper.c | 2 +-
src/util/logging.c | 2 +-
src/util/macvtap.c | 2 +-
src/util/pci.c | 2 +-
src/util/stats_linux.c | 2 +-
src/util/storage_file.c | 2 +-
src/util/util.c | 2 +-
src/util/uuid.c | 2 +-
src/util/viraudit.c | 2 +-
src/util/{files.c => virfile.c} | 10 +++++-----
src/util/{files.h => virfile.h} | 18 +++++++++---------
src/vbox/vbox_tmpl.c | 2 +-
src/vmware/vmware_conf.c | 2 +-
src/vmware/vmware_driver.c | 2 +-
src/xen/block_stats.c | 2 +-
src/xen/xen_driver.c | 2 +-
src/xen/xen_hypervisor.c | 2 +-
src/xen/xen_inotify.c | 2 +-
src/xen/xend_internal.c | 2 +-
tests/commandhelper.c | 2 +-
tests/commandtest.c | 2 +-
tests/nodeinfotest.c | 2 +-
tests/testutils.c | 2 +-
tests/virnetsockettest.c | 2 +-
tests/xencapstest.c | 2 +-
tools/console.c | 2 +-
tools/virsh.c | 2 +-
86 files changed, 103 insertions(+), 103 deletions(-)
rename src/util/{files.c => virfile.c} (88%)
rename src/util/{files.h => virfile.h} (70%)
diff --git a/HACKING b/HACKING
index 8ebbec7..2df560a 100644
--- a/HACKING
+++ b/HACKING
@@ -417,7 +417,7 @@ File handling
Usage of the "fdopen()", "close()", "fclose()" APIs is
deprecated in libvirt
code base to help avoiding double-closing of files or file descriptors, which
is particulary dangerous in a multi-threaded applications. Instead of these
-APIs, use the macros from files.h
+APIs, use the macros from virfile.h
- Open a file from a file descriptor:
diff --git a/cfg.mk b/cfg.mk
index d243862..0a624f1 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -689,7 +689,7 @@ exclude_file_name_regexp--sc_prohibit_asprintf = \
^(bootstrap.conf$$|src/util/util\.c$$|examples/domain-events/events-c/event-test\.c$$)
exclude_file_name_regexp--sc_prohibit_close = \
- (\.p[yl]$$|^docs/|^(src/util/files\.c|src/libvirt\.c)$$)
+ (\.p[yl]$$|^docs/|^(src/util/virfile\.c|src/libvirt\.c)$$)
exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \
(^tests/qemuhelpdata/|\.(gif|ico|png)$$)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 259fcc4..38876d8 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -34,7 +34,7 @@
#include "libvirt_internal.h"
#include "virterror_internal.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index 6888687..1a32d07 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -506,7 +506,7 @@
Usage of the <code>fdopen()</code>, <code>close()</code>,
<code>fclose()</code>
APIs is deprecated in libvirt code base to help avoiding double-closing of files
or file descriptors, which is particulary dangerous in a multi-threaded
- applications. Instead of these APIs, use the macros from files.h
+ applications. Instead of these APIs, use the macros from virfile.h
</p>
<ul>
diff --git a/src/Makefile.am b/src/Makefile.am
index f4ff489..cd8fa46 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,7 +52,6 @@ UTIL_SOURCES = \
util/cgroup.c util/cgroup.h \
util/event.c util/event.h \
util/event_poll.c util/event_poll.h \
- util/files.c util/files.h \
util/hash.c util/hash.h \
util/hooks.c util/hooks.h \
util/iptables.c util/iptables.h \
@@ -80,6 +79,7 @@ UTIL_SOURCES = \
util/uuid.c util/uuid.h \
util/util.c util/util.h \
util/viraudit.c util/viraudit.h \
+ util/virfile.c util/virfile.h \
util/xml.c util/xml.h \
util/virterror.c util/virterror_internal.h
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3c3ab39..b226574 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -46,7 +46,7 @@
#include "nwfilter_conf.h"
#include "ignore-value.h"
#include "storage_file.h"
-#include "files.h"
+#include "virfile.h"
#include "bitmap.h"
#include "count-one-bits.h"
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index ae479bf..9f7ce04 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -41,7 +41,7 @@
#include "util.h"
#include "buf.h"
#include "c-ctype.h"
-#include "files.h"
+#include "virfile.h"
#define MAX_BRIDGE_ID 256
#define VIR_FROM_THIS VIR_FROM_NETWORK
diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
index 036c61a..04bfa22 100644
--- a/src/conf/nwfilter_conf.c
+++ b/src/conf/nwfilter_conf.c
@@ -46,7 +46,7 @@
#include "nwfilter_conf.h"
#include "domain_conf.h"
#include "c-ctype.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_NWFILTER
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index cc55b80..995f9a6 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -43,7 +43,7 @@
#include "buf.h"
#include "util.h"
#include "memory.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/conf/storage_encryption_conf.c b/src/conf/storage_encryption_conf.c
index 545efad..73e16ed 100644
--- a/src/conf/storage_encryption_conf.c
+++ b/src/conf/storage_encryption_conf.c
@@ -35,7 +35,7 @@
#include "xml.h"
#include "virterror_internal.h"
#include "uuid.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/fdstream.c b/src/fdstream.c
index dd742e1..d25b3f0 100644
--- a/src/fdstream.c
+++ b/src/fdstream.c
@@ -38,7 +38,7 @@
#include "logging.h"
#include "memory.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_STREAMS
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 3e3b1dd..d42e0a0 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -488,12 +488,6 @@ virFDStreamOpenFile;
virFDStreamCreateFile;
-# files.h
-virClose;
-virFclose;
-virFdopen;
-
-
# hash.h
virHashAddEntry;
virHashCreate;
@@ -1086,6 +1080,12 @@ virAuditOpen;
virAuditSend;
+# virfile.h
+virFileClose;
+virFileFclose;
+virFileFdopen;
+
+
# virterror_internal.h
virDispatchError;
virErrorMsg;
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 0f6035e..b74a4b1 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -34,7 +34,7 @@
#include "logging.h"
#include "virterror_internal.h"
#include "datatypes.h"
-#include "files.h"
+#include "virfile.h"
#include "memory.h"
#include "uuid.h"
#include "capabilities.h"
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index d52a8b6..381d90b 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -36,7 +36,7 @@
#include "virterror_internal.h"
#include "conf.h"
#include "datatypes.h"
-#include "files.h"
+#include "virfile.h"
#include "memory.h"
#include "uuid.h"
#include "command.h"
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index 62eb28b..b85f1fa 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
@@ -41,7 +41,7 @@
#include "virterror_internal.h"
#include "memory.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#include "md5.h"
#include "conf.h"
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 8e1860b..432b7f8 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -53,7 +53,7 @@
#include "memory.h"
#include "veth.h"
#include "uuid.h"
-#include "files.h"
+#include "virfile.h"
#include "command.h"
#define VIR_FROM_THIS VIR_FROM_LXC
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 346edef..7eda7ef 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -53,7 +53,7 @@
#include "veth.h"
#include "memory.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_LXC
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index afac879..80378d3 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -49,7 +49,7 @@
#include "uuid.h"
#include "stats_linux.h"
#include "hooks.h"
-#include "files.h"
+#include "virfile.h"
#include "fdstream.h"
#include "domain_audit.h"
#include "domain_nwfilter.h"
diff --git a/src/node_device/node_device_linux_sysfs.c
b/src/node_device/node_device_linux_sysfs.c
index 34e4501..f9ff20f 100644
--- a/src/node_device/node_device_linux_sysfs.c
+++ b/src/node_device/node_device_linux_sysfs.c
@@ -31,7 +31,7 @@
#include "virterror_internal.h"
#include "memory.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#include <dirent.h>
#define VIR_FROM_THIS VIR_FROM_NODEDEV
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index a53c56d..cae2564 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -45,7 +45,7 @@
#include "virterror_internal.h"
#include "count-one-bits.h"
#include "intprops.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_NONE
diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c
b/src/nwfilter/nwfilter_ebiptables_driver.c
index c9b60da..f87cfa1 100644
--- a/src/nwfilter/nwfilter_ebiptables_driver.c
+++ b/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -38,7 +38,7 @@
#include "nwfilter_conf.h"
#include "nwfilter_gentech_driver.h"
#include "nwfilter_ebiptables_driver.h"
-#include "files.h"
+#include "virfile.h"
#include "command.h"
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 561cc99..c60a97f 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -50,7 +50,7 @@
#include "memory.h"
#include "util.h"
#include "nodeinfo.h"
-#include "files.h"
+#include "virfile.h"
#include "command.h"
#include "ignore-value.h"
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index d24a5e3..f0c6f57 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -55,7 +55,7 @@
#include "nodeinfo.h"
#include "memory.h"
#include "bridge.h"
-#include "files.h"
+#include "virfile.h"
#include "logging.h"
#include "command.h"
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 2489063..e693e76 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -57,7 +57,7 @@
#include "domain_conf.h"
#include "storage_conf.h"
#include "nodeinfo.h"
-#include "files.h"
+#include "virfile.h"
#include "interface_conf.h"
#include "phyp_driver.h"
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 1421a5e..3f36212 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -28,7 +28,7 @@
#include "logging.h"
#include "virterror_internal.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#include "nodeinfo.h"
#include "cpu/cpu.h"
#include "domain_conf.h"
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ee706f9..938f113 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -31,7 +31,7 @@
#include "logging.h"
#include "virterror_internal.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#include "uuid.h"
#include "c-ctype.h"
#include "domain_nwfilter.h"
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 3d8aba4..4a17a55 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -55,7 +55,7 @@
#include "macvtap.h"
#include "cpu/cpu.h"
#include "domain_nwfilter.h"
-#include "files.h"
+#include "virfile.h"
#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f9755a4..1a17f99 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -33,7 +33,7 @@
#include "cpu/cpu.h"
#include "ignore-value.h"
#include "uuid.h"
-#include "files.h"
+#include "virfile.h"
#include <sys/time.h>
#include <fcntl.h>
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index cd65bce..20eca30 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -82,7 +82,7 @@
#include "domain_nwfilter.h"
#include "hooks.h"
#include "storage_file.h"
-#include "files.h"
+#include "virfile.h"
#include "fdstream.h"
#include "configmake.h"
#include "threadpool.h"
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 0eae661..20f0daf 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -36,7 +36,7 @@
#include "virterror_internal.h"
#include "memory.h"
#include "pci.h"
-#include "files.h"
+#include "virfile.h"
#include "qemu_cgroup.h"
#include "locking/domain_lock.h"
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 1803b9f..9c1bde5 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -37,7 +37,7 @@
#include "virterror_internal.h"
#include "memory.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#include "datatypes.h"
#include "fdstream.h"
#include "uuid.h"
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 3a30a15..6de65b9 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -35,7 +35,7 @@
#include "virterror_internal.h"
#include "memory.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 448b06e..412a454 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -48,7 +48,7 @@
#include "virterror_internal.h"
#include "memory.h"
#include "hooks.h"
-#include "files.h"
+#include "virfile.h"
#include "util.h"
#include "c-ctype.h"
#include "nodeinfo.h"
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 6ba58ed..5b7a338 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -43,7 +43,7 @@
#include "qemu_protocol.h"
#include "memory.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#include "command.h"
#include "intprops.h"
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index dfc4ed9..3b25d52 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -31,7 +31,7 @@
#include "virnetsocket.h"
#include "memory.h"
#include "threads.h"
-#include "files.h"
+#include "virfile.h"
#include "logging.h"
#include "util.h"
#include "virterror_internal.h"
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 35f18b9..731932c 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -34,7 +34,7 @@
#include "threads.h"
#include "threadpool.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#include "event.h"
#if HAVE_AVAHI
# include "virnetservermdns.h"
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 4403fc4..8c32ad3 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -38,7 +38,7 @@
#include "memory.h"
#include "virterror_internal.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#include "event.h"
#include "threads.h"
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 02cdbb9..59dc687 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -40,7 +40,7 @@
#include "util.h"
#include "uuid.h"
#include "virterror_internal.h"
-#include "files.h"
+#include "virfile.h"
#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_SECRET
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 6dfe8c9..1d49ff6 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -35,7 +35,7 @@
#include "uuid.h"
#include "pci.h"
#include "hostusb.h"
-#include "files.h"
+#include "virfile.h"
#include "configmake.h"
#include "command.h"
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 50e1978..5e6145f 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -31,7 +31,7 @@
#include "pci.h"
#include "hostusb.h"
#include "storage_file.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_SECURITY
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 856d32f..1e2feae 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -40,7 +40,7 @@
#include "uuid.h"
#include "hostusb.h"
#include "pci.h"
-#include "files.h"
+#include "virfile.h"
#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_SECURITY
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index f632edd..6243d1e 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -56,7 +56,7 @@
#include "storage_file.h"
#include "storage_backend.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#include "command.h"
#if WITH_STORAGE_LVM
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index 8d6f76d..b77cd3a 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -44,7 +44,7 @@
#include "command.h"
#include "memory.h"
#include "xml.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index 7b8dc97..346e698 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -41,7 +41,7 @@
#include "util.h"
#include "memory.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#include "command.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/storage/storage_backend_logical.c
b/src/storage/storage_backend_logical.c
index 5fe9a1f..c622d2a 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -37,7 +37,7 @@
#include "command.h"
#include "memory.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c
index 2d48a9d..f2e1419 100644
--- a/src/storage/storage_backend_mpath.c
+++ b/src/storage/storage_backend_mpath.c
@@ -35,7 +35,7 @@
#include "storage_backend.h"
#include "memory.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
index da34547..ae1e19f 100644
--- a/src/storage/storage_backend_scsi.c
+++ b/src/storage/storage_backend_scsi.c
@@ -32,7 +32,7 @@
#include "storage_backend_scsi.h"
#include "memory.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#include "command.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 997b876..9c353e3 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -45,7 +45,7 @@
#include "memory.h"
#include "storage_backend.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#include "fdstream.h"
#include "configmake.h"
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index a68cc0d..0e3bf53 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -49,7 +49,7 @@
#include "xml.h"
#include "threads.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_TEST
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 0122472..c4b6e75 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -47,7 +47,7 @@
#include "bridge.h"
#include "logging.h"
#include "domain_nwfilter.h"
-#include "files.h"
+#include "virfile.h"
#include "command.h"
#define VIR_FROM_THIS VIR_FROM_UML
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 0d6f71a..e1eedd4 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -59,7 +59,7 @@
#include "datatypes.h"
#include "logging.h"
#include "domain_nwfilter.h"
-#include "files.h"
+#include "virfile.h"
#include "fdstream.h"
#include "configmake.h"
diff --git a/src/util/bridge.c b/src/util/bridge.c
index 0f4b639..d63b2a0 100644
--- a/src/util/bridge.c
+++ b/src/util/bridge.c
@@ -24,7 +24,7 @@
#if defined(WITH_BRIDGE)
# include "bridge.h"
-# include "files.h"
+# include "virfile.h"
# include <stdlib.h>
# include <stdio.h>
diff --git a/src/util/cgroup.c b/src/util/cgroup.c
index 740cedf..c12cf32 100644
--- a/src/util/cgroup.c
+++ b/src/util/cgroup.c
@@ -31,7 +31,7 @@
#include "memory.h"
#include "cgroup.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#include "hash.h"
#define CGROUP_MAX_VAL 512
diff --git a/src/util/command.c b/src/util/command.c
index f8ee8b1..29ccaa4 100644
--- a/src/util/command.c
+++ b/src/util/command.c
@@ -38,7 +38,7 @@
#include "virterror_internal.h"
#include "util.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#include "buf.h"
#include "ignore-value.h"
#include "verify.h"
diff --git a/src/util/conf.c b/src/util/conf.c
index 377f9cd..00045b5 100644
--- a/src/util/conf.c
+++ b/src/util/conf.c
@@ -24,7 +24,7 @@
#include "util.h"
#include "c-ctype.h"
#include "memory.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_CONF
diff --git a/src/util/dnsmasq.c b/src/util/dnsmasq.c
index 55db96b..d76cf65 100644
--- a/src/util/dnsmasq.c
+++ b/src/util/dnsmasq.c
@@ -44,7 +44,7 @@
#include "memory.h"
#include "virterror_internal.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_NETWORK
#define DNSMASQ_HOSTSFILE_SUFFIX "hostsfile"
diff --git a/src/util/event_poll.c b/src/util/event_poll.c
index e2ae3a6..e8679b8 100644
--- a/src/util/event_poll.c
+++ b/src/util/event_poll.c
@@ -36,7 +36,7 @@
#include "event_poll.h"
#include "memory.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#include "ignore-value.h"
#include "virterror_internal.h"
diff --git a/src/util/hooks.c b/src/util/hooks.c
index 30e20ac..64adfcb 100644
--- a/src/util/hooks.c
+++ b/src/util/hooks.c
@@ -35,7 +35,7 @@
#include "util.h"
#include "logging.h"
#include "memory.h"
-#include "files.h"
+#include "virfile.h"
#include "configmake.h"
#include "command.h"
diff --git a/src/util/interface.c b/src/util/interface.c
index 837ecce..7b1a296 100644
--- a/src/util/interface.c
+++ b/src/util/interface.c
@@ -41,7 +41,7 @@
#include "util.h"
#include "interface.h"
#include "virterror_internal.h"
-#include "files.h"
+#include "virfile.h"
#include "memory.h"
#include "netlink.h"
diff --git a/src/util/iohelper.c b/src/util/iohelper.c
index 0368eba..6a9f355 100644
--- a/src/util/iohelper.c
+++ b/src/util/iohelper.c
@@ -35,7 +35,7 @@
#include "util.h"
#include "threads.h"
-#include "files.h"
+#include "virfile.h"
#include "memory.h"
#include "virterror_internal.h"
#include "configmake.h"
diff --git a/src/util/logging.c b/src/util/logging.c
index d340f57..a638510 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -42,7 +42,7 @@
#include "util.h"
#include "buf.h"
#include "threads.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_NONE
diff --git a/src/util/macvtap.c b/src/util/macvtap.c
index 30343c8..8386f3b 100644
--- a/src/util/macvtap.c
+++ b/src/util/macvtap.c
@@ -64,7 +64,7 @@ VIR_ENUM_IMPL(virMacvtapMode, VIR_MACVTAP_MODE_LAST,
# include "interface.h"
# include "virterror_internal.h"
# include "uuid.h"
-# include "files.h"
+# include "virfile.h"
# include "netlink.h"
# define VIR_FROM_THIS VIR_FROM_NET
diff --git a/src/util/pci.c b/src/util/pci.c
index e3f978c..a79c164 100644
--- a/src/util/pci.c
+++ b/src/util/pci.c
@@ -37,7 +37,7 @@
#include "memory.h"
#include "command.h"
#include "virterror_internal.h"
-#include "files.h"
+#include "virfile.h"
/* avoid compilation breakage on some systems */
#ifndef MODPROBE
diff --git a/src/util/stats_linux.c b/src/util/stats_linux.c
index e728b7b..72318e3 100644
--- a/src/util/stats_linux.c
+++ b/src/util/stats_linux.c
@@ -25,7 +25,7 @@
# include "util.h"
# include "stats_linux.h"
# include "memory.h"
-# include "files.h"
+# include "virfile.h"
# define VIR_FROM_THIS VIR_FROM_STATS_LINUX
diff --git a/src/util/storage_file.c b/src/util/storage_file.c
index d4460d8..68e82a9 100644
--- a/src/util/storage_file.c
+++ b/src/util/storage_file.c
@@ -37,7 +37,7 @@
#include "memory.h"
#include "virterror_internal.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
diff --git a/src/util/util.c b/src/util/util.c
index 910bb04..d83215c 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -73,7 +73,7 @@
#include "memory.h"
#include "threads.h"
#include "verify.h"
-#include "files.h"
+#include "virfile.h"
#include "command.h"
#include "nonblocking.h"
#include "passfd.h"
diff --git a/src/util/uuid.c b/src/util/uuid.c
index 805c20f..b4317df 100644
--- a/src/util/uuid.c
+++ b/src/util/uuid.c
@@ -39,7 +39,7 @@
#include "virterror_internal.h"
#include "logging.h"
#include "memory.h"
-#include "files.h"
+#include "virfile.h"
#ifndef ENODATA
# define ENODATA EIO
diff --git a/src/util/viraudit.c b/src/util/viraudit.c
index ebf3119..d0f9cc4 100644
--- a/src/util/viraudit.c
+++ b/src/util/viraudit.c
@@ -31,7 +31,7 @@
#include "logging.h"
#include "viraudit.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#include "memory.h"
/* Provide the macros in case the header file is old.
diff --git a/src/util/files.c b/src/util/virfile.c
similarity index 88%
rename from src/util/files.c
rename to src/util/virfile.c
index bef56b6..6576921 100644
--- a/src/util/files.c
+++ b/src/util/virfile.c
@@ -1,5 +1,5 @@
/*
- * files.c: safer file handling
+ * virfile.c: safer file handling
*
* Copyright (C) 2010-2011 Red Hat, Inc.
* Copyright (C) 2010 IBM Corporation
@@ -26,9 +26,9 @@
#include <unistd.h>
-#include "files.h"
+#include "virfile.h"
-int virClose(int *fdptr, bool preserve_errno)
+int virFileClose(int *fdptr, bool preserve_errno)
{
int saved_errno;
int rc = 0;
@@ -46,7 +46,7 @@ int virClose(int *fdptr, bool preserve_errno)
}
-int virFclose(FILE **file, bool preserve_errno)
+int virFileFclose(FILE **file, bool preserve_errno)
{
int saved_errno;
int rc = 0;
@@ -64,7 +64,7 @@ int virFclose(FILE **file, bool preserve_errno)
}
-FILE *virFdopen(int *fdptr, const char *mode)
+FILE *virFileFdopen(int *fdptr, const char *mode)
{
FILE *file = NULL;
diff --git a/src/util/files.h b/src/util/virfile.h
similarity index 70%
rename from src/util/files.h
rename to src/util/virfile.h
index 8b681eb..d11f902 100644
--- a/src/util/files.h
+++ b/src/util/virfile.h
@@ -1,5 +1,5 @@
/*
- * files.h: safer file handling
+ * virfile.h: safer file handling
*
* Copyright (C) 2010-2011 Red Hat, Inc.
* Copyright (C) 2010 IBM Corporation
@@ -33,21 +33,21 @@
/* Don't call these directly - use the macros below */
-int virClose(int *fdptr, bool preserve_errno) ATTRIBUTE_RETURN_CHECK;
-int virFclose(FILE **file, bool preserve_errno) ATTRIBUTE_RETURN_CHECK;
-FILE *virFdopen(int *fdptr, const char *mode) ATTRIBUTE_RETURN_CHECK;
+int virFileClose(int *fdptr, bool preserve_errno) ATTRIBUTE_RETURN_CHECK;
+int virFileFclose(FILE **file, bool preserve_errno) ATTRIBUTE_RETURN_CHECK;
+FILE *virFileFdopen(int *fdptr, const char *mode) ATTRIBUTE_RETURN_CHECK;
/* For use on normal paths; caller must check return value,
and failure sets errno per close. */
-# define VIR_CLOSE(FD) virClose(&(FD), false)
-# define VIR_FCLOSE(FILE) virFclose(&(FILE), false)
+# define VIR_CLOSE(FD) virFileClose(&(FD), false)
+# define VIR_FCLOSE(FILE) virFileFclose(&(FILE), false)
/* Wrapper around fdopen that consumes fd on success. */
-# define VIR_FDOPEN(FD, MODE) virFdopen(&(FD), MODE)
+# define VIR_FDOPEN(FD, MODE) virFileFdopen(&(FD), MODE)
/* For use on cleanup paths; errno is unaffected by close,
and no return value to worry about. */
-# define VIR_FORCE_CLOSE(FD) ignore_value(virClose(&(FD), true))
-# define VIR_FORCE_FCLOSE(FILE) ignore_value(virFclose(&(FILE), true))
+# define VIR_FORCE_CLOSE(FD) ignore_value(virFileClose(&(FD), true))
+# define VIR_FORCE_FCLOSE(FILE) ignore_value(virFileFclose(&(FILE), true))
#endif /* __VIR_FILES_H */
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 53bac79..f065728 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -54,7 +54,7 @@
#include "logging.h"
#include "vbox_driver.h"
#include "configmake.h"
-#include "files.h"
+#include "virfile.h"
#include "fdstream.h"
/* This one changes from version to version. */
diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index 044784e..efefab4 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -29,7 +29,7 @@
#include "dirname.h"
#include "memory.h"
#include "nodeinfo.h"
-#include "files.h"
+#include "virfile.h"
#include "uuid.h"
#include "virterror_internal.h"
#include "vmx.h"
diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c
index 7cec310..71f3d22 100644
--- a/src/vmware/vmware_driver.c
+++ b/src/vmware/vmware_driver.c
@@ -26,7 +26,7 @@
#include "internal.h"
#include "virterror_internal.h"
#include "datatypes.h"
-#include "files.h"
+#include "virfile.h"
#include "memory.h"
#include "uuid.h"
#include "command.h"
diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c
index 1cb5455..0bb8098 100644
--- a/src/xen/block_stats.c
+++ b/src/xen/block_stats.c
@@ -27,7 +27,7 @@
# include "util.h"
# include "block_stats.h"
# include "memory.h"
-# include "files.h"
+# include "virfile.h"
# define VIR_FROM_THIS VIR_FROM_STATS_LINUX
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 3b5df46..7e3ef77 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -49,7 +49,7 @@
#include "pci.h"
#include "uuid.h"
#include "fdstream.h"
-#include "files.h"
+#include "virfile.h"
#include "command.h"
#define VIR_FROM_THIS VIR_FROM_XEN
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 543dfb1..9700471 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -65,7 +65,7 @@
#include "buf.h"
#include "capabilities.h"
#include "memory.h"
-#include "files.h"
+#include "virfile.h"
#define VIR_FROM_THIS VIR_FROM_XEN
diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c
index 241dbc7..20e54ea 100644
--- a/src/xen/xen_inotify.c
+++ b/src/xen/xen_inotify.c
@@ -38,7 +38,7 @@
#include "xend_internal.h"
#include "logging.h"
#include "uuid.h"
-#include "files.h"
+#include "virfile.h"
#include "xm_internal.h" /* for xenXMDomainConfigParse */
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index dec8484..b0e5cb1 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -45,7 +45,7 @@
#include "xs_internal.h" /* To extract VNC port & Serial console TTY */
#include "memory.h"
#include "count-one-bits.h"
-#include "files.h"
+#include "virfile.h"
/* required for cpumap_t */
#include <xen/dom0_ops.h>
diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index d60d505..cba208a 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -29,7 +29,7 @@
#include "internal.h"
#include "util.h"
#include "memory.h"
-#include "files.h"
+#include "virfile.h"
static int envsort(const void *a, const void *b) {
diff --git a/tests/commandtest.c b/tests/commandtest.c
index 6757253..9ab446c 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -34,7 +34,7 @@
#include "util.h"
#include "memory.h"
#include "command.h"
-#include "files.h"
+#include "virfile.h"
#ifdef WIN32
diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c
index 71e2926..5abee92 100644
--- a/tests/nodeinfotest.c
+++ b/tests/nodeinfotest.c
@@ -9,7 +9,7 @@
#include "internal.h"
#include "nodeinfo.h"
#include "util.h"
-#include "files.h"
+#include "virfile.h"
#if ! (defined __linux__ && (defined(__x86_64__) || \
defined(__amd64__) || \
diff --git a/tests/testutils.c b/tests/testutils.c
index ac5d298..d9582af 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -47,7 +47,7 @@
((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + \
((int) ((T)->tv_usec - (U)->tv_usec))) / 1000.0)
-#include "files.h"
+#include "virfile.h"
static unsigned int testDebug = -1;
static unsigned int testVerbose = -1;
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 1697ced..0c86b84 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -31,7 +31,7 @@
#include "virterror_internal.h"
#include "memory.h"
#include "logging.h"
-#include "files.h"
+#include "virfile.h"
#include "rpc/virnetsocket.h"
diff --git a/tests/xencapstest.c b/tests/xencapstest.c
index 3f96cf2..9c1eba4 100644
--- a/tests/xencapstest.c
+++ b/tests/xencapstest.c
@@ -9,7 +9,7 @@
#include "xml.h"
#include "testutils.h"
#include "xen/xen_hypervisor.h"
-#include "files.h"
+#include "virfile.h"
static int
testCompareFiles(const char *hostmachine, const char *xml_rel,
diff --git a/tools/console.c b/tools/console.c
index 7ca95a3..11087e5 100644
--- a/tools/console.c
+++ b/tools/console.c
@@ -39,7 +39,7 @@
# include "console.h"
# include "logging.h"
# include "util.h"
-# include "files.h"
+# include "virfile.h"
# include "memory.h"
# include "virterror_internal.h"
diff --git a/tools/virsh.c b/tools/virsh.c
index ca92f0c..ddefb57 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -52,7 +52,7 @@
#include "memory.h"
#include "xml.h"
#include "libvirt/libvirt-qemu.h"
-#include "files.h"
+#include "virfile.h"
#include "event_poll.h"
#include "configmake.h"
#include "threads.h"
--
1.7.4.4