search for: pipe_read

Displaying 12 results from an estimated 12 matches for "pipe_read".

2012 Dec 13
2
[PATCH 1/2] daemon: NFC Use symbolic names in commandrvf
Improve readability of commandrvf() by replacing bare int values for file descriptors with their symbolic names STD{IN,OUT,ERR}_FILENO. Also add PIPE_READ and PIPE_WRITE for referencing relevant ends of a pipe. --- daemon/guestfsd.c | 79 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 5c84849..4b3dd5f 100644 --- a/daemon/guestfsd.c ++...
2016 Jan 21
0
[PATCH v3 2/6] daemon: Split out command() functions and CLEANUP_* macros into separate files.
...gnore-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 **stdoutput, char **stderror, unsigned flags, + const char *name, ...) +{ + va_list args; + /* NB: Mustn't free the strings which a...
2016 Jan 26
1
[PATCH] daemon: improve debugging for "stdout on stderr" flag
...t;n", + stderror ? "y" : "n", flags); fputs ("commandrvf: ", stdout); fputs (argv[0], stdout); for (i = 1; argv[i] != NULL; ++i) { @@ -261,7 +263,7 @@ commandrvf (char **stdoutput, char **stderror, unsigned flags, } close (so_fd[PIPE_READ]); close (se_fd[PIPE_READ]); - if (!(flags & COMMAND_FLAG_FOLD_STDOUT_ON_STDERR)) { + if (!flag_out_on_err) { if (dup2 (so_fd[PIPE_WRITE], STDOUT_FILENO) == -1) { perror ("dup2/so_fd[PIPE_WRITE]"); _exit (EXIT_FAILURE); -- 2.5.0
2015 Dec 02
3
[PATCH] daemon: improve internal commandrvf
...(ignore failure) */ - ignore_value (open ("/dev/null", O_RDONLY|O_CLOEXEC)); + /* Set stdin to /dev/null. */ + if (open ("/dev/null", O_RDONLY) == -1) { + perror ("open(/dev/null)"); + _exit (EXIT_FAILURE); + } } close (so_fd[PIPE_READ]); close (se_fd[PIPE_READ]); - if (!(flags & COMMAND_FLAG_FOLD_STDOUT_ON_STDERR)) - dup2 (so_fd[PIPE_WRITE], STDOUT_FILENO); - else - dup2 (se_fd[PIPE_WRITE], STDOUT_FILENO); - dup2 (se_fd[PIPE_WRITE], STDERR_FILENO); + if (!(flags & COMMAND_FLAG_FOLD_STDOUT_ON_ST...
2015 Dec 05
6
[PATCH 0/6 v2] [FOR COMMENTS ONLY] Rework inspection.
This is a more working version. Inspection (partially) succeeds on a real guest this time :-) You can test it out on a real guest (in this case, a CentOS disk image located at /tmp/centos-6.img) by doing: $ ./run guestfish -v -x -a /tmp/centos-6.img ><fs> run ><fs> debug sh "guestfs-inspection --verbose" which will print lots of debugging, and at the end the
2015 Dec 02
0
Re: [PATCH] daemon: improve internal commandrvf
...alue (open ("/dev/null", O_RDONLY|O_CLOEXEC)); > + /* Set stdin to /dev/null. */ > + if (open ("/dev/null", O_RDONLY) == -1) { > + perror ("open(/dev/null)"); > + _exit (EXIT_FAILURE); > + } > } > close (so_fd[PIPE_READ]); > close (se_fd[PIPE_READ]); > - if (!(flags & COMMAND_FLAG_FOLD_STDOUT_ON_STDERR)) > - dup2 (so_fd[PIPE_WRITE], STDOUT_FILENO); > - else > - dup2 (se_fd[PIPE_WRITE], STDOUT_FILENO); > - dup2 (se_fd[PIPE_WRITE], STDERR_FILENO); > + if (!(flags &...
2013 Aug 18
3
missing chdir before chroot in guestfsd
...wd" (unreachable)/ ><fs> sh "cd / ; /bin/pwd" / This untested change may fix it. =================== --- libguestfs-1.20.10.orig/daemon/guestfsd.c +++ libguestfs-1.20.10/daemon/guestfsd.c @@ -879,7 +879,11 @@ commandrvf (char **stdoutput, char **std close (stdin_fd[PIPE_READ]); close (stdin_fd[PIPE_WRITE]); - if (chroot (sysroot) == -1) { + if (chdir (sysroot) == -1) { + perror ("chdir"); + _exit (EXIT_FAILURE); + } + if (chroot (".") == -1) { perror ("chroot"); _exit (EXIT_FAILU...
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
2005 Nov 09
1
kernel BUG at arch/xen/i386/mm/hypervisor.c:354, (xen_create _contiguous_region)!
...x1d0 Ä<c025efcd>Ü sock_alloc_send_skb+0x2d/0x40 Ä<c02aff19>Ü unix_stream_sendmsg+0x199/0x470 Ä<c02c52a2>Ü schedule+0x3f2/0x780 Ä<c025be31>Ü sock_aio_write+0x101/0x120 Ä<c01778df>Ü pipe_wait+0x8f/0xb0 Ä<c0169c39>Ü do_sync_write+0xc9/0x110 Ä<c0177c0a>Ü pipe_readv+0x2ba/0x360 Ä<c0139200>Ü autoremove_wake_function+0x0/0x60 Ä<c0199c9a>Ü dnotify_parent+0x3a/0xe0 Ä<c0177ce8>Ü pipe_read+0x38/0x40 Ä<c0169d2c>Ü vfs_write+0xac/0x160 Ä<c0169eb1>Ü sys_write+0x51/0x80 Ä<c010a1e9>Ü syscall_call+0x7/0xb Kernel panic - not syncin...
2013 Aug 19
0
Re: missing chdir before chroot in guestfsd
...uot;cd / ; /bin/pwd" > / > > This untested change may fix it. > > =================== > --- libguestfs-1.20.10.orig/daemon/guestfsd.c > +++ libguestfs-1.20.10/daemon/guestfsd.c > @@ -879,7 +879,11 @@ commandrvf (char **stdoutput, char **std > close (stdin_fd[PIPE_READ]); > close (stdin_fd[PIPE_WRITE]); > > - if (chroot (sysroot) == -1) { > + if (chdir (sysroot) == -1) { > + perror ("chdir"); > + _exit (EXIT_FAILURE); > + } > + if (chroot (".") == -1) { > perror (&q...
2005 Aug 28
0
Help with kernel crash log file included.
...:22:34 unifiedpaging kernel: [<c0149189>] do_swap_page+0x76/0x2c5 Aug 28 04:22:34 unifiedpaging kernel: [<c0149a28>] handle_mm_fault+0xf8/0x175 Aug 28 04:22:34 unifiedpaging kernel: [<c011a65b>] do_page_fault+0x1ae/0x5b6 Aug 28 04:22:34 unifiedpaging kernel: [<c01604b3>] pipe_readv+0x225/0x29e Aug 28 04:22:34 unifiedpaging kernel: [<c0160548>] pipe_read+0x1c/0x20 Aug 28 04:22:34 unifiedpaging kernel: [<c0156011>] vfs_read+0xb6/0xe2 Aug 28 04:22:34 unifiedpaging kernel: [<c0156224>] sys_read+0x3c/0x62 Aug 28 04:22:34 unifiedpaging kernel: [<c011a4ad&g...
2011 Jul 08
5
btrfs hang in flush-btrfs-5
Hi - I''m trying btrfs with kernel 2.6.38.8-32.fc15.x86_64 (a Fedora kernel). I''m just doing a tar-to-tar copy onto the file system with compress- force=zlib. Here are some traces of the stuck processes. flush-btrfs-5 seems to be stuck: Jul 8 11:49:40 xback2 kernel: [74920.681032] flush-btrfs-5 D ffff88003c7bae60 0 11712 2 0x00000080 Jul 8 11:49:40 xback2 kernel: