Displaying 20 results from an estimated 27 matches for "mount_vfs_nochroot".
2017 Jul 14
0
[PATCH 09/27] daemon: Reimplement ‘mount’, ‘mount_ro’, ‘mount_options’, ‘mount_vfs’ APIs in OCaml.
Some of the oldest and most core APIs, reimplemented.
This also moves the strange ‘mount_vfs_nochroot’ function into
btrfs.c.
---
daemon/Makefile.am | 2 +
daemon/btrfs.c | 43 ++++++++++++++++++++
daemon/daemon.h | 6 ---
daemon/mount.c | 99 -----------------------------------------------
daemon/mount.ml | 62 +++++++++++++++++++++++++++++
daemo...
2014 Dec 11
1
Re: [PATCH v2 01/11] daemon: btrfs: add helper functions mount and umount
...== NULL) {
> + fprintf (stderr, "strdup\n");
> + return NULL;
> + }
> +
> + if (mkdtemp (fs_buf) == NULL) {
> + fprintf (stderr, "mkdtemp: %s\n", fs_buf);
> + free (fs_buf);
> + return NULL;
> + }
> +
> + if (mount_vfs_nochroot ("", NULL, fs, fs_buf, "<internal>") == -1) {
> + if (rmdir (fs_buf) == -1 && errno != ENOENT)
> + fprintf (stderr, "rmdir: %m\n");
> + free (fs_buf);
> + return NULL;
> + }
> + }
> +
> + return fs_buf;
&...
2014 Dec 12
0
[PATCH v3 01/11] daemon: btrfs: add helper functions mount and umount
...fs_buf = strdup ("/tmp/btrfs.XXXXXX");
+ if (fs_buf == NULL) {
+ reply_with_perror ("strdup");
+ return NULL;
+ }
+
+ if (mkdtemp (fs_buf) == NULL) {
+ reply_with_perror ("mkdtemp");
+ free (fs_buf);
+ return NULL;
+ }
+
+ if (mount_vfs_nochroot ("", NULL, fs, fs_buf, "<internal>") == -1) {
+ if (rmdir (fs_buf) == -1 && errno != ENOENT)
+ reply_with_error ("rmdir: %m\n");
+ free (fs_buf);
+ return NULL;
+ }
+ }
+
+ return fs_buf;
+}
+
+static int
+umount (char *fs_buf,...
2014 Dec 11
0
[PATCH v2 01/11] daemon: btrfs: add helper functions mount and umount
...strdup ("/tmp/btrfs.XXXXXX");
+ if (fs_buf == NULL) {
+ fprintf (stderr, "strdup\n");
+ return NULL;
+ }
+
+ if (mkdtemp (fs_buf) == NULL) {
+ fprintf (stderr, "mkdtemp: %s\n", fs_buf);
+ free (fs_buf);
+ return NULL;
+ }
+
+ if (mount_vfs_nochroot ("", NULL, fs, fs_buf, "<internal>") == -1) {
+ if (rmdir (fs_buf) == -1 && errno != ENOENT)
+ fprintf (stderr, "rmdir: %m\n");
+ free (fs_buf);
+ return NULL;
+ }
+ }
+
+ return fs_buf;
+}
+
+static int
+umount (char *fs_buf, c...
2014 Dec 12
15
[PATCH v3 00/11] btrfs support part2: qgroup/quota commands
Hi,
This is v3 series to add support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
changes:
v3:
- don't intialize fs_buf (patch 1)
- check the return value of sysroot_path (patch 1)
- check fs_buf rather than fs (patch 1)
- fprintf (stderr,...) -> reply_with_error()
v2:
- add tests for new APIs
- combine
2013 Feb 12
7
Remaining btrfs patches
[PATCH 1/7] mount: Add mount_vfs_nochroot
This is significantly reworked from before. umount is gone as
discussed, and variable motion is minimised.
[PATCH 2/7] btrfs: Update btrfs_subvolume_list to take
Already provisionally ACKed. Previous comment was that cleanup could
be tidier. I looked into creating a new cleanup function for fs_b...
2014 Dec 11
14
[PATCH v2 00/11] btrfs support part2: qgroup/quota commands
Hi,
This is v2 series to add support to btrfs qgroup related commands, inclduing
quota commands, and two leftover of subvolume commands.
Regards,
Hu
changes:
v2:
- add tests for new APIs
- combine btrfs_quota_enable and btrfs_quota_disable
- following APIs changed to operate on Mountable_or_Path:
btrfs_subvolume_get_default, btrfs_quota_enable, btrfs_quota_rescan.
Hu Tao (11):
2017 Jun 19
0
[PATCH v7 13/13] daemon: Link guestfsd with libutils.
...+
+#ifdef HAVE_ATTRIBUTE_CLEANUP
+#define CLEANUP_AUG_CLOSE __attribute__((cleanup(cleanup_aug_close)))
+#define CLEANUP_FREE_STRINGSBUF __attribute__((cleanup(cleanup_free_stringsbuf)))
+#else
+#define CLEANUP_AUG_CLOSE
+#define CLEANUP_FREE_STRINGSBUF
+#endif
+
/*-- in mount.c --*/
extern int mount_vfs_nochroot (const char *options, const char *vfstype,
@@ -109,21 +127,12 @@ extern int end_stringsbuf (struct stringsbuf *sb);
extern char **take_stringsbuf (struct stringsbuf *sb);
extern void free_stringsbuf (struct stringsbuf *sb);
-extern size_t count_strings (char *const *argv);
extern void sort_str...
2017 Jun 03
12
[PATCH v2 00/12] Allow APIs to be implemented in OCaml.
Version 1 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00003.html
This patch series reimplements a few more APIs in OCaml, including
some very important core APIs like ?list_filesystems? and ?mount?.
All the tests pass after this.
The selection of APIs that I have moved may look a little random, but
in fact they are all APIs consumed by the inspection code (and some
more
2017 Jun 05
19
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
v2 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00008.html
This series gets as far as a working (and faster) reimplementation of
‘guestfs_list_filesystems’.
I also have another patch series on top of this one which reimplements
the inspection APIs inside the daemon, but that needs a bit more work
still, since inspection turns out to be a very large piece of code.
Rich.
2017 Jul 27
23
[PATCH v3 00/23] Reimplement many daemon APIs in OCaml.
I think this fixes everything mentioned:
- Added the Optgroups module as suggested.
- Remove command temporary files.
- Replace command ~flags with ?fold_stdout_on_stderr.
- Nest _with_mounted function.
- Rebase & retest.
Rich.
2017 Jul 21
27
[PATCH v2 00/23] Reimplement many daemon APIs in OCaml.
v1 was posted here:
https://www.redhat.com/archives/libguestfs/2017-July/msg00098.html
This series now depends on two small patches which I posted separately:
https://www.redhat.com/archives/libguestfs/2017-July/msg00207.html
https://www.redhat.com/archives/libguestfs/2017-July/msg00209.html
v1 -> v2:
- Previously changes to generator/daemon.ml were made incrementally
through the patch
2014 Sep 23
0
[PATCH 13/13] syntax-check: fix trailing_blank check
...* to perform the operations on a guest handle.
- *
+ *
* Note that inspection must have been done on the handle, and
* filesystems must be mounted up.
*)
diff --git a/daemon/mount.c b/daemon/mount.c
index c5b7d89..9647b35 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -166,7 +166,7 @@ mount_vfs_nochroot (const char *options, const char *vfstype,
return -1;
}
}
-
+
else {
if (asprintf (&options_plus, "subvol=%s", mountable->volume) == -1) {
reply_with_perror ("asprintf");
diff --git a/fish/test-file-attrs.sh b/fish/test-file-a...
2017 Jul 14
45
[PATCH 00/27] Reimplement many daemon APIs in OCaml.
Previously posted as part of the mega utilities/inspection
series here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00232.html
What I've done is to extract just the parts related to rewriting
daemon APIs in OCaml, rebase them on top of the current master, fix a
few things, and recompile and test everything.
Rich.
2017 Jul 24
6
[PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
Replace GUESTFSD_EXT_CMD with a command line option
‘./guestfsd --print-external-commands’
2014 Sep 23
27
[PATCH 00/13] syntax-check
Hi Rich,
This series includes patches to make `make syntax-check` pass.
Some of the fix require change to maint.mk, but the file is not in git
repo. Is it intended?
Thanks!
Hu Tao (13):
syntax-check: dirty hack to pass bindtextdomain check
syntax-check: fix error_message_period check
syntax-check: fix makefile_at_at_check
syntax-check: fix prohibit_assert_without_use check
2017 Jun 12
32
[PATCH v5 00/32] Refactor utilities, implement some APIs in OCaml.
This is a combination of:
https://www.redhat.com/archives/libguestfs/2017-June/msg00046.html
[PATCH 00/12] Refactor utility functions.
plus:
https://www.redhat.com/archives/libguestfs/2017-June/msg00023.html
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
with the second patches rebased on top of the utility refactoring, and
some other adjustments and extensions.
This passes
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...CMD(str_mount, mount);
-GUESTFSD_EXT_CMD(str_umount, umount);
-
/* You must mount something on "/" first before many operations.
* Hence we have an internal function which can test if something is
* mounted on *or under* the sysroot directory. (It has to be *or
@@ -176,11 +173,11 @@ mount_vfs_nochroot (const char *options, const char *vfstype,
int r;
if (vfstype)
r = command (NULL, &error,
- str_mount, "-o", options_plus ? options_plus : options,
+ "mount", "-o", options_plus ? options_plus : options,...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
..._CMD(str_mount, mount);
-GUESTFSD_EXT_CMD(str_umount, umount);
+DECLARE_EXTERNAL_COMMANDS ("mount", "umount")
/* You must mount something on "/" first before many operations.
* Hence we have an internal function which can test if something is
@@ -176,11 +175,11 @@ mount_vfs_nochroot (const char *options, const char *vfstype,
int r;
if (vfstype)
r = command (NULL, &error,
- str_mount, "-o", options_plus ? options_plus : options,
+ "mount", "-o", options_plus ? options_plus : options,...
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...ed int) mode); \
- return -1; \
- } \
+ (unsigned int) mode); \
+ return -1; \
+ } \
} while (0)
int
diff --git a/daemon/mount.c b/daemon/mount.c
index c5b7d89..5dd7da2 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -160,8 +160,7 @@ mount_vfs_nochroot (const char *options, const char *vfstype,
if (mountable->type == MOUNTABLE_BTRFSVOL) {
if (options && strlen (options) > 0) {
if (asprintf (&options_plus, "subvol=%s,%s",
- mountable->volume, options) == -1)
- {
+...