On 02/11/14 17:26, Peter Krempa wrote:
Some remote filesystems are not accessible via the local filesystem
calls, but libvirt needs means to do operations on such files.
This patch adds internal APIs into the storage driver that will allow
operations on various networked and other filesystems.
---
Notes:
Version 5:
- changed error reporting scheme and re-documented
- fix indentation of makefile
- simplified conditions according to review
- fixed typos
docs/hvsupport.pl | 4 +-
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/check-drivername.pl | 1 +
src/driver.h | 30 +++++++-
src/libvirt_private.c | 180 +++++++++++++++++++++++++++++++++++++++++++++++
src/libvirt_private.h | 61 ++++++++++++++++
src/libvirt_private.syms | 9 +++
8 files changed, 285 insertions(+), 2 deletions(-)
create mode 100644 src/libvirt_private.c
create mode 100644 src/libvirt_private.h
diff --git a/src/libvirt_private.c b/src/libvirt_private.c
new file mode 100644
index 0000000..330dd88
--- /dev/null
+++ b/src/libvirt_private.c
...
+/**
+ * virStorageFileStat: returns stat struct of a file via storage driver
+ *
+ * @file: file structure pointing to the file
+ * @stat: stat structure to return data
+ *
+ * Returns 0 on success, -2 if the function isn't supported by the backend,
+ * -1 on other failure. Errno is set in case of failure.
+*/
+int
+virStorageFileStat(virStorageFilePtr file,
+ struct stat *stat)
Older complilers complain here that "stat" shadows a global symbol. I'll
change this variable name to st.
+{
+ if (file->driver->storageFileStat)
+ return file->driver->storageFileStat(file, stat);
+
+ errno = ENOSYS;
+ return -2;
+}
Peter