]> xenbits.xensource.com Git - libvirt.git/commit
save: add virFileDirectFd wrapper type
authorEric Blake <eblake@redhat.com>
Mon, 11 Jul 2011 21:26:33 +0000 (15:26 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 21 Jul 2011 22:24:08 +0000 (16:24 -0600)
commit519a1c43791c369c2d1fa4ca058c5a824bedfe0d
tree2af4da3b3dbadcf68504714e2c6321bfa0d9462a
parent12291656b135ed788e41dadbd2d15e613ddea9b5
save: add virFileDirectFd wrapper type

O_DIRECT has stringent requirements.  Rather than make lots of changes
at each site that wants to use O_DIRECT, it is easier to offload
the work through a helper process that mirrors the I/O between a
pipe and the actual direct fd, so that the other end of the pipe
no longer has to worry about constraints.

Plus, if the kernel ever gains better posix_fadvise support, then we
only have to touch a single file to let all callers benefit from a
more efficient way to avoid file system caching.

* src/util/virfile.h (virFileDirectFdFlag, virFileDirectFdNew)
(virFileDirectFdClose, virFileDirectFdFree): New prototypes.
* src/util/virdirect.c: Implement new wrapper object.
* src/libvirt_private.syms (virfile.h): Export new symbols.
* cfg.mk (useless_free_options): Add to list.
* po/POTFILES.in: Add new translations.
cfg.mk
po/POTFILES.in
src/libvirt_private.syms
src/util/virfile.c
src/util/virfile.h