search for: rset2

Displaying 18 results from an estimated 18 matches for "rset2".

Did you mean: rset
2020 Feb 26
2
[PATCH] lib: command: switch from select() to poll()
...<assert.h> -#include <sys/types.h> #include <sys/stat.h> -#include <sys/select.h> +#include <poll.h> #ifdef HAVE_SYS_TIME_H #include <sys/time.h> @@ -650,37 +649,41 @@ run_child (struct command *cmd) static int loop (struct command *cmd) { - fd_set rset, rset2; - int maxfd = -1, r; + struct pollfd fds[2]; + int r; size_t nr_fds = 0; CLEANUP_FREE char *buf = safe_malloc (cmd->g, BUFSIZ); ssize_t n; - FD_ZERO (&rset); + memset (&fds, 0, sizeof fds); + + fds[0].fd = cmd->errorfd; + fds[1].fd = cmd->outfd; if (cmd->...
2013 Mar 07
4
[PATCH 0/4] Small refactorings of the protocol layer.
As the start of work to add remote support, I'm taking a close look at the protocol layer in the library. These are some small cleanups. Rich.
2012 Dec 13
2
[PATCH 1/2] daemon: NFC Use symbolic names in commandrvf
...se_fd[1]); + close (so_fd[PIPE_WRITE]); + close (se_fd[PIPE_WRITE]); FD_ZERO (&rset); - FD_SET (so_fd[0], &rset); - FD_SET (se_fd[0], &rset); + FD_SET (so_fd[PIPE_READ], &rset); + FD_SET (se_fd[PIPE_READ], &rset); quit = 0; while (quit < 2) { again: rset2 = rset; - r = select (MAX (so_fd[0], se_fd[0]) + 1, &rset2, NULL, NULL, NULL); + r = select (MAX (so_fd[PIPE_READ], se_fd[PIPE_READ]) + 1, &rset2, + NULL, NULL, NULL); if (r == -1) { if (errno == EINTR) goto again; @@ -943,20 +948,20 @@ commandrvf (...
2020 Feb 26
1
Re: [PATCH] lib: command: switch from select() to poll()
...sys/select.h> > > +#include <poll.h> > > > > #ifdef HAVE_SYS_TIME_H > > #include <sys/time.h> > > @@ -650,37 +649,41 @@ run_child (struct command *cmd) > > static int > > loop (struct command *cmd) > > { > > - fd_set rset, rset2; > > - int maxfd = -1, r; > > + struct pollfd fds[2]; > > + int r; > > size_t nr_fds = 0; > > CLEANUP_FREE char *buf = safe_malloc (cmd->g, BUFSIZ); > > ssize_t n; > > > > - FD_ZERO (&rset); > > + memset (&fds, 0, size...
2020 Feb 26
0
Re: [PATCH] lib: command: switch from select() to poll()
...nclude <sys/stat.h> > -#include <sys/select.h> > +#include <poll.h> > > #ifdef HAVE_SYS_TIME_H > #include <sys/time.h> > @@ -650,37 +649,41 @@ run_child (struct command *cmd) > static int > loop (struct command *cmd) > { > - fd_set rset, rset2; > - int maxfd = -1, r; > + struct pollfd fds[2]; > + int r; > size_t nr_fds = 0; > CLEANUP_FREE char *buf = safe_malloc (cmd->g, BUFSIZ); > ssize_t n; > > - FD_ZERO (&rset); > + memset (&fds, 0, sizeof fds); > + > + fds[0].fd = cmd->e...
2016 Jan 21
0
[PATCH v3 2/6] daemon: Split out command() functions and CLEANUP_* macros into separate files.
...+ char const* const *argv) +{ + size_t so_size = 0, se_size = 0; + int so_fd[2], se_fd[2]; + unsigned flag_copy_stdin = flags & COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN; + int flag_copy_fd = (int) (flags & COMMAND_FLAG_FD_MASK); + pid_t pid; + int r, quit, i; + fd_set rset, rset2; + char buf[256]; + char *p; + + if (stdoutput) *stdoutput = NULL; + if (stderror) *stderror = NULL; + + if (verbose) { + printf ("commandrvf: stdout=%s stderr=%s flags=0x%x\n", + stdoutput ? "y" : "n", stderror ? "y" : "n", flags...
2013 Mar 07
3
[PATCH 0/3] protocol: Abstract out socket operations.
I've been taking a long hard look at the protocol layer. It has evolved over a long time without any particular direction, and the result is, to say the least, not very organized. These patches take a first step at cleaning up the mess by abstracting out socket operations from the rest of the code. The purpose of this is to allow us to slot in a different connection layer under the
2016 Jan 26
1
[PATCH] daemon: improve debugging for "stdout on stderr" flag
...int so_fd[2], se_fd[2]; unsigned flag_copy_stdin = flags & COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN; int flag_copy_fd = (int) (flags & COMMAND_FLAG_FD_MASK); + unsigned flag_out_on_err = flags & COMMAND_FLAG_FOLD_STDOUT_ON_STDERR; pid_t pid; int r, quit, i; fd_set rset, rset2; @@ -196,7 +197,8 @@ commandrvf (char **stdoutput, char **stderror, unsigned flags, if (verbose) { printf ("commandrvf: stdout=%s stderr=%s flags=0x%x\n", - stdoutput ? "y" : "n", stderror ? "y" : "n", flags); + stdou...
2013 Feb 28
0
Implemented test coverage for using TradWeight with an Rset
...here is no test for using the TradWeight scheme with a Rset and had directed me to the test coverage of the TradWeight scheme :- http://lcov.xapian.org/latest/weight/tradweight.cc.gcov.html I have added a test to api_anydb.cc which tests the TradWeight scheme using an Rset . I simply modified the rset2 test in api_anydb.cc so that the Mset is made using the TradWeight scheme and passed an Rset to Enquire.get_mset( ) . http://xapian.org/docs/sourcedoc/html/api__anydb_8cc_source.html#l01128 The results were as expected and the test passed on all the backends . I then changed the order of the doc...
2013 Mar 03
0
Sent a pull request for testing TradWeight using an Rset.
...; TradWeight scheme with a Rset and had directed me to the test coverage of > the TradWeight scheme :- > > http://lcov.xapian.org/latest/weight/tradweight.cc.gcov.html > > I have added a test to api_anydb.cc which tests the TradWeight scheme using > an Rset . I simply modified the rset2 test in api_anydb.cc so that the Mset > is made using the TradWeight scheme and passed an Rset to Enquire.get_mset( > ) . > > http://xapian.org/docs/sourcedoc/html/api__anydb_8cc_source.html#l01128 > > The results were as expected and the test passed on all the backends . I >...
2014 Feb 13
3
Libguestfs (1.22.6) driver/changes for mingw/win32
Hi, I attached the changes I made to a vanilla libguestfs-1.22.6 in order to make it work in mingw/win32. Added is also the patch required to make QEMU compatible (add a command to QMP that lists the supported devices (the regilat way you do it print it to stderr, which is difficult to redirect in win32)). This is done on behalf of Intel Corp. Thanks, Or (oberon in irc)
2012 Oct 18
10
[PATCH 0/10] Add a mini-library for running external commands.
Inspired by libvirt's virCommand* internal mini-library, this adds some internal APIs for running commands. The first patch contains the new APIs. The subsequent patches change various parts of the library over to use it. Rich.
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
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
2010 Aug 31
13
[PATCH v2] Add progress bars
This is an updated and extended version of the original patch: https://www.redhat.com/archives/libguestfs/2010-August/msg00163.html This adds OCaml and Perl bindings (both tested), support for progress bars in virt-resize, and adds progress notifications to a number of the simpler commands. Still to do is to add progress messages to more commands. There are still a few commands which would be
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.
...ir_contains_file (dir, file)) { + if (!dir_contains_file (g, dir, file)) { va_end (args); return 0; } diff --git a/src/command.c b/src/command.c index e9f357a..866847d 100644 --- a/src/command.c +++ b/src/command.c @@ -607,7 +607,7 @@ loop (struct command *cmd) fd_set rset, rset2; int maxfd = -1, r; size_t nr_fds = 0; - char buf[BUFSIZ]; + CLEANUP_FREE char *buf = safe_malloc (cmd->g, BUFSIZ); ssize_t n; FD_ZERO (&rset); @@ -636,7 +636,7 @@ loop (struct command *cmd) if (cmd->errorfd >= 0 && FD_ISSET (cmd->errorfd, &rset2))...
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...if (sock != -1) { if (connect (sock, rr->ai_addr, rr->ai_addrlen) == 0) - break; + break; perror ("connect"); close (sock); @@ -578,40 +578,40 @@ commandrv (char **stdoutput, char **stderror, char * const* const argv) if (FD_ISSET (so_fd[0], &rset2)) { /* something on stdout */ r = read (so_fd[0], buf, sizeof buf); if (r == -1) { - perror ("read"); - goto quit; + perror ("read"); + goto quit; } if (r == 0) { FD_CLR (so_fd[0], &rset); quit++; } if (r > 0 && st...