search for: cleanup_json_t_decref

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

2017 Nov 23
1
Re: [PATCH 1/1] Switch from YAJL to Jansson
...lude <jansson.h> > > #include "guestfs.h" > #include "guestfs-internal.h" > #include "guestfs-internal-actions.h" > > #ifdef HAVE_ATTRIBUTE_CLEANUP >-#define CLEANUP_YAJL_TREE_FREE __attribute__((cleanup(cleanup_yajl_tree_free))) >+#define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref))) > > static void >-cleanup_yajl_tree_free (void *ptr) >+cleanup_json_t_decref (void *ptr) > { >- yajl_tree_free (* (yajl_val *) ptr); >+ json_decref (* (json_t **) ptr); > } > Looks like you don't need to do this, ther...
2018 Sep 13
1
[PATCH] lib: direct: Query qemu binary for availability of KVM (RHBZ#1605071).
...guestfs_h *g, void *datav, int check_for_errors) { diff --git a/lib/qemu.c b/lib/qemu.c index 3e7f15946..212cda963 100644 --- a/lib/qemu.c +++ b/lib/qemu.c @@ -46,6 +46,19 @@ #include "guestfs-internal.h" #include "guestfs_protocol.h" +#ifdef HAVE_ATTRIBUTE_CLEANUP +#define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref))) + +static void +cleanup_json_t_decref (void *ptr) +{ + json_decref (* (json_t **) ptr); +} + +#else +#define CLEANUP_JSON_T_DECREF +#endif + struct qemu_data { int generation; /* MEMO_GENERATION read from qemu.stat */ uint64_t pr...
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
2018 Feb 12
0
[PATCH v2 1/1] Switch from YAJL to Jansson
...<yajl/yajl_tree.h> +#include <jansson.h> #include "guestfs.h" #include "guestfs-internal.h" #include "guestfs-internal-actions.h" #ifdef HAVE_ATTRIBUTE_CLEANUP -#define CLEANUP_YAJL_TREE_FREE __attribute__((cleanup(cleanup_yajl_tree_free))) +#define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref))) static void -cleanup_yajl_tree_free (void *ptr) +cleanup_json_t_decref (void *ptr) { - yajl_tree_free (* (yajl_val *) ptr); + json_decref (* (json_t **) ptr); } #else -#define CLEANUP_YAJL_TREE_FREE +#define CLEANUP_JSON_T_DECREF #endif -...
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...<yajl/yajl_tree.h> +#include <jansson.h> #include "guestfs.h" #include "guestfs-internal.h" #include "guestfs-internal-actions.h" #ifdef HAVE_ATTRIBUTE_CLEANUP -#define CLEANUP_YAJL_TREE_FREE __attribute__((cleanup(cleanup_yajl_tree_free))) +#define CLEANUP_JSON_T_DECREF __attribute__((cleanup(cleanup_json_t_decref))) static void -cleanup_yajl_tree_free (void *ptr) +cleanup_json_t_decref (void *ptr) { - yajl_tree_free (* (yajl_val *) ptr); + json_decref (* (json_t **) ptr); } #else -#define CLEANUP_YAJL_TREE_FREE +#define CLEANUP_JSON_T_DECREF #endif -...
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
2018 Sep 21
4
[PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...+ g->qemu_img_supports_U_option = -1; /* not tested, see lib/info.c */ + /* Start with large serial numbers so they are easy to spot * inside the protocol. */ diff --git a/lib/info.c b/lib/info.c index 2eadc1c11..74e4424b8 100644 --- a/lib/info.c +++ b/lib/info.c @@ -57,6 +57,7 @@ cleanup_json_t_decref (void *ptr) #endif static json_t *get_json_output (guestfs_h *g, const char *filename); +static int qemu_img_supports_U_option (guestfs_h *g); static void set_child_rlimits (struct command *); char * @@ -149,6 +150,11 @@ get_json_output (guestfs_h *g, const char *filename) guestfs_int_...
2018 Oct 02
0
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
.../* not tested, see lib/info.c */ > + > /* Start with large serial numbers so they are easy to spot > * inside the protocol. > */ > diff --git a/lib/info.c b/lib/info.c > index 2eadc1c11..74e4424b8 100644 > --- a/lib/info.c > +++ b/lib/info.c > @@ -57,6 +57,7 @@ cleanup_json_t_decref (void *ptr) > #endif > > static json_t *get_json_output (guestfs_h *g, const char *filename); > +static int qemu_img_supports_U_option (guestfs_h *g); > static void set_child_rlimits (struct command *); > > char * > @@ -149,6 +150,11 @@ get_json_output (guestfs_h *g, con...