search for: guestfs___cmd_run_async

Displaying 5 results from an estimated 5 matches for "guestfs___cmd_run_async".

2015 Jan 26
6
[PATCH 1/6] cmd: add a way to run (and wait) asynchronously commands
...___cmd_run (struct command *cmd) return wait_command (cmd); } +/* Fork, run the command, and returns the pid of the command, + * and its stdout and stderr file descriptors. + * + * Returns the exit status. Test it using WIF* macros. + * + * On error: Calls error(g) and returns -1. + */ +int +guestfs___cmd_run_async (struct command *cmd, pid_t *pid, + int *stdout_fd, int *stderr_fd) +{ + finish_command (cmd); + + if (cmd->g->verbose) + debug_command (cmd); + + if (run_command (cmd, stdout_fd != NULL, stderr_fd != NULL) == -1) + return -1; + + if (pid) + *pid = cmd-&gt...
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
2015 Feb 02
1
Re: [PATCH 5/6] New APIs: copy-in and copy-out
...if (dirname) { > + guestfs___cmd_add_arg (cmd, "-C"); > + guestfs___cmd_add_arg (cmd, dirname); > + } > + guestfs___cmd_add_arg (cmd, "-cf"); > + guestfs___cmd_add_arg (cmd, "-"); > + guestfs___cmd_add_arg (cmd, basename); > + > + r = guestfs___cmd_run_async (cmd, NULL, NULL, &fd, NULL); > + if (r == -1) > + return -1; > + > + snprintf (fdbuf, sizeof fdbuf, "/dev/fd/%d", fd); > + > + r = guestfs_tar_in (g, fdbuf, remotedir); > + > + if (close (fd) == -1) { > + perror ("close (tar subprocess)"...
2015 Jan 26
0
[PATCH 5/6] New APIs: copy-in and copy-out
..._cmd_add_arg (cmd, "tar"); + if (dirname) { + guestfs___cmd_add_arg (cmd, "-C"); + guestfs___cmd_add_arg (cmd, dirname); + } + guestfs___cmd_add_arg (cmd, "-cf"); + guestfs___cmd_add_arg (cmd, "-"); + guestfs___cmd_add_arg (cmd, basename); + + r = guestfs___cmd_run_async (cmd, NULL, NULL, &fd, NULL); + if (r == -1) + return -1; + + snprintf (fdbuf, sizeof fdbuf, "/dev/fd/%d", fd); + + r = guestfs_tar_in (g, fdbuf, remotedir); + + if (close (fd) == -1) { + perror ("close (tar subprocess)"); + return -1; + } + + r = guestfs___cm...
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.