Displaying 6 results from an estimated 6 matches for "get_mount_point".
2015 Oct 22
2
[PATCH] Added btrfs support for vfs_min_size.
...size.c
+++ b/daemon/fs-min-size.c
@@ -21,16 +21,57 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <mntent.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include "daemon.h"
#include "actions.h"
+static char*
+get_mount_point (const char *device)
+{
+ FILE *fp;
+ struct mntent *m;
+ struct stat stat1, stat2;
+ char *path;
+
+ if (stat (device, &stat1) == -1) {
+ reply_with_perror ("stat: %s", device);
+ return NULL;
+ }
+
+ /* NB: Eventually we should aim to parse /proc/self/mountinfo, but
+...
2015 Oct 27
1
[PATCHv3] Added btrfs support to vfs_minimum_size.
...s.c --*/
extern char *ntfs_get_label (const char *device);
diff --git a/daemon/fs-min-size.c b/daemon/fs-min-size.c
index 4f93f8c..ca71c4d 100644
--- a/daemon/fs-min-size.c
+++ b/daemon/fs-min-size.c
@@ -25,12 +25,37 @@
#include "daemon.h"
#include "actions.h"
+static char*
+get_mount_point (const char *device)
+{
+ CLEANUP_FREE_STRING_LIST char **mountpoints = do_mountpoints();
+ size_t i;
+ char *path;
+
+ if (mountpoints == NULL) {
+ reply_with_error ("cannot get mountpoints");
+ return NULL;
+ }
+
+ for (i = 0; mountpoints[i] != NULL; i += 2) {
+ if (STREQ...
2015 Oct 23
0
Re: [PATCH] Added btrfs support for vfs_min_size.
...#include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> +#include <mntent.h>
> +#include <sys/stat.h>
> +#include <sys/types.h>
>
> #include "daemon.h"
> #include "actions.h"
>
> +static char*
> +get_mount_point (const char *device)
> +{
This function now exists in daemon/mount.c and here. It should
be shared. Just make the function in daemon/mount.c non-static,
and declare it in daemon/guestfsd.h, and you don't need the copy.
> + FILE *fp;
> + struct mntent *m;
> + struct stat stat1...
2015 Oct 23
1
[PATCHv2] Added btrfs support for vfs_min_size.
...ize.c
index 4f93f8c..e43237b 100644
--- a/daemon/fs-min-size.c
+++ b/daemon/fs-min-size.c
@@ -18,19 +18,35 @@
#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
#include "daemon.h"
#include "actions.h"
+static char*
+get_mount_point (const char *device)
+{
+ CLEANUP_FREE_STRING_LIST char **mountpoints = do_mountpoints();
+ size_t i;
+
+ if (mountpoints == NULL) {
+ reply_with_error ("cannot get mountpoints");
+ return NULL;
+ }
+
+ for (i = 0; mountpoints[i] != NULL; i += 2) {
+ if (STREQ (mountpoints[i...
2015 Oct 27
1
[PATCHv2] Added xfs support to vfs_minimum_size.
...b/daemon/fs-min-size.c
index ca71c4d..ba0f739 100644
--- a/daemon/fs-min-size.c
+++ b/daemon/fs-min-size.c
@@ -73,6 +73,13 @@ do_vfs_minimum_size (const mountable_t *mountable)
r = btrfs_minimum_size (path);
}
+ else if (STREQ (vfs_type, "xfs")) {
+ CLEANUP_FREE char *path = get_mount_point (mountable->device);
+ if (path == NULL)
+ return -1;
+ r = xfs_minimum_size (path);
+ }
+
else
NOT_SUPPORTED (-1, "don't know how to get minimum size of '%s' filesystems",
vfs_type);
diff --git a/daemon/xfs.c b/daemon/xfs.c
index f74...
2015 Oct 24
3
[PATCH] Added xfs support for vfs_min_size.
...b/daemon/fs-min-size.c
index e43237b..432e04f 100644
--- a/daemon/fs-min-size.c
+++ b/daemon/fs-min-size.c
@@ -64,6 +64,13 @@ do_vfs_minimum_size (const mountable_t *mountable)
r = btrfs_minimum_size (path);
}
+ else if (STREQ (vfs_type, "xfs")) {
+ CLEANUP_FREE char *path = get_mount_point (mountable->device);
+ if (path == NULL)
+ return -1;
+ r = xfs_minimum_size (path);
+ }
+
else
NOT_SUPPORTED (-1, "don't know how to get minimum size of '%s' filesystems",
vfs_type);
diff --git a/daemon/xfs.c b/daemon/xfs.c
index f74...