search for: yajl_tree_parse

Displaying 20 results from an estimated 44 matches for "yajl_tree_parse".

2017 Jul 25
2
build from github source
...home/git/libguestfs/docs' > Making all in examples > make[2]: Entering directory '/home/pahome/git/libguestfs/examples' > CCLD create-disk > ../lib/.libs/libguestfs.so: undefined reference to `yajl_tree_free' > ../lib/.libs/libguestfs.so: undefined reference to `yajl_tree_parse' > collect2: error: ld returned 1 exit status > Makefile:1926: recipe for target 'create-disk' failed > make[2]: *** [create-disk] Error 1 > make[2]: Leaving directory '/home/pahome/git/libguestfs/examples' > Makefile:1975: recipe for target 'all-recursive'...
2018 Aug 17
0
[PATCH v3 1/4] mltools: Rename Yajl module as JSON_parser and move to common/mltools.
...reams_parser.ml @@ -20,7 +20,7 @@ open Std_utils open Tools_utils open Common_gettext.Gettext -open Yajl +open JSON_parser open Utils open Printf @@ -44,7 +44,7 @@ let get_index ~downloader ~sigchecker { Sources.uri; proxy } = | Some f -> f ) else tmpfile in - yajl_tree_parse (read_whole_file file) in + json_parser_tree_parse (read_whole_file file) in let downloads = let uri_index = @@ -106,7 +106,7 @@ let get_index ~downloader ~sigchecker { Sources.uri; proxy } = * the ones related to checksums, explicitly filter * t...
2015 Sep 07
5
[PATCH 0/4 v3] builder: support for Simple Streams metadata
Hi, this series adds a basic support for Simple Streams v1.0 metadata files. This makes it possible to create a repository .conf files with [cirros] uri=http://download.cirros-cloud.net format=simplestreams to read the latest version of each CirrOS image. Thanks, Pino Toscano (4): builder: add non-int revisions builder: add simple libyajl binding build: expose HAVE_YAJL to automake
2018 Aug 17
8
[PATCH v3 4/4] v2v: Add --print-estimate option to print copy size
I rethought this again, as I think that it's a dangerous assumption to bake qemu-img measure output into our API. This patch series runs qemu-img measure behind the scenes, but then parses the output and sums it to a single number which we print. Doing that required a bit of reworking, moving the Jansson [JSON parser] bindings from virt-builder into the common directory and a couple of other
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...;foo> test is sufficient to - * ensure that YAJL_GET_<foo> later doesn't return NULL. - */ -#if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */ -#pragma GCC diagnostic ignored "-Wnull-dereference" -#endif - #define Val_none (Val_int (0)) value virt_builder_yajl_tree_parse (value stringv); static value -convert_yajl_value (yajl_val val, int level) +convert_json_t (json_t *val, int level) { CAMLparam0 (); CAMLlocal4 (rv, lv, v, sv); @@ -48,46 +41,51 @@ convert_yajl_value (yajl_val val, int level) if (level > 20) caml_invalid_argument ("too ma...
2018 Aug 20
6
[PATCH 0/4] mltools: JSON unification
An evolution of: https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html
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 Aug 12
0
[PATCH 2/2] builder: support Simple Streams v1.0 as index metadata
...ignatures sigchecker then ( + let tmpunsigned = + Sigchecker.verify_and_remove_signature sigchecker tmpfile in + match tmpunsigned with + | None -> assert false (* only when not verifying signatures *) + | Some f -> f + ) else + tmpfile in + yajl_tree_parse (read_whole_file file) in + + let downloads = + let uri_index = + if Sigchecker.verifying_signatures sigchecker then + uri ^ "streams/v1/index.sjson" + else + uri ^ "streams/v1/index.json" in + let tree = download_and_parse uri_index in + + let...
2017 Jan 03
0
[PATCH 1/5] builder: extract Yajl helper functions to yajl.ml
...builder/yajl.ml +++ b/builder/yajl.ml @@ -16,6 +16,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) +open Common_gettext.Gettext +open Common_utils + type yajl_val = | Yajl_null | Yajl_string of string @@ -26,3 +29,55 @@ type yajl_val = | Yajl_bool of bool external yajl_tree_parse : string -> yajl_val = "virt_builder_yajl_tree_parse" + +let object_find_optional key = function + | Yajl_object o -> + (match List.filter (fun (k, _) -> k = key) (Array.to_list o) with + | [(k, v)] -> Some v + | [] -> None + | _ -> error (f_"more than...
2018 Feb 12
0
[PATCH v2 1/1] Switch from YAJL to Jansson
...;foo> test is sufficient to - * ensure that YAJL_GET_<foo> later doesn't return NULL. - */ -#if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */ -#pragma GCC diagnostic ignored "-Wnull-dereference" -#endif - #define Val_none (Val_int (0)) value virt_builder_yajl_tree_parse (value stringv); static value -convert_yajl_value (yajl_val val, int level) +convert_json_t (json_t *val, int level) { CAMLparam0 (); CAMLlocal4 (rv, lv, v, sv); @@ -48,46 +41,51 @@ convert_yajl_value (yajl_val val, int level) if (level > 20) caml_invalid_argument ("too ma...
2018 Feb 12
2
[PATCH v2 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 Aug 12
4
[PATCH 0/2 v2] RFC: builder: support for Simple Streams metadata
Hi, this series adds a basic support for Simple Streams v1.0 metadata files. This makes it possible to create a repository .conf files with [cirros] uri=http://download.cirros-cloud.net format=simplestreams to read the latest version of each CirrOS image. TODO items: - check the pasted metadata: listing and creating images works, so most of the current metadata is correct - possibly wait
2017 Jul 25
0
Re: build from github source
On Tue, 2017-07-25 at 17:42 +0800, lampahome wrote: > why is undefined reference to 'yajl_tree_parse', I already install it from https://github.com/lloyd/yajl First thing I see is that it hasn't been installed to a place mentioned in your LD_LIBRARY_PATH, or not discovered at configure time. Since you are working on a linux machine, I guess your distro is providing the development package...
2017 Jul 25
2
Re: build from github source
...ll libyajl2-dbg and rebuild again: > ./configure > make still the same errors happened anyone has the same issue? 2017-07-25 18:27 GMT+08:00 Cedric Bosdonnat <cbosdonnat@suse.com>: > On Tue, 2017-07-25 at 17:42 +0800, lampahome wrote: > > why is undefined reference to 'yajl_tree_parse', I already install it > from https://github.com/lloyd/yajl > > First thing I see is that it hasn't been installed to a place mentioned in > your > LD_LIBRARY_PATH, or not discovered at configure time. Since you are > working on a > linux machine, I guess your distro is...
2017 Oct 27
0
[PATCH v11 4/8] builder: add Utils.get_image_infos function
...n | Rev_int n -> string_of_int n | Rev_string s -> s + +let get_image_infos filepath = + let qemuimg_cmd = "qemu-img info --output json " ^ (Std_utils.quote filepath) in + let lines = external_command qemuimg_cmd in + let line = String.concat "\n" lines in + Yajl.yajl_tree_parse line diff --git a/builder/utils.mli b/builder/utils.mli index 45385f713..4acde9f36 100644 --- a/builder/utils.mli +++ b/builder/utils.mli @@ -28,3 +28,7 @@ and revision = val string_of_revision : revision -> string (** Convert a {!revision} into a string. *) + +val get_image_infos : string -...
2016 Jan 09
0
[PATCH] build: Require qemu >= 1.3.0 and yajl.
...ude <caml/memory.h> #include <caml/mlvalues.h> -#if HAVE_YAJL #include <yajl/yajl_tree.h> -#endif #include <stdio.h> #include <string.h> #define Val_none (Val_int (0)) -value virt_builder_yajl_is_available (value unit); - -#if HAVE_YAJL value virt_builder_yajl_tree_parse (value stringv); static value @@ -95,13 +90,6 @@ convert_yajl_value (yajl_val val, int level) } value -virt_builder_yajl_is_available (value unit) -{ - /* NB: noalloc */ - return Val_true; -} - -value virt_builder_yajl_tree_parse (value stringv) { CAMLparam1 (stringv); @@ -124,21 +112...
2017 Sep 12
0
[PATCH v2 3/5] lib: qemu: Run QMP ‘query-commands’, ‘query-qmp-schema’ against the qemu binary.
...estfs_h *g, const char *qemu_help, } /** + * Parse the json output from QMP. But don't fail if parsing + * is not possible. + */ +static void +parse_json (guestfs_h *g, const char *json, yajl_val *treep) +{ + char parse_error[256] = ""; + + if (!json) + return; + + *treep = yajl_tree_parse (json, parse_error, sizeof parse_error); + if (*treep == NULL) { + if (strlen (parse_error) > 0) + debug (g, "QMP parse error: %s (ignored)", parse_error); + else + debug (g, "QMP unknown parse error (ignored)"); + } +} + +/** * Generic functions for readi...
2012 Dec 07
2
[PATCH] Add support for Windows dynamic disks (libldm / ldmtool).
This is just an initial version of the patch, not to be applied. It implements just the diskgroup functions, ie. corresponding to these ldmtool commands: * ldmtool scan * ldmtool show diskgroup <guid> I have chosen yajl as the JSON parsing library (don't worry, this is optional). You will also, of course, need ldmtool which is not packaged in anything except Fedora. Rich.
2017 Jan 03
13
[PATCH 0/5] Introducing virt-builder-repository
Hi all, I wanted to provide an easy way to create or update a virt-builder repository out of a folder of template disk image files. This is what virt-builder-repository aims at. Some of the data are computed from the image file, others are asked the user or extracted from an existing index file. So far, virt-builder-repository doesn't run libguestfs on each image to extract the architecture,
2015 Jul 28
19
[PATCH 00/10] RFC: builder: first support for Simple Streams metadata
Hi, this series adds a basic support for Simple Streams v1.0 metadata files. This makes it possible to create a repository .conf files with [cirros] uri=http://download.cirros-cloud.net format=simplestreams to read the latest version of each CirrOS image. TODO items: - a bit more testing: listing and creating images works, so the current metadata is correct - handle revisions, so newer