search for: bad_type

Displaying 8 results from an estimated 8 matches for "bad_type".

2018 Feb 12
0
[PATCH v2 1/1] Switch from YAJL to Jansson
...char *cmd) { - char *str, *ret; - yajl_val tree = NULL, node; - size_t i, len; + const char *str; + char *ret; + json_t *tree = NULL, *node; tree = parse_json (json, func); if (tree == NULL) return NULL; - if (! YAJL_IS_OBJECT (tree)) + if (!json_is_object (tree)) + goto bad_type; + + node = json_object_get (tree, key); + if (node == NULL) goto bad_type; - 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 ((flags & G...
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...char *cmd) { - char *str, *ret; - yajl_val tree = NULL, node; - size_t i, len; + const char *str; + char *ret; + json_t *tree = NULL, *node; tree = parse_json (json, func); if (tree == NULL) return NULL; - if (! YAJL_IS_OBJECT (tree)) + if (!json_is_object (tree)) + goto bad_type; + + node = json_object_get (tree, key); + if (node == NULL) goto bad_type; - 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 ((flags & G...
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.
2015 Jul 17
1
[PATCH] daemon: add a space after func/macro to fit code-style
...n = YAJL_GET_ARRAY (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...
2016 Jan 09
0
[PATCH] build: Require qemu >= 1.3.0 and yajl.
...CLEANUP_YAJL_TREE_FREE -# endif -#endif - -static char * -get_disk_format (guestfs_h *g, const char *filename) -{ -#if HAVE_YAJL - size_t i, len; CLEANUP_YAJL_TREE_FREE yajl_val tree = get_json_output (g, filename); @@ -150,17 +89,11 @@ get_disk_format (guestfs_h *g, const char *filename) bad_type: error (g, _("qemu-img info: JSON output did not contain 'format' key")); return NULL; - -#else /* !HAVE_YAJL */ - abort (); -#endif /* !HAVE_YAJL */ } -static int64_t -get_disk_virtual_size (guestfs_h *g, const char *filename) +int64_t +guestfs_impl_disk_virtual_size (g...
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...uot;)); + warning (g, _("‘direct’ backend does not work")); goto error; } } diff --git a/lib/info.c b/lib/info.c index 979173066..f7378adfd 100644 --- a/lib/info.c +++ b/lib/info.c @@ -87,7 +87,7 @@ guestfs_impl_disk_format (guestfs_h *g, const char *filename) } bad_type: - error (g, _("qemu-img info: JSON output did not contain 'format' key")); + error (g, _("qemu-img info: JSON output did not contain ‘format’ key")); return NULL; } @@ -112,7 +112,7 @@ guestfs_impl_disk_virtual_size (guestfs_h *g, const char *filename) if...