search for: yajl_get_object

Displaying 13 results from an estimated 13 matches for "yajl_get_object".

2015 Jul 17
1
[PATCH] daemon: add a space after func/macro to fit code-style
...(node)->values[i]; if (! YAJL_IS_STRING (n)) return TYPE_ERROR; if (add_string (&strs, YAJL_GET_STRING (n)) == -1) @@ -238,10 +238,10 @@ parse_json_get_object_string (const char *json, const char *key, int flags, if (! YAJL_IS_OBJECT (tree)) goto bad_type; - len = YAJL_GET_OBJECT(tree)->len; + len = YAJL_GET_OBJECT (tree)->len; for (i = 0; i < len; ++i) { - if (STREQ (YAJL_GET_OBJECT(tree)->keys[i], key)) { - node = YAJL_GET_OBJECT(tree)->values[i]; + if (STREQ (YAJL_GET_OBJECT (tree)->keys[i], key)) { + node = YAJL_GET_OBJECT (tree)-&g...
2018 Feb 12
0
[PATCH v2 1/1] Switch from YAJL to Jansson
...on_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 many levels of object/array nesting"); - if (YAJL_IS_OBJECT (val)) { - const size_t len = YAJL_GET_OBJECT(val)->len; + if (json_is_object (val)) { + const size_t len = json_object_size (val); size_t i; + const char *key; + json_t *jvalue; rv = caml_alloc (1, 3); lv = caml_alloc_tuple (len); - for (i = 0; i < len; ++i) { + i = 0; + json_object_foreach (val, key, j...
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...on_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 many levels of object/array nesting"); - if (YAJL_IS_OBJECT (val)) { - const size_t len = YAJL_GET_OBJECT(val)->len; + if (json_is_object (val)) { + const size_t len = json_object_size (val); size_t i; + const char *key; + json_t *jvalue; rv = caml_alloc (1, 3); lv = caml_alloc_tuple (len); - for (i = 0; i < len; ++i) { + i = 0; + json_object_foreach (val, key, j...
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
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
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 Sep 12
0
[PATCH v2 4/5] lib: qemu: Add accessor to test if qemu does mandatory locking.
...). QMP is almost impossible to parse sanely so this is + * the minimum we need to detect if C<"locking"> is supported. + */ +static int +qmp_schema_contains (yajl_val tree, const char *key, const char *value) +{ + size_t i; + + if (YAJL_IS_OBJECT (tree)) { + for (i = 0; i < YAJL_GET_OBJECT(tree)->len; ++i) { + const char *k; + yajl_val v; + + k = YAJL_GET_OBJECT(tree)->keys[i]; + v = YAJL_GET_OBJECT(tree)->values[i]; + + if (STREQ (k, key) && + YAJL_IS_STRING (v) && STREQ (YAJL_GET_STRING (v), value)) + return 1; +...
2017 Sep 12
9
[PATCH v2 0/5] launch: direct: Disable qemu locking when opening drives readonly (RHBZ#1417306)
Patches 1-4 are almost the same as they are when previously posted here: https://www.redhat.com/archives/libguestfs/2017-September/msg00039.html Patch 5 actually uses the mandatory locking test to turn off locking in the narrow case where a drive is opened readonly, and then only for the drive being inspected. Passes ordinary tests (‘check-direct’ and ‘check-valgrind-direct’). Rich.
2015 Aug 12
0
[PATCH 2/2] builder: support Simple Streams v1.0 as index metadata
...lue stringv); + +#if HAVE_YAJL +static value +convert_yajl_value (yajl_val val, int level) +{ + CAMLparam0 (); + CAMLlocal4 (rv, lv, v, sv); + + if (level > 20) + caml_invalid_argument ("too many levels of object/array nesting"); + + if (YAJL_IS_OBJECT (val)) { + size_t len = YAJL_GET_OBJECT(val)->len; + size_t i; + rv = caml_alloc (1, 3); + lv = caml_alloc_tuple (len); + for (i = 0; i < len; ++i) { + v = caml_alloc_tuple (2); + sv = caml_copy_string (YAJL_GET_OBJECT(val)->keys[i]); + Store_field (v, 0, sv); + sv = convert_yajl_value (YAJL_GET_O...
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 Sep 11
4
[PATCH 0/4] lib: qemu: Add test for mandatory locking.
The patch I posted last week to disable mandatory locking for readonly drives (https://www.redhat.com/archives/libguestfs/2017-September/msg00013.html) was wrong in a couple of respects. Firstly it didn't work, which I didn't detect because my tests were testing the wrong thing. Oops. Secondly it used a simple version number check to detect qemu binaries implementing mandatory locking.
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
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