Displaying 20 results from an estimated 36 matches for "sysroot_len".
2018 Apr 10
0
[PATCH v2 4/5] daemon: move Mount.umount_all to new Mount_utils module
...m internal_autosync and generally as a cleanup
- * function, and since the umount will definitely fail if any
- * handles are open, we may as well close them.
- *)
- (* XXX
- aug_finalize ();
- hivex_finalize ();
- journal_finalize ();
- *)
-
- let sysroot = Sysroot.sysroot () in
- let sysroot_len = String.length sysroot in
-
- let info = read_whole_file "/proc/self/mountinfo" in
- let info = String.nsplit "\n" info in
-
- let mps = ref [] in
- List.iter (
- fun line ->
- let line = String.nsplit " " line in
- (* The field of interest is the...
2017 Jul 17
0
[PATCH v9 04/11] daemon: Implement umount_all in OCaml.
...m internal_autosync and generally as a cleanup
+ * function, and since the umount will definitely fail if any
+ * handles are open, we may as well close them.
+ *)
+ (* XXX
+ aug_finalize ();
+ hivex_finalize ();
+ journal_finalize ();
+ *)
+
+ let sysroot = Sysroot.sysroot () in
+ let sysroot_len = String.length sysroot in
+
+ let info = read_whole_file "/proc/self/mountinfo" in
+ let info = String.nsplit "\n" info in
+
+ let mps = ref [] in
+ List.iter (
+ fun line ->
+ let line = String.nsplit " " line in
+ (* The field of interest is the...
2017 Aug 09
0
[PATCH v12 05/11] daemon: Implement umount_all in OCaml.
...m internal_autosync and generally as a cleanup
+ * function, and since the umount will definitely fail if any
+ * handles are open, we may as well close them.
+ *)
+ (* XXX
+ aug_finalize ();
+ hivex_finalize ();
+ journal_finalize ();
+ *)
+
+ let sysroot = Sysroot.sysroot () in
+ let sysroot_len = String.length sysroot in
+
+ let info = read_whole_file "/proc/self/mountinfo" in
+ let info = String.nsplit "\n" info in
+
+ let mps = ref [] in
+ List.iter (
+ fun line ->
+ let line = String.nsplit " " line in
+ (* The field of interest is the...
2016 Jan 22
1
Re: [PATCH v3 2/6] daemon: Split out command() functions and CLEANUP_* macros into separate files.
...s/wait.h>
> +#include <error.h>
> +#include <errno.h>
> +
> +#include "ignore-value.h"
> +
> +#include "command.h"
> +#include "cleanups.h"
> +
> +extern int verbose;
> +
> +extern const char *sysroot;
> +extern size_t sysroot_len;
> +
> +#ifndef MAX
> +# define MAX(a,b) ((a)>(b)?(a):(b))
> +#endif
This is available in guestfs-internal-all.h -- shouldn't this new
command.c include it as well? Should be useful also for the separate
inspector tool, I guess.
Thanks,
--
Pino Toscano
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but
separating them is a lot of work.
With *both* patches applied, all the tests and extra-tests pass.
That's no guarantee however that there isn't a mistake, so I don't
think this patch is a candidate for the 1.16 branch, until it's had a
lot more testing in development.
Rich.
2018 Apr 10
9
[PATCH v2 0/5] daemon: generate almall the API OCaml interfaces
Hi,
as a followup for the signature fix for mount_vfs [1], here it is a
patch series to generate automatically all the OCaml interfaces of
daemon actions.
[1] https://www.redhat.com/archives/libguestfs/2018-April/msg00059.html
Thanks,
Pino Toscano (5):
daemon: directly use Optgroups
daemon: use the structs from the Structs module
daemon: move Lvm.lv_canonical to new Lvm_utils module
2012 Mar 09
5
[PATCH 0/5] Fixes to resize2fs (RHBZ#755729, RHBZ#801640)
https://bugzilla.redhat.com/show_bug.cgi?id=755729
This bug reports that the error message printed by the resize2fs API
calls (which comes directly from the resize2fs command) says:
Please run 'e2fsck -f /dev/vda1' first.
That command is not possible from guestfish (where it would be
'e2fsck-f' or 'e2fsck ... forceall:true').
Fixing that bug caused this bug:
2009 Nov 26
1
[PATCH] daemon: program_name must be defined for Gnulib error module.
...+++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index c67503e..b525db5 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -114,6 +114,9 @@ winsock_init (void)
const char *sysroot = "/sysroot"; /* No trailing slash. */
int sysroot_len = 8;
+/* Not used, but required by the gnulib 'error' module. */
+const char *program_name = "guestfsd";
+
static void
usage (void)
{
--
1.6.5.2
2015 Dec 02
3
[PATCH] daemon: improve internal commandrvf
...(EXIT_FAILURE);
+ }
+ }
+ if (dup2 (se_fd[PIPE_WRITE], STDERR_FILENO) == -1) {
+ perror ("dup2/se_fd[PIPE_WRITE]");
+ _exit (EXIT_FAILURE);
+ }
close (so_fd[PIPE_WRITE]);
close (se_fd[PIPE_WRITE]);
+ if (flags & COMMAND_FLAG_DO_CHROOT && sysroot_len > 0) {
+ if (chroot (sysroot) == -1) {
+ perror ("chroot in sysroot");
+ _exit (EXIT_FAILURE);
+ }
+ }
+
ignore_value (chdir ("/"));
execvp (argv[0], (void *) argv);
--
2.1.0
2014 May 20
14
Re: [PATCH] daemon: scrub-file: resolve the path before calling scrub (RHBZ#1099490).
On Tuesday 20 May 2014 15:56:16 Richard W.M. Jones wrote:
> On Tue, May 20, 2014 at 03:33:31PM +0200, Pino Toscano wrote:
> > Resolve the given path within the chroot, so scrub can be invoked
> > outside the chroot on an already-resolved path.
> > Given that realpath is used, its availability is checked manually,
> > since scrub-file already depends on the
2015 Dec 02
0
Re: [PATCH] daemon: improve internal commandrvf
...if (dup2 (se_fd[PIPE_WRITE], STDERR_FILENO) == -1) {
> + perror ("dup2/se_fd[PIPE_WRITE]");
> + _exit (EXIT_FAILURE);
> + }
> close (so_fd[PIPE_WRITE]);
> close (se_fd[PIPE_WRITE]);
>
> + if (flags & COMMAND_FLAG_DO_CHROOT && sysroot_len > 0) {
> + if (chroot (sysroot) == -1) {
> + perror ("chroot in sysroot");
> + _exit (EXIT_FAILURE);
> + }
> + }
> +
> ignore_value (chdir ("/"));
>
This could also be error-checked.
> execvp (argv[0], (void...
2016 Jan 21
0
[PATCH v3 2/6] daemon: Split out command() functions and CLEANUP_* macros into separate files.
...ys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <error.h>
+#include <errno.h>
+
+#include "ignore-value.h"
+
+#include "command.h"
+#include "cleanups.h"
+
+extern int verbose;
+
+extern const char *sysroot;
+extern size_t sysroot_len;
+
+#ifndef MAX
+# define MAX(a,b) ((a)>(b)?(a):(b))
+#endif
+
+/* For improved readability dealing with pipe arrays */
+#define PIPE_READ 0
+#define PIPE_WRITE 1
+
+/* Easy ways to run external commands. For full documentation, see
+ * 'commandrvf' below.
+ */
+int
+commandf (char **st...
2016 Jan 21
0
[PATCH v3 1/6] daemon: Rename daemon/command.c -> daemon/sh.c.
...tc_resolv_conf) {
- reply_with_perror ("malloc");
- goto error;
- }
-
- /* If /etc/resolv.conf exists, rename it to the backup file. Note
- * that on Ubuntu it's a dangling symlink.
- */
- if (lstat (rs->sysroot_etc_resolv_conf, &statbuf) == 0) {
- size_t len = sysroot_len + 32;
- char buf[len];
-
- /* Make a random name for the backup file. */
- snprintf (buf, len, "%s/etc/XXXXXXXX", sysroot);
- if (random_name (buf) == -1) {
- reply_with_perror ("random_name");
- goto error;
- }
- rs->sysroot_etc_resolv_conf_old =...
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames.
Rich.
2016 Mar 07
2
[PATCH v2] Use less stack.
...+ CLEANUP_FREE char *buf = NULL;
rs->sysroot_etc_resolv_conf_old = NULL;
@@ -174,11 +175,11 @@ set_up_etc_resolv_conf (struct resolver_state *rs)
* that on Ubuntu it's a dangling symlink.
*/
if (lstat (rs->sysroot_etc_resolv_conf, &statbuf) == 0) {
- size_t len = sysroot_len + 32;
- char buf[len];
-
/* Make a random name for the backup file. */
- snprintf (buf, len, "%s/etc/XXXXXXXX", sysroot);
+ if (asprintf (&buf, "%s/etc/XXXXXXXX", sysroot) == -1) {
+ reply_with_perror ("asprintf");
+ goto error;
+ }...
2015 Jun 23
10
[PATCH 0/7] Better testing of the guestfsd daemon.
Currently we are unable to properly run guestfsd (the daemon) under
valgrind. Attempts to run valgrind inside the appliance have not been
successful (see patch 1/7).
However we desperately need better valgrind coverage of the daemon,
particularly because it is doing a lot of complex parsing of program
output. This has been a problem for a long time.
A better way to attack this problem is to
2015 Jun 25
13
[PATCH v2 0/9] Better testing of the guestfsd daemon.
In v2:
- Kernel command line parsing now moved to the appliance.
- In the captive daemon test, the daemon cleanly shuts down on exit.
- Add another btrfs test.
Rich.
2017 Aug 03
9
[PATCH 0/6] tests: Fix handling of device API parameters (RHBZ#1477623).
https://bugzilla.redhat.com/show_bug.cgi?id=1477623
The first two patches are cleanups.
The third patch changes the way that we handle Device and Dev_or_Path
parameters so that a parameter marked as such can really only contain
a block device name (and not, for instance, a chardev). Using a
chardev here caused hangs in the API.
The next two patches fix API usage to conform to this new stricter
2016 Jan 21
8
[PATCH v3 0/6] [FOR COMMENTS ONLY] Rework inspection.
For background on this change, see:
https://rwmj.wordpress.com/2015/12/06/inspection-now-with-added-prolog/
v2 was previously posted here:
https://www.redhat.com/archives/libguestfs/2015-December/msg00038.html
To test this patch series on a real guest, you can do:
$ ./run guestfish -v -x -a /var/tmp/centos-6.img
><fs> run
><fs> debug sh "guestfs-inspection
2017 Jun 12
1
[PATCH] UNFINISHED daemon: Reimplement most inspection APIs in the daemon.
This is the (incomplete) patch which reimplements inspection
APIs in the daemon. All ‘XXX’s in this patch indicate areas
which are not yet implemented or need further work.
Rich.