On Tue, Jul 19, 2011 at 10:20:28PM -0600, Eric Blake wrote:
In order to choose whether to use O_DIRECT when saving a domain
image
to a file, we need a new flag. But virDomainSave was implemented
before our policy of all new APIs having a flag argument. Likewise
for virDomainRestore when restoring from a file.
The new flag name is chosen as CACHE_BYPASS so as not to preclude
a future solution that uses posix_fadvise once the Linux kernel has
a smarter implementation of that interface.
* include/libvirt/libvirt.h.in (virDomainCreateFlags)
(virDomainCoreDumpFlags): Add a flag.
(virDomainSaveFlags, virDomainRestoreFlags): New prototypes.
* src/libvirt.c (virDomainSaveFlags, virDomainRestoreFlags): New API.
* src/libvirt_public.syms: Export them.
* src/driver.h (virDrvDomainSaveFlags, virDrvDomainRestoreFlags):
New driver callbacks.
---
v2: rename flag from _DIRECT to _BYPASS_CACHE, and merged 1 and 11 of v1
include/libvirt/libvirt.h.in | 30 ++++++-
src/driver.h | 12 +++
src/libvirt.c | 181 +++++++++++++++++++++++++++++++++++++++++-
src/libvirt_public.syms | 2 +
4 files changed, 219 insertions(+), 6 deletions(-)
ACK
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|