mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
build: rename files.h to virfile.h
In preparation for a future patch 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.
This commit is contained in:
parent
5d804ffae4
commit
8e22e08935
2
HACKING
2
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:
|
||||
|
||||
|
2
cfg.mk
2
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)$$)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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 \
|
||||
util/virkeycode.c util/virkeycode.h \
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -493,12 +493,6 @@ virFDStreamOpenFile;
|
||||
virFDStreamCreateFile;
|
||||
|
||||
|
||||
# files.h
|
||||
virClose;
|
||||
virFclose;
|
||||
virFdopen;
|
||||
|
||||
|
||||
# hash.h
|
||||
virHashAddEntry;
|
||||
virHashCreate;
|
||||
@ -1091,6 +1085,12 @@ virAuditOpen;
|
||||
virAuditSend;
|
||||
|
||||
|
||||
# virfile.h
|
||||
virFileClose;
|
||||
virFileFclose;
|
||||
virFileFdopen;
|
||||
|
||||
|
||||
# virterror_internal.h
|
||||
virDispatchError;
|
||||
virErrorMsg;
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#if defined(WITH_BRIDGE)
|
||||
|
||||
# include "bridge.h"
|
||||
# include "files.h"
|
||||
# include "virfile.h"
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
@ -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. */
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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) {
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "util.h"
|
||||
#include "memory.h"
|
||||
#include "command.h"
|
||||
#include "files.h"
|
||||
#include "virfile.h"
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
|
@ -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__) || \
|
||||
|
@ -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;
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "virterror_internal.h"
|
||||
#include "memory.h"
|
||||
#include "logging.h"
|
||||
#include "files.h"
|
||||
#include "virfile.h"
|
||||
|
||||
#include "rpc/virnetsocket.h"
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user