search for: fdbuf

Displaying 15 results from an estimated 15 matches for "fdbuf".

Did you mean: dbuf
2015 Feb 02
1
Re: [PATCH 5/6] New APIs: copy-in and copy-out
...f_size, const char *path, const char **dirname, const char **basename); > + > +int > +guestfs__copy_in (guestfs_h *g, const char *localpath, const char *remotedir) > +{ > + CLEANUP_CMD_CLOSE struct command *cmd = guestfs___new_command (g); > + int fd; > + int r; > + char fdbuf[64]; > + size_t buf_len = strlen (localpath) + 1; > + char buf[buf_len]; > + const char *dirname, *basename; > + > + if (guestfs_is_dir (g, remotedir) == -1) > + return -1; I suppose this is here to check that remotedir is a directory, but that's not what the code here...
2017 Feb 15
1
[PATCH v2] copy-out: new optional arguments
...*g, + const char *remotepath, const char *localdir, + const struct guestfs_copy_out_opts_argv *optargs) { struct stat statbuf; int r; @@ -170,6 +171,7 @@ guestfs_impl_copy_out (guestfs_h *g, struct copy_out_child_data data; char fdbuf[64]; int fd; + struct guestfs_tar_out_opts_argv tar_optargs = { .bitmask = 0 }; r = guestfs_is_dir (g, remotepath); if (r == -1) @@ -210,7 +212,28 @@ guestfs_impl_copy_out (guestfs_h *g, snprintf (fdbuf, sizeof fdbuf, "/dev/fd/%d", fd); - r = guestfs_tar_ou...
2015 Jan 26
6
[PATCH 1/6] cmd: add a way to run (and wait) asynchronously commands
--- src/command.c | 64 +++++++++++++++++++++++++++++++++++++++++++------- src/guestfs-internal.h | 3 +++ 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/command.c b/src/command.c index 4bb469b..e26573d 100644 --- a/src/command.c +++ b/src/command.c @@ -360,7 +360,7 @@ debug_command (struct command *cmd) } static int -run_command (struct command *cmd)
2015 Jan 26
0
[PATCH 5/6] New APIs: copy-in and copy-out
...tic int split_path (char *buf, size_t buf_size, const char *path, const char **dirname, const char **basename); + +int +guestfs__copy_in (guestfs_h *g, const char *localpath, const char *remotedir) +{ + CLEANUP_CMD_CLOSE struct command *cmd = guestfs___new_command (g); + int fd; + int r; + char fdbuf[64]; + size_t buf_len = strlen (localpath) + 1; + char buf[buf_len]; + const char *dirname, *basename; + + if (guestfs_is_dir (g, remotedir) == -1) + return -1; + + if (split_path (buf, buf_len, localpath, &dirname, &basename) == -1) + return -1; + + guestfs___cmd_add_arg (cmd,...
2017 Feb 14
0
[PATCH 06/10] copy-out: new 'excludes' optional argument
...*g, + const char *remotepath, const char *localdir, + const struct guestfs_copy_out_opts_argv *optargs) { struct stat statbuf; int r; @@ -170,6 +171,7 @@ guestfs_impl_copy_out (guestfs_h *g, struct copy_out_child_data data; char fdbuf[64]; int fd; + struct guestfs_tar_out_opts_argv tar_optargs = { .bitmask = 0 }; r = guestfs_is_dir (g, remotepath); if (r == -1) @@ -210,7 +212,12 @@ guestfs_impl_copy_out (guestfs_h *g, snprintf (fdbuf, sizeof fdbuf, "/dev/fd/%d", fd); - r = guestfs_tar_ou...
2015 Feb 02
8
[PATCH 0/7 v2] Make copy_in & copy_out APIs, and use copy_in in customize
Hi, attached there is the second version of the patch series adding copy_in and copy_out in the library, mostly moving them from guestfish. It also adds the copy_in usage in virt-customize, as aid in a new image building. Thanks, Pino Toscano (7): cmd: add a way to run (and wait) asynchronously commands cmd: add a child-setup callback cmd: add the possibility to get a fd to the process
2019 Oct 17
2
[PATCH nbdkit] server: Allow file descriptors to be passed to nbdkit_read_password.
...ublic.c index ea10189..4a7eb17 100644 --- a/server/test-public.c +++ b/server/test-public.c @@ -335,6 +335,8 @@ test_nbdkit_read_password (void) { bool pass = true; char template[] = "+/tmp/nbdkit_testpw_XXXXXX"; + char template2[] = "/tmp/nbdkit_testpw2_XXXXXX"; + char fdbuf[16]; char *pw = template; int fd; @@ -391,6 +393,35 @@ test_nbdkit_read_password (void) unlink (&template[1]); } + /* Test reading password from file descriptor. */ + fd = mkstemp (template2); + if (fd < 0) { + perror ("mkstemp"); + pass = false; + } +...
2017 Feb 14
14
[PATCH 00/10] dib/API: improvements and fixes
Hi, this patch series does changes mostly in virt-dib, few bug fixes and a couple of new features (mostly implemented upstream already). In addition, one new API is added, and a new optional argument for an existing API is added (the latter is not needed, but could be useful anyway). Thanks, Pino Toscano (10): dib: fix listing envvars in fake-sudo dib: source dib "die" script in
2015 Sep 29
8
[PATCH 0/7] copy-in/copy-out: Capture errors from tar subprocess (RHBZ#1267032).
Commits 3c27f3d91e1566854747bbe844186783fc84f3a8 and 1b6f0daa9ae7fcc94e389232d0c397816cda973d added an internal API for running commands asynchronously. It is only used by the copy-in and copy-out APIs. Unfortunately this made the command code very complex: it was almost impossible to redirect stderr to a file, and there were a lot of long-range dependencies through the file. It was also buggy:
2019 Oct 17
0
Re: [PATCH nbdkit] server: Allow file descriptors to be passed to nbdkit_read_password.
...return 0; > +} > + > +++ b/server/test-public.c > @@ -335,6 +335,8 @@ test_nbdkit_read_password (void) > { > bool pass = true; > char template[] = "+/tmp/nbdkit_testpw_XXXXXX"; > + char template2[] = "/tmp/nbdkit_testpw2_XXXXXX"; > + char fdbuf[16]; > char *pw = template; > int fd; > > @@ -391,6 +393,35 @@ test_nbdkit_read_password (void) > unlink (&template[1]); > } > > + /* Test reading password from file descriptor. */ > + fd = mkstemp (template2); > + if (fd < 0) { > +...
2015 Sep 29
2
[PATCH 1/2] copy-in: print tar stderr when it fails
...name, const char **basename); +static int drain_fd (guestfs_h *g, int fd, char **ret); int guestfs_impl_copy_in (guestfs_h *g, const char *localpath, const char *remotedir) { CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); - int fd; + int fd, err_fd; int r; char fdbuf[64]; size_t buf_len = strlen (localpath) + 1; char buf[buf_len]; const char *dirname, *basename; + CLEANUP_FREE char *tar_buf = NULL; int remote_is_dir = guestfs_is_dir (g, remotedir); if (remote_is_dir == -1) @@ -67,7 +69,7 @@ guestfs_impl_copy_in (guestfs_h *g, const char *local...
2014 Aug 28
14
[PATCH 00/13] code refactorings for tools
Hi, this series does a couple of code reorganizations/refactoring in code used by tools: the windows path handling code, and the two types of file editing (using editor, and using perl expression). There's still a code duplication between the two variants of file editing, but it is just within a single source, and can be easily solved now (planning as next step). Pino Toscano (13): edit:
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.
...uf, sizeof buf); + n = read (conn->console_sock, buf, BUFSIZ); if (n == 0) return 0; diff --git a/src/copy-in-out.c b/src/copy-in-out.c index 5059d8d..50831be 100644 --- a/src/copy-in-out.c +++ b/src/copy-in-out.c @@ -43,7 +43,7 @@ guestfs_impl_copy_in (guestfs_h *g, int r; char fdbuf[64]; size_t buf_len = strlen (localpath) + 1; - char buf[buf_len]; + CLEANUP_FREE char *buf = safe_malloc (g, buf_len); const char *dirname, *basename; struct stat statbuf; @@ -153,7 +153,7 @@ guestfs_impl_copy_out (guestfs_h *g, if (r == 1) { /* is file */ CLEANU...
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers. These aren't valid for global names in C++. (http://stackoverflow.com/a/228797) These large but completely mechanical patches change the illegal identifiers to legal ones. Rich.