search for: camllocal3

Displaying 20 results from an estimated 37 matches for "camllocal3".

Did you mean: camllocal1
2017 Jan 27
2
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...caml_callback_exn) is a short piece of asm which preserves errno. However you'll need to save errno around caml_enter_blocking_section since that unblocks and processes signals. IOW: static int pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset) { CAMLparam0 (); CAMLlocal3 (rv, strv, offsetv); + int saved_errno; ... rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv); + saved_errno = errno; if (Is_exception_result (rv)) { nbdkit_error ("%s", caml_format_exception (Extract_exception (rv))); caml_enter_blocking_section ();...
2017 Jan 27
0
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...e from C. > > However you'll need to save errno around caml_enter_blocking_section > since that unblocks and processes signals. > > IOW: > > static int > pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset) > { > CAMLparam0 (); > CAMLlocal3 (rv, strv, offsetv); > + int saved_errno; > ... > rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv); > + saved_errno = errno; > if (Is_exception_result (rv)) { > nbdkit_error ("%s", caml_format_exception (Extract_exception (rv))); >...
2020 Sep 07
0
[libnbd PATCH v2 3/3] ocaml: Typesafe returns for REnum/RFlags
...; false + ) handle_calls then ( + pr "/* Convert uint32_t bitmask to OCaml %s.t list. */\n" flag_prefix; + pr "static value\n"; + pr "Val_%s (unsigned flags)\n" flag_prefix; + pr "{\n"; + pr " CAMLparam0 ();\n"; + pr " CAMLlocal3 (cdr, rv, v);\n"; + pr " int i;\n"; + pr "\n"; + pr " rv = Val_emptylist;\n"; + pr " for (i = 31; i >= 0; i--) {\n"; + pr " if (flags & (1 << i)) {\n"; + pr " switch (1 << i) {\n"; +...
2017 Feb 07
0
[PATCH v2 2/7] Move xml and xpath_helpers OCAML code to mllib
...-v2v_xml_doc_get_root_element (value docv) +mllib_xml_doc_get_root_element (value docv) { CAMLparam1 (docv); CAMLlocal1 (v); @@ -402,7 +403,7 @@ v2v_xml_doc_get_root_element (value docv) } value -v2v_xml_parse_uri (value strv) +mllib_xml_parse_uri (value strv) { CAMLparam1 (strv); CAMLlocal3 (rv, sv, ov); diff --git a/v2v/xml.ml b/mllib/xml.ml similarity index 79% rename from v2v/xml.ml rename to mllib/xml.ml index 7ed21cd30..78e75b8f2 100644 --- a/v2v/xml.ml +++ b/mllib/xml.ml @@ -1,5 +1,6 @@ -(* virt-v2v +(* Bindings for libxml2 * Copyright (C) 2009-2017 Red Hat Inc. + * Copyright...
2018 Feb 15
0
[PATCH] Introduce a wrapper around xmlParseURI.
..." + #pragma GCC diagnostic ignored "-Wmissing-prototypes" /* xmlDocPtr type */ @@ -426,16 +430,11 @@ mllib_xml_doc_get_root_element (value docv) } } -value -mllib_xml_parse_uri (value strv) +static value +Val_uri (xmlURIPtr uri) { - CAMLparam1 (strv); + CAMLparam0 (); CAMLlocal3 (rv, sv, ov); - xmlURIPtr uri; - - uri = xmlParseURI (String_val (strv)); - if (uri == NULL) - caml_invalid_argument ("parse_uri: unable to parse URI"); rv = caml_alloc_tuple (9); @@ -514,7 +513,37 @@ mllib_xml_parse_uri (value strv) else ov = Val_int (0); Store_field (...
2018 Nov 02
0
[PATCH REPOST] Introduce a wrapper around xmlParseURI.
..." + #pragma GCC diagnostic ignored "-Wmissing-prototypes" /* xmlDocPtr type */ @@ -426,16 +430,11 @@ mllib_xml_doc_get_root_element (value docv) } } -value -mllib_xml_parse_uri (value strv) +static value +Val_uri (xmlURIPtr uri) { - CAMLparam1 (strv); + CAMLparam0 (); CAMLlocal3 (rv, sv, ov); - xmlURIPtr uri; - - uri = xmlParseURI (String_val (strv)); - if (uri == NULL) - caml_invalid_argument ("parse_uri: unable to parse URI"); rv = caml_alloc_tuple (9); @@ -514,7 +513,37 @@ mllib_xml_parse_uri (value strv) else ov = Val_int (0); Store_field (...
2017 Dec 12
1
[PATCH] Introduce a wrapper around xmlParseURI.
An alternate solution to: https://www.redhat.com/archives/libguestfs/2017-December/msg00035.html "[PATCH] v2v: -i vmx: Allow ssh URLs to use spaces." is to classify all URLs processed by libguestfs as either ordinary URLs or the special non-standard URLs that we use for things like ‘virt-v2v -i vmx’ and ‘guestfish --add’. For the non-standard URLs, provide a wrapper around
2017 Jul 31
0
[PATCH v11 02/10] daemon: Embed the ocaml-augeas library in the daemon.
...ath = String_val (pathv); + int r; + + r = aug_rm (t, path); + if (r == -1) + raise_error ("Augeas.rm"); + + CAMLreturn (Val_int (r)); +} + +/* val matches : t -> path -> path list */ +CAMLprim value +ocaml_augeas_match (value tv, value pathv) +{ + CAMLparam2 (tv, pathv); + CAMLlocal3 (rv, v, cons); + augeas_t t = Augeas_t_val (tv); + char *path = String_val (pathv); + char **matches; + int r, i; + + r = aug_match (t, path, &matches); + if (r == -1) + raise_error ("Augeas.matches"); + + /* Copy the paths to a list. */ + rv = Val_int (0); + for (i = 0; i...
2018 Nov 02
2
[PATCH REPOST] Introduce a wrapper around xmlParseURI.
Previously posted: https://www.redhat.com/archives/libguestfs/2017-December/msg00046.html Rich.
2020 Jan 22
4
[v2v PATCH 0/3] Use libosinfo for query device drivers
This patch series integrates libosinfo in virt-v2v to get the list of files for Windows from libosinfo, if possible. The actual data is still from virtio-win, just unpacked. Pino Toscano (3): build: require libosinfo v2v: add a minimal libosinfo interface v2v: try to get windows driver files from libosinfo m4/guestfs-v2v.m4 | 3 + v2v/Makefile.am | 9 +-
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.
2019 Aug 14
4
[PATCH libnbd 0/2] Use free callback to dereference NBD.Buffer.
In this patch series we use the newly introduced free callback on the completion function to dererence the OCaml NBD.Buffer. I will make the same kind of change for Python later in a separate series. The completion function is always called at the C level, even if the OCaml program didn't use the optional argument. That's because the free callback doesn't run otherwise. There is a
2020 Jan 28
4
[v2v PATCH v2 0/3] Use libosinfo for query device drivers
This patch series integrates libosinfo in virt-v2v to get the list of files for Windows from libosinfo, if possible. The actual data is still from virtio-win, just unpacked. Changes from v1: - adapt to use the priority in libosinfo 1.7.0+ - filter out non-pre-installable drivers - collect all the drivers matching the requirements, not just the first, sorting them by priority like libosinfo does
2020 Sep 07
4
[libnbd PATCH v2 0/3] Improve type-safety of ocaml/golang getters
Well, the golang changes (patch 1 and 2/3 of v1) were already committed, all that was left was the OCaml changes. I'm a lot happier with how things turned out with an UNKNOWN constructor in the OCaml variants. Eric Blake (3): tests: Enhance coverage of enum/flag range checking ocaml: Support unknown values for Enum/Flags ocaml: Typesafe returns for REnum/RFlags generator/OCaml.ml
2017 Aug 09
0
[PATCH v12 02/11] common: Bundle the ocaml-augeas library for use by the daemon.
...ath = String_val (pathv); + int r; + + r = aug_rm (t, path); + if (r == -1) + raise_error ("Augeas.rm"); + + CAMLreturn (Val_int (r)); +} + +/* val matches : t -> path -> path list */ +CAMLprim value +ocaml_augeas_match (value tv, value pathv) +{ + CAMLparam2 (tv, pathv); + CAMLlocal3 (rv, v, cons); + augeas_t t = Augeas_t_val (tv); + char *path = String_val (pathv); + char **matches; + int r, i; + + r = aug_match (t, path, &matches); + if (r == -1) + raise_error ("Augeas.matches"); + + /* Copy the paths to a list. */ + rv = Val_int (0); + for (i = 0; i...
2017 Jan 27
6
[nbdkit PATCH v3 0/4] bind .zero to Python
This cleans up the existing code base with regards to implicit use of errno from language bindings, then rebases the previous work in python on top of that. I'm still playing with the perl bindings, but got further after reading 'perldoc perlembed'. Eric Blake (4): plugins: Don't use bogus errno from non-C plugins plugins: Add new nbdkit_set_error() utility function python:
2019 Aug 15
13
[PATCH libnbd v2 00/10] Callbacks and OCaml and Python persistent buffers.
This is a combination of these two earlier series: https://www.redhat.com/archives/libguestfs/2019-August/msg00235.html https://www.redhat.com/archives/libguestfs/2019-August/msg00240.html plus changes to allow .callback = NULL / .free != NULL, and to reduce the complexity of freeing callbacks. Although it's rather long there's nothing complex here. We might consider squashing some
2013 Mar 25
86
[PATCH 00/28] libxl: ocaml: improve the bindings
The following series of patches fill in most of the gaps in the OCaml bindings to libxl, to make them useful for clients such as xapi/xenopsd (from XCP). There are a number of bugfixes to the existing bindings as well. I have an experimental version of xenopsd that successfully uses the new bindings. An earlier version of the first half of the series was submitted to the last by Ian Campbell on
2019 Dec 16
4
[PATCH 0/2] Move ocaml-augeas copy to libguestfs repo
ocaml-augeas is used only by virtlibguestfs, 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): Bundle the ocaml-augeas library for use by libguestfs build: switch embedded copy of ocaml-augeas .gitignore | 1 + 3rdparty/ocaml-augeas/COPYING.LIB | 515
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...unction (_, FOptPercent) -> true | _ -> false) cols in pr "static CAMLprim value\n"; pr "copy_%s (const struct guestfs_%s *%s)\n" typ typ typ; pr "{\n"; pr " CAMLparam0 ();\n"; if has_optpercent_col then - pr " CAMLlocal3 (rv, v, v2);\n" + pr " CAMLlocal3 (rv, v, v2);\n" else - pr " CAMLlocal2 (rv, v);\n"; + pr " CAMLlocal2 (rv, v);\n"; pr "\n"; pr " rv = caml_alloc (%d, 0);\n" (List.length cols); iteri ( - fun i col...