Displaying 20 results from an estimated 54 matches for "bool_val".
2013 Sep 24
0
Bug#710650: Bug#718767: transition: ocaml 4.00.1
...tubs.c:490:18: warning: assignment makes pointer from integer without a cast [enabled by default]
> callbacks.data = c_domid;
> ^
> xenguest_stubs.c:497:21: error: too few arguments to function 'xc_domain_save'
> c_flags, &callbacks, Bool_val(hvm));
> ^
> In file included from xenguest_stubs.c:23:0:
> /usr/include/xenguest.h:87:5: note: declared here
> int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iters,
> ^
> xenguest_stubs.c: In function 'stub_xc_domain_res...
2010 Jun 28
8
[PATCH] add xl ocaml bindings
...alue b = Field(a, 0);
+ array[i * 2] = String_val(Field(b, 0));
+ array[i * 2 + 1] = String_val(Field(b, 1));
+ }
+ *c_val = array;
+ CAMLreturn(0);
+}
+
+static int domain_create_info_val (libxl_domain_create_info *c_val, value v)
+{
+ CAMLparam1(v);
+ CAMLlocal1(a);
+ int i;
+
+ c_val->hvm = Bool_val(Field(v, 0));
+ c_val->hap = Bool_val(Field(v, 1));
+ c_val->oos = Bool_val(Field(v, 2));
+ c_val->ssidref = Int32_val(Field(v, 3));
+ c_val->name = String_val(Field(v, 4));
+ a = Field(v, 5);
+ for (i = 0; i < 16; i++)
+ c_val->uuid[i] = Int_val(Field(a, i));
+ string_string_tup...
2013 Sep 24
2
Bug#710650: Bug#718767: transition: ocaml 4.00.1
On 09/24/2013 10:04 PM, St?phane Glondu wrote:
> Le 24/09/2013 15:48, St?phane Glondu a ?crit :
>> If I remove all binary packages of xen-api from testing, the following
>> new packages are broken: xcp-guest-templates, nova-xcp-plugins,
>> nova-compute-xen.
>>
>> xcp-guest-templates is built by guest-templates which seems to be a leaf
>> package and could be
2016 Apr 14
1
Re: [PATCH v2] customize/perl_edit-c.c: Don't use internal APIs.
...e verbosev, value gv, value gpv,
{
CAMLparam5 (verbosev, gv, gpv, filev, exprv);
int r;
- guestfs_h *g = (guestfs_h *) Int64_val (gpv);
+ guestfs_h *g = (guestfs_h *) (intptr_t) Int64_val (gpv);
r = edit_file_perl (g, String_val (filev), String_val (exprv), NULL,
Bool_val (verbosev));
Thanks,
--
Pino Toscano
2016 Apr 12
3
[PATCH v2] customize/perl_edit-c.c: Don't use internal APIs.
In v1 of this patch, there was the (small) possibility that 'g' might
have been garbage collected while we were in the C function.
Avoid this by passing 'g' to the function as well as the C pointer, so
that 'g' is pinned as a garbage collector root [by CAMLparam5] so it
cannot be collected while we're in the function.
Rich.
2020 Feb 10
1
[nbdkit PATCH] ocaml: Support .preconnect callback
...del_fn;
static value can_fast_zero_fn;
+static value preconnect_fn;
+
/*----------------------------------------------------------------------*/
/* Wrapper functions that translate calls from C (ie. nbdkit) to OCaml. */
@@ -726,6 +728,25 @@ can_fast_zero_wrapper (void *h)
CAMLreturnT (int, Bool_val (rv));
}
+static int
+preconnect_wrapper (int readonly)
+{
+ CAMLparam0 ();
+ CAMLlocal1 (rv);
+
+ caml_leave_blocking_section ();
+
+ rv = caml_callback_exn (preconnect_fn, Val_bool (readonly));
+ if (Is_exception_result (rv)) {
+ nbdkit_error ("%s", caml_format_exception (Extr...
2016 Apr 11
0
[PATCH] customize/perl_edit-c.c: Don't use internal APIs.
...tomize_edit_file_perl (value verbosev, value gv, value filev,
{
CAMLparam4 (verbosev, gv, filev, exprv);
int r;
- guestfs_h *g = Guestfs_val (gv);
+ guestfs_h *g = (guestfs_h *) Int64_val (gv);
r = edit_file_perl (g, String_val (filev), String_val (exprv), NULL,
Bool_val (verbosev));
if (r == -1)
- guestfs_int_ocaml_raise_error (g, "edit_file_perl");
+ caml_failwith (guestfs_last_error (g) ? : "edit_file_perl: unknown error");
CAMLreturn (Val_unit);
}
diff --git a/customize/perl_edit.ml b/customize/perl_edit.ml
index f1f06cc..992a...
2016 Apr 12
0
[PATCH v2] customize/perl_edit-c.c: Don't use internal APIs.
...alue exprv)
{
- CAMLparam4 (verbosev, gv, filev, exprv);
+ CAMLparam5 (verbosev, gv, gpv, filev, exprv);
int r;
- guestfs_h *g = Guestfs_val (gv);
+ guestfs_h *g = (guestfs_h *) Int64_val (gpv);
r = edit_file_perl (g, String_val (filev), String_val (exprv), NULL,
Bool_val (verbosev));
if (r == -1)
- guestfs_int_ocaml_raise_error (g, "edit_file_perl");
+ caml_failwith (guestfs_last_error (g) ? : "edit_file_perl: unknown error");
CAMLreturn (Val_unit);
}
diff --git a/customize/perl_edit.ml b/customize/perl_edit.ml
index f1f06cc..5cd2...
2019 Mar 29
0
[PATCH v2 1/3] common/mlpcre: add offset flag for PCRE.matches
...ion 0).
+
This can raise {!Error} if PCRE returns an error. *)
val sub : int -> string
diff --git a/common/mlpcre/pcre-c.c b/common/mlpcre/pcre-c.c
index 0762a8341..be054a004 100644
--- a/common/mlpcre/pcre-c.c
+++ b/common/mlpcre/pcre-c.c
@@ -121,6 +121,15 @@ is_Some_true (value v)
Bool_val (Field (v, 0)) /* Some true */;
}
+static int
+Optint_val (value intv, int defval)
+{
+ if (intv == Val_int (0)) /* None */
+ return defval;
+ else /* Some int */
+ return Int_val (Field (intv, 0));
+}
+
value
guestfs_int_pcre_compile (value anchoredv, val...
2019 Feb 25
0
[PATCH 1/3] common/mlpcre: add offset flag for PCRE.matches
...ion 0).
+
This can raise {!Error} if PCRE returns an error. *)
val sub : int -> string
diff --git a/common/mlpcre/pcre-c.c b/common/mlpcre/pcre-c.c
index 0762a8341..be054a004 100644
--- a/common/mlpcre/pcre-c.c
+++ b/common/mlpcre/pcre-c.c
@@ -121,6 +121,15 @@ is_Some_true (value v)
Bool_val (Field (v, 0)) /* Some true */;
}
+static int
+Optint_val (value intv, int defval)
+{
+ if (intv == Val_int (0)) /* None */
+ return defval;
+ else /* Some int */
+ return Int_val (Field (intv, 0));
+}
+
value
guestfs_int_pcre_compile (value anchoredv, val...
2016 Feb 05
7
[PATCH 0/7] lib: Stop exporting the safe_malloc, etc. functions.
The safe_malloc (etc) functions call g->abort_fn on failure. That's
not appropriate for language bindings, and we never intended that
these internal functions be used from language bindings, that was just
a historical accident.
This patch series removes any external use of the safe_* functions.
Rich.
2014 Apr 22
3
[PATCH 1/2] builder: add an optional suffix string for INI parsing errors
---
builder/index-parse.y | 6 ++++--
builder/index-parser-c.c | 3 ++-
builder/index-struct.h | 1 +
builder/ini_reader.ml | 6 +++---
builder/ini_reader.mli | 2 +-
5 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/builder/index-parse.y b/builder/index-parse.y
index 310870d..7ddef53 100644
--- a/builder/index-parse.y
+++ b/builder/index-parse.y
@@ -150,12 +150,14 @@
[PATCH 18/27] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
2017 Jul 14
0
[PATCH 18/27] daemon: Reimplement ‘btrfs_subvolume_list’ and ‘btrfs_subvolume_get_default’ in OCaml.
...(int, 0);\n"
| RInt _ ->
pr " CAMLreturnT (int, Int_val (retv));\n"
- | RInt64 _ -> assert false
+ | RInt64 _ ->
+ pr " CAMLreturnT (int, Int64_val (retv));\n"
| RBool _ ->
pr " CAMLreturnT (int, Bool_val (retv));\n"
| RConstString _ -> assert false
--
2.13.2
2015 Oct 06
6
[PATCH 0/4] ocaml: Allow Guestfs.t handle to be garbage collected.
Allow Guestfs.t handle to be garbage collected, and add a
regression test.
2020 Jan 27
3
[PATCH v2 1/2] mltools, options: support --allow-discards when decrypting LUKS devices
---
mltools/tools_utils-c.c | 8 ++++----
mltools/tools_utils.ml | 6 +++---
mltools/tools_utils.mli | 8 ++++++--
options/decrypt.c | 5 +++--
options/inspect.c | 2 +-
options/options.h | 2 +-
6 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/mltools/tools_utils-c.c b/mltools/tools_utils-c.c
index 6c43b8d..1dcebc4 100644
--- a/mltools/tools_utils-c.c
+++
2012 Jan 09
1
[PATCH 1/2] generator: Rename java_structs to camel_structs to better reflect their purpose
This map was originally included just for the java bindings, but is generally
useful to any binding which uses camel case by requirement or convention.
---
generator/generator_haskell.ml | 4 ++--
generator/generator_java.ml | 10 +++++-----
generator/generator_main.ml | 2 +-
generator/generator_structs.ml | 12 +++++-------
generator/generator_structs.mli | 8 ++++----
5
2019 Mar 29
5
[PATCH v2 0/3] v2v: add -o json output mode
This series adds a new output mode for virt-v2v, called -o json.
It produces local files, just like -o local, although the metadata
produced is a JSON file with data that v2v collected in the conversion
process. This can be useful for converting to unsupported destinations,
still based on QEMU/KVM.
In addition to a simple different metadata, it offers a way to relocate
the disks, with
2017 Jul 14
0
[PATCH 05/27] daemon: Reimplement several devsparts APIs in OCaml.
...th
| RErr -> assert false
- | RInt _ -> assert false
+ | RInt _ ->
+ pr " CAMLreturnT (int, Int_val (retv));\n"
| RInt64 _ -> assert false
- | RBool _ -> assert false
+ | RBool _ ->
+ pr " CAMLreturnT (int, Bool_val (retv));\n"
| RConstString _ -> assert false
| RConstOptString _ -> assert false
- | RString (RPlainString, _) ->
+ | RString ((RPlainString|RDevice), _) ->
pr " char *ret = strdup (String_val (retv));\n";
pr " if (...
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
2011 Nov 29
6
[OCAML 0/7] V4 or so of the xen ocaml packaging patches
Here is the latest version of the patches to package the ocaml libraries. Changes
since last time:
* rename the packages from libxen-4.1-ocaml* to libxen-ocaml* - we wont be
looking to install multiple concurrent versions of the same package, so
the version doesn't need to be in the package name
* Removed superfluous GENCONTROL definitions - dh_ocaml does what we need
* Removed