search for: caml_alloc

Displaying 20 results from an estimated 101 matches for "caml_alloc".

2018 Aug 20
0
[PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.
..., sv); + CAMLlocal5 (rv, v, tv, sv, consv); if (level > 20) caml_invalid_argument ("too many levels of object/array nesting"); 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); - i = 0; + + rv = caml_alloc (1, JSON_DICT_TAG); + v = Val_int (0); + /* This will create the OCaml list backwards, but JSON + * dictionaries are supposed to be unordered so that shouldn't + * matter, right? Well except that for som...
2018 Aug 22
3
[PATCH v2 0/2] mltools: JSON: unify JSON & JSON parser.
v2: - Added back the null value. - Reran the tests. Rich.
2019 Apr 08
0
[PATCH v4 2/7] common: Bundle the libvirt-ocaml library for use by virt-v2v
...=~ /^(\w+) : uuid$/) { + "\ + CAMLlocal1 (rv); + " . gen_unpack_args ($1) . " + unsigned char uuid[VIR_UUID_BUFLEN]; + int r; + + NONBLOCKING (r = $c_name ($1, uuid)); + CHECK_ERROR (r == -1, \"$c_name\"); + + /* UUIDs are byte arrays with a fixed length. */ + rv = caml_alloc_string (VIR_UUID_BUFLEN); + memcpy (String_val (rv), uuid, VIR_UUID_BUFLEN); + CAMLreturn (rv); +" + } elsif ($sig =~ /^(\w+) : uuid string$/) { + "\ + CAMLlocal1 (rv); + " . gen_unpack_args ($1) . " + char uuid[VIR_UUID_STRING_BUFLEN]; + int r; + + NONBLOCKING (r = $c...
2018 Aug 20
6
[PATCH 0/4] mltools: JSON unification
An evolution of: https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html
2019 Dec 16
3
[v2v PATCH 0/2] Move libvirt-ocaml copy to v2v repo
libvirt-ocaml is used only by virt-v2v, so move it to this repository, instead of having it around in the common submodule. The removal from common will happen later. Pino Toscano (2): common: Bundle the libvirt-ocaml library for use by virt-v2v build: switch embedded copy of libvirt-ocaml .gitignore | 2 + 3rdparty/libvirt-ocaml/Makefile.am |
2015 Aug 12
0
[PATCH 2/2] builder: support Simple Streams v1.0 as index metadata
...ajl_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_OBJECT(val)->values[i], level + 1); + Store...
2018 Aug 22
3
Re: [PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.
...one; > + } > + else { > + /* Previously we had a special JSON_parser_null value we could > + * use here, making the returned type (sort of) an option. > + * This is a best effort which is better than crashing / > + * throwing an error. > + */ > + rv = caml_alloc (1, JSON_STRING_TAG); > + v = caml_copy_string (""); > + Store_field (rv, 0, v); > + } NACK, this is not correct. null is a proper type of value in JSON, and thus JSON.json_t must represent it as well. This is even used in other parts, for example the check of backing f...
2020 Sep 07
0
[libnbd PATCH v2 3/3] ocaml: Typesafe returns for REnum/RFlags
...CAMLlocal1 (rv);\n"; + pr "\n"; + pr " switch (i) {\n"; + List.iteri ( + fun i (enum, _) -> + pr " case LIBNBD_%s_%s: rv = Val_int (%d); break;\n" enum_prefix enum i + ) enums; + pr " default:\n"; + pr " rv = caml_alloc (1, 0); /* UNKNOWN of int */\n"; + pr " Store_field (rv, 0, Val_int (i));\n"; + pr " }\n"; + pr "\n"; + pr " CAMLreturn (rv);\n"; + pr "}\n"; + pr "\n" + ) let print_ocaml_flag_val { flag_prefix; flags } =...
2018 Nov 27
8
[PATCH v2 0/7] RFC: switch v2v to ocaml-libvirt
Hi, this is a mostly done attempt to switch to ocaml-libvirt, embedding the latest version of it from git. This way, it is possible to improve the way v2v connects to libvirt for both input, and output modules, and interacts with libvirt (e.g. no more virsh calls needed in virt-v2v). As side effect, virt-v2v now requires libvirt, as keeping it optional would create too much burden. I could not
2019 Jan 30
8
[PATCH v3 0/7] RFC: switch v2v to ocaml-libvirt
Hi, this is a mostly done attempt to switch to ocaml-libvirt, embedding the latest version of it from git. This way, it is possible to improve the way v2v connects to libvirt for both input, and output modules, and interacts with libvirt (e.g. no more virsh calls needed in virt-v2v). As side effect, virt-v2v now requires libvirt, as keeping it optional would create too much burden. I could not
2019 May 20
8
[PATCH v5 0/7] v2v: switch to ocaml-libvirt
Hi, this series switches virt-2v to ocaml-libvirt, embedding the latest version of it from git. This way, it is possible to improve the way v2v connects to libvirt for both input, and output modules, and interacts with libvirt (e.g. no more virsh calls needed in virt-v2v). As side effect, virt-v2v now requires libvirt, as keeping it optional would create too much burden. I could not test all
2018 Aug 30
8
[PATCH 0/7] RFC: switch v2v to ocaml-libvirt
Hi, this is a mostly done attempt to switch to ocaml-libvirt, embedding the latest version of it from git. This way, it is possible to improve the way v2v connects to libvirt for both input, and output modules, and interacts with libvirt (e.g. no more virsh calls needed in virt-v2v). As side effect, virt-v2v now requires libvirt, as keeping it optional would create too much burden. I could not
2018 Feb 12
0
[PATCH v2 1/1] Switch from YAJL to Jansson
...d_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, jvalue) { v = caml_alloc_tuple (2); - sv = caml_copy_string (YAJL_GET_OBJECT(val)->keys[i]); + sv = caml_copy_string (key); Store_field (v, 0, sv)...
2019 Apr 08
12
[PATCH 43 0/7] v2v: switch to ocaml-libvirt
Hi, this series switches virt-2v to ocaml-libvirt, embedding the latest version of it from git. This way, it is possible to improve the way v2v connects to libvirt for both input, and output modules, and interacts with libvirt (e.g. no more virsh calls needed in virt-v2v). As side effect, virt-v2v now requires libvirt, as keeping it optional would create too much burden. I could not test all
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...d_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, jvalue) { v = caml_alloc_tuple (2); - sv = caml_copy_string (YAJL_GET_OBJECT(val)->keys[i]); + sv = caml_copy_string (key); Store_field (v, 0, sv)...
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
2016 Feb 04
0
[PATCH] aarch64: Use a common table of AAVMF paths.
...+ /* Initialize the list backwards. */ + size_t i = guestfs_int_count_strings ((char **) guestfs_int_aavmf_firmware); + + rv = Val_int (0); + + while (i > 0) { + v1 = caml_copy_string (guestfs_int_aavmf_firmware[i-2]); + v2 = caml_copy_string (guestfs_int_aavmf_firmware[i-1]); + v = caml_alloc (2, 0); + Store_field (v, 0, v1); + Store_field (v, 1, v2); + cons = caml_alloc (2, 0); + Store_field (cons, 1, rv); + rv = cons; + Store_field (cons, 0, v); + + i -= 2; + } + + CAMLreturn (rv); +} diff --git a/v2v/utils.ml b/v2v/utils.ml index 82f4377..636f3c2 100644 --- a/v...
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
2016 Aug 17
1
[PATCH] v2v: Use OVMF secure boot file (RHBZ#1367615).
This is only lightly tested. In particularly I only tested that the non-secure-boot path still works. I didn't test it on RHEL 7.3 yet because I haven't got enough free disk space for these giant source *.ova files :-( Will try to give that a go later. Rich.