Displaying 11 results from an estimated 11 matches for "guestfs_impl_copy_in".
2015 Sep 29
2
[PATCH 1/2] copy-in: print tar stderr when it fails
...-in-out.c
+++ b/src/copy-in-out.c
@@ -34,17 +34,19 @@
#include "guestfs-internal-actions.h"
static int split_path (guestfs_h *g, char *buf, size_t buf_size, const char *path, const char **dirname, 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;
+...
2015 Sep 29
2
Re: [PATCH 2/2] copy-in: error out early if the localpath does not exist (RHBZ#1267032)
...11:38:52AM +0200, Pino Toscano wrote:
> ---
> src/copy-in-out.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/copy-in-out.c b/src/copy-in-out.c
> index 0dd8cd3..2b1e4d4 100644
> --- a/src/copy-in-out.c
> +++ b/src/copy-in-out.c
> @@ -47,6 +47,12 @@ guestfs_impl_copy_in (guestfs_h *g, const char *localpath, const char *remotedir
> char buf[buf_len];
> const char *dirname, *basename;
> CLEANUP_FREE char *tar_buf = NULL;
> + struct stat statbuf;
> +
> + if (stat (localpath, &statbuf) == -1) {
> + error (g, _("source '%...
2015 Sep 30
1
[PATCH v2] copy-in: error out early if the localpath does not exist
---
src/copy-in-out.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/copy-in-out.c b/src/copy-in-out.c
index d5e7fb0..89344d8 100644
--- a/src/copy-in-out.c
+++ b/src/copy-in-out.c
@@ -46,6 +46,12 @@ guestfs_impl_copy_in (guestfs_h *g,
size_t buf_len = strlen (localpath) + 1;
char buf[buf_len];
const char *dirname, *basename;
+ struct stat statbuf;
+
+ if (stat (localpath, &statbuf) == -1) {
+ error (g, _("source '%s' does not exist (or cannot be read)"), localpath);
+ return...
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:
2015 Sep 29
0
[PATCH 2/2] copy-in: error out early if the localpath does not exist (RHBZ#1267032)
---
src/copy-in-out.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/copy-in-out.c b/src/copy-in-out.c
index 0dd8cd3..2b1e4d4 100644
--- a/src/copy-in-out.c
+++ b/src/copy-in-out.c
@@ -47,6 +47,12 @@ guestfs_impl_copy_in (guestfs_h *g, const char *localpath, const char *remotedir
char buf[buf_len];
const char *dirname, *basename;
CLEANUP_FREE char *tar_buf = NULL;
+ struct stat statbuf;
+
+ if (stat (localpath, &statbuf) == -1) {
+ error (g, _("source '%s' does not exist (or cannot be...
2015 Sep 29
0
Re: [PATCH 2/2] copy-in: error out early if the localpath does not exist (RHBZ#1267032)
...gt; ---
> > src/copy-in-out.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/src/copy-in-out.c b/src/copy-in-out.c
> > index 0dd8cd3..2b1e4d4 100644
> > --- a/src/copy-in-out.c
> > +++ b/src/copy-in-out.c
> > @@ -47,6 +47,12 @@ guestfs_impl_copy_in (guestfs_h *g, const char *localpath, const char *remotedir
> > char buf[buf_len];
> > const char *dirname, *basename;
> > CLEANUP_FREE char *tar_buf = NULL;
> > + struct stat statbuf;
> > +
> > + if (stat (localpath, &statbuf) == -1) {
> > +...
2015 May 26
6
[PATCH 0/6] Update the way that API versions are generated for the man page.
The existing mechanism was clunky, slow and used ~ 10 MB of
local disk.
Rich.
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.
...usleep (1000);
- n = read (conn->console_sock, buf, 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) {...
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...to guest images, it won’t
normally work over remote libvirt connections.
All of the information available from virt-inspector is also available
diff --git a/lib/copy-in-out.c b/lib/copy-in-out.c
index a4e39f8b3..6c1a37504 100644
--- a/lib/copy-in-out.c
+++ b/lib/copy-in-out.c
@@ -48,7 +48,7 @@ guestfs_impl_copy_in (guestfs_h *g,
struct stat statbuf;
if (stat (localpath, &statbuf) == -1) {
- error (g, _("source '%s' does not exist (or cannot be read)"), localpath);
+ error (g, _("source ‘%s’ does not exist (or cannot be read)"), localpath);
return -1;
}...
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.