search for: fdpath

Displaying 10 results from an estimated 10 matches for "fdpath".

Did you mean: ldpath
2017 Dec 15
0
[PATCH v2] lib/info: Remove /dev/fd hacking and pass a true filename to qemu-img info.
...#include <sys/stat.h> #include <sys/wait.h> #include <assert.h> #include <string.h> @@ -166,41 +165,24 @@ static yajl_val get_json_output (guestfs_h *g, const char *filename) { CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); - int fd, r; - char fdpath[64]; + CLEANUP_FREE char *rel_filename = NULL; + int r; yajl_val tree = NULL; - struct stat statbuf; - - fd = open (filename, O_RDONLY /* NB: !O_CLOEXEC */); - if (fd == -1) { - perrorf (g, "disk info: %s", filename); - return NULL; - } - - if (fstat (fd, &statbuf) ==...
2017 Dec 15
2
[PATCH v2] lib/info: Remove /dev/fd hacking and pass a true filename
v1 posted here: https://www.redhat.com/archives/libguestfs/2017-December/msg00050.html v2 fixes the tests by rewriting relative paths as ./filename (so that filenames like "file:foo" work).
2017 Dec 12
1
Re: failure to virt-sysprep (FC27?)
...#include <sys/stat.h> #include <sys/wait.h> #include <assert.h> #include <string.h> @@ -166,41 +165,18 @@ static yajl_val get_json_output (guestfs_h *g, const char *filename) { CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); - int fd, r; - char fdpath[64]; + int r; yajl_val tree = NULL; - struct stat statbuf; - - fd = open (filename, O_RDONLY /* NB: !O_CLOEXEC */); - if (fd == -1) { - perrorf (g, "disk info: %s", filename); - return NULL; - } - - if (fstat (fd, &statbuf) == -1) { - perrorf (g, "disk info: fst...
2017 Dec 12
4
Re: failure to virt-sysprep (FC27?)
On Thu, Nov 23, 2017 at 02:05:32PM +0000, Richard W.M. Jones wrote: > On Thu, Nov 23, 2017 at 03:00:45PM +0200, Yaniv Kaul wrote: > > On Thu, Nov 23, 2017 at 10:57 AM, Richard W.M. Jones <rjones@redhat.com> > > wrote: > > > > > On Tue, Nov 21, 2017 at 11:43:54PM +0200, Yaniv Kaul wrote: > > > > Since I upgrading to FC27, I *sometimes* fail to
2017 Oct 06
2
[PATCH] lib: Pick up qemu-img path at build time.
..._filename); + guestfs_int_external_command_failed (g, r, QEMU_IMG, orig_filename); return -1; } diff --git a/lib/info.c b/lib/info.c index f7378adfd..4464df994 100644 --- a/lib/info.c +++ b/lib/info.c @@ -191,7 +191,7 @@ get_json_output (guestfs_h *g, const char *filename) snprintf (fdpath, sizeof fdpath, "/dev/fd/%d", fd); guestfs_int_cmd_clear_close_files (cmd); - guestfs_int_cmd_add_arg (cmd, "qemu-img"); + guestfs_int_cmd_add_arg (cmd, QEMU_IMG); guestfs_int_cmd_add_arg (cmd, "info"); guestfs_int_cmd_add_arg (cmd, "--output");...
2015 May 26
0
[PATCH] lib: Limit space and time used by 'qemu-img info' subprocess.
...; +#endif + +#ifdef HAVE_SYS_RESOURCE_H +#include <sys/resource.h> +#endif + #if HAVE_YAJL #include <yajl/yajl_tree.h> #endif @@ -269,7 +277,13 @@ get_json_output (guestfs_h *g, const char *filename) guestfs_int_cmd_add_arg (cmd, "json"); guestfs_int_cmd_add_arg (cmd, fdpath); guestfs_int_cmd_set_stdout_callback (cmd, parse_json, &tree, - CMD_STDOUT_FLAG_WHOLE_BUFFER); + CMD_STDOUT_FLAG_WHOLE_BUFFER); +#ifdef RLIMIT_AS + guestfs_int_cmd_set_child_rlimit (cmd, RLIMIT_AS, 1000000000 /* 1GB...
2015 Oct 14
2
[PATCH 1/2] lib: info: Move common code for setting child rlimits.
...d_parser_disk_has_backing_file (guestfs_h *g, const char *filename); +static void set_child_rlimits (struct command *); char * guestfs_impl_disk_format (guestfs_h *g, const char *filename) @@ -276,12 +277,7 @@ get_json_output (guestfs_h *g, const char *filename) guestfs_int_cmd_add_arg (cmd, fdpath); guestfs_int_cmd_set_stdout_callback (cmd, parse_json, &tree, CMD_STDOUT_FLAG_WHOLE_BUFFER); -#ifdef RLIMIT_AS - guestfs_int_cmd_set_child_rlimit (cmd, RLIMIT_AS, 1000000000 /* 1GB */); -#endif -#ifdef RLIMIT_CPU - guestfs_int_cmd_set_child_rlimit (...
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...se_json (guestfs_h *g, void *treevp, const char *input, size_t len); #define PARSE_JSON_NO_OUTPUT ((void *) -1) -static yajl_val +static json_t * get_json_output (guestfs_h *g, const char *filename) { CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); int fd, r; char fdpath[64]; - yajl_val tree = NULL; + json_t *tree = NULL; struct stat statbuf; fd = open (filename, O_RDONLY /* NB: !O_CLOEXEC */); @@ -217,16 +196,15 @@ get_json_output (guestfs_h *g, const char *filename) return NULL; } - return tree; /* caller must call yajl_tree_free (tr...
2017 Nov 23
4
[PATCH 0/1] RFC: switch from YAJL to Jansson
Hi, recently, there was a discussion in the development list of libvirt on switching to a different JSON library than YAJL [1]. Since we use YAJL, and the points there IMHO apply to libguestfs as well, I decided to give a try in switching to Jansson [2]. The result IMHO is nice, with the additional APIs of Jansson that simplify some of our code. Unlike with YAJL, I did not set a minimum
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.