Displaying 10 results from an estimated 10 matches for "guestfs_int_xfsinfo".
2017 Mar 10
2
[PATCH 1/2] daemon: generate cleanup handlers for structs
This way it is possible to cleanup properly structs in the daemon, when
using them within other daemon functions.
---
.gitignore | 2 +
daemon/Makefile.am | 4 ++
daemon/daemon.h | 1 +
generator/daemon.ml | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++
generator/daemon.mli | 2 +
generator/main.ml | 4 ++
6 files changed, 114 insertions(+)
diff --git
2017 Mar 10
0
[PATCH 2/2] daemon: fix memory leak in xfs implementation of vfs_minimum_size
Use the proper cleanup handler for deleting the guestfs_int_xfsinfo
struct (so the string fields are deleted too).
Fixes commit f5caa421d1bb826559ec7a6d98c1a6b6b1f0a629.
---
daemon/xfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/xfs.c b/daemon/xfs.c
index 7f72e6a..a0d08b2 100644
--- a/daemon/xfs.c
+++ b/daemon/xfs.c
@@ -664,7 +664...
2012 Jul 16
2
[PATCH V4] NEW API: add new api xfs_info
...return 0;
+}
+
+static int
+parse_uint64 (uint64_t *ret, const char *str)
+{
+ uint64_t r;
+
+ if (sscanf (str, "%" SCNu64, &r) != 1) {
+ reply_with_error ("cannot parse numeric field from isoinfo: %s", str);
+ return -1;
+ }
+
+ *ret = r;
+ return 0;
+}
+
+static guestfs_int_xfsinfo *
+parse_xfs_info (char **lines)
+{
+ guestfs_int_xfsinfo *ret;
+ char *buf, *p;
+ size_t i;
+
+ ret = calloc (1, sizeof *ret);
+ if (ret == NULL) {
+ reply_with_error ("calloc");
+ return NULL;
+ }
+
+ for (i = 0; lines[i] != NULL; ++i) {
+ if (p = strstr (lines[i], "...
2012 Jul 31
1
[PATCH] xfs: add new api xfs-growfs
...| 1 +
src/MAX_PROC_NR | 2 +-
5 files changed, 140 insertions(+), 3 deletions(-)
diff --git a/daemon/xfs.c b/daemon/xfs.c
index e0f0062..97da3f1 100644
--- a/daemon/xfs.c
+++ b/daemon/xfs.c
@@ -348,3 +348,122 @@ error:
free_strings (lines);
return ret;
}
+
+guestfs_int_xfsinfo *
+do_xfs_growfs (const char *path,
+ int datasec, int logsec, int rtsec,
+ int64_t datasize, int64_t logsize, int64_t rtsize,
+ int64_t rtextsize, int32_t maxpct)
+{
+
+#define MAX_ARGS 64
+
+ int r;
+ char *buf;
+ char *out = NULL, *err = NULL;
+ char...
2012 Jul 24
3
[PATCH V4 1/3] umount: add force umount and lazy umount
Add the option force and lazy for force and lazy umount.
Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
---
daemon/mount.c | 25 +++++++++++++++++++++++--
generator/generator_actions.ml | 23 ++++++++++++-----------
gobject/Makefile.inc | 2 ++
po/POTFILES | 1 +
4 files changed, 38 insertions(+), 13 deletions(-)
diff --git
2015 Oct 24
3
[PATCH] Added xfs support for vfs_min_size.
...filesystems",
vfs_type);
diff --git a/daemon/xfs.c b/daemon/xfs.c
index f748902..c4533bf 100644
--- a/daemon/xfs.c
+++ b/daemon/xfs.c
@@ -660,3 +660,15 @@ do_xfs_repair (const char *device,
return r;
}
+
+int64_t
+xfs_minimum_size (const char *path)
+{
+ CLEANUP_FREE guestfs_int_xfsinfo *info = do_xfs_info (path);
+
+ if (info == NULL)
+ return -1;
+
+ // XFS does not support shrinking.
+ return info->xfs_blocksize * info->xfs_datablocks;
+}
diff --git a/generator/actions.ml b/generator/actions.ml
index 8832410..d8af08d 100644
--- a/generator/actions.ml
+++ b/generator...
2015 Oct 27
1
[PATCHv2] Added xfs support to vfs_minimum_size.
...filesystems",
vfs_type);
diff --git a/daemon/xfs.c b/daemon/xfs.c
index f748902..abc2736 100644
--- a/daemon/xfs.c
+++ b/daemon/xfs.c
@@ -660,3 +660,19 @@ do_xfs_repair (const char *device,
return r;
}
+
+int64_t
+xfs_minimum_size (const char *path)
+{
+ CLEANUP_FREE guestfs_int_xfsinfo *info = do_xfs_info (path);
+
+ if (info == NULL)
+ return -1;
+
+ // XFS does not support shrinking.
+ if (INT64_MAX / info->xfs_blocksize < info->xfs_datablocks) {
+ reply_with_error ("filesystem size too big: overflow");
+ return -1;
+ }
+ return info->xfs_blo...
2012 Jul 23
1
[PATCH V3 1/2] umount: add force umount and lazy umount
Add the option force and lazy for force and lazy umount.
Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
---
daemon/mount.c | 25 +++++++++++++++++++++++--
generator/generator_actions.ml | 23 ++++++++++++-----------
gobject/Makefile.inc | 2 ++
po/POTFILES | 1 +
4 files changed, 38 insertions(+), 13 deletions(-)
diff --git
2012 Jul 23
3
[PATCH V2 1/4] mount: add a macro to resolve path or device
Add a macro STRDUP_RESOLVE_DEVICE_OR_PATH to resolve path or device.
Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
---
daemon/daemon.h | 16 ++++++++++++++++
daemon/mount.c | 13 ++-----------
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 85eec45..f7d0c75 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -336,6
2012 Jul 21
5
[PATCH 1/5] mount: add a macro to resolve path or device
Add a macro DUP_RESOLVE_DEVICE_OR_PATH to resolve path or device.
Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
---
daemon/daemon.h | 18 ++++++++++++++++++
daemon/mount.c | 13 ++-----------
po/POTFILES | 8 ++++++++
3 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 85eec45..39cc3f3 100644
--- a/daemon/daemon.h
+++