search for: int_val

Displaying 20 results from an estimated 117 matches for "int_val".

2010 Jun 28
8
[PATCH] add xl ocaml bindings
...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_tuple_array_val(&(c_val->xsdata), Field(v, 6)); + string_string_tuple_array_val(&(c_val->platformdata), Field(v, 7)); + + c_val->poolid = Int32_val(Field(v, 8)); + c_val->poolname = String_val(Field(v, 9)); + + CAMLreturn(0); +} + +static int domain...
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
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 Sep 22
0
[PATCH v3 01/22] common/mlpcre: Raise Invalid_argument if PCRE.sub n parameter is negative.
...+ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/common/mlpcre/pcre-c.c b/common/mlpcre/pcre-c.c index 6fae0e6f4..da9b50d34 100644 --- a/common/mlpcre/pcre-c.c +++ b/common/mlpcre/pcre-c.c @@ -201,6 +201,7 @@ value guestfs_int_pcre_sub (value nv) { CAMLparam1 (nv); + int n = Int_val (nv); CAMLlocal1 (strv); int len; CLEANUP_FREE char *str = NULL; @@ -209,8 +210,10 @@ guestfs_int_pcre_sub (value nv) if (m == NULL) raise_pcre_error ("PCRE.sub called without calling PCRE.matches", 0); - len = pcre_get_substring (m->subject, m->vec, m->r, Int...
2019 May 17
1
Re: [nbdkit PATCH v2 08/24] ocaml: Implement .cache script callback
...value *) h); > + if (Is_exception_result (rv)) { > + nbdkit_error ("%s", caml_format_exception (Extract_exception (rv))); > + caml_enter_blocking_section (); > + CAMLreturnT (int, -1); > + } > + > + caml_enter_blocking_section (); > + CAMLreturnT (int, Int_val (rv)); The not very obvious implicit assumption here is that the order of the Cache* flags in the OCaml code is the same as the numbering of the NBDKIT_CACHE_* flags in the C code, which it is, so we should be good. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/...
2017 Feb 22
4
[PATCH 0/3] v2v: vCenter: Remove proxy environment variables
Fix for: https://bugzilla.redhat.com/show_bug.cgi?id=1354507 Main explanation is in patch #3. Rich.
2019 Aug 16
1
[nbdkit PATCH] ocaml: Map more errno values
...++ plugins/ocaml/NBDKit.ml | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/plugins/ocaml/ocaml.c b/plugins/ocaml/ocaml.c index 064cdedb..5161775f 100644 --- a/plugins/ocaml/ocaml.c +++ b/plugins/ocaml/ocaml.c @@ -849,12 +849,19 @@ ocaml_nbdkit_set_error (value nv) int err; switch (Int_val (nv)) { + /* On-the-wire values */ case 1: err = EPERM; break; case 2: err = EIO; break; case 3: err = ENOMEM; break; case 4: err = EINVAL; break; case 5: err = ENOSPC; break; case 6: err = ESHUTDOWN; break; + case 7: err = EOVERFLOW; break; + /* Necessary for .zero support...
2016 Jun 02
3
[PATCH 0/3] builder: Warn if --output is a host partition.
Rather complex patch to solve a small user error. Warn if the user is doing something like: virt-builder -o /dev/sdX1 Rich.
2003 Dec 19
2
[LLVMdev] Union Type
...ause alignment rules might cause one of the members to start at a non-zero offset from the start of the memory object. In my particular case in Stacker, I have tried to do something like: %foo = global [10 x int]; void %func() { %int_ptr = getelementptr [10 x int]* %foo, long 0, long 0; %int_val = load int* %int_ptr; %char_ptr = cast int %int_val to char*; %oops = load char* %char_ptr; } The above will probably work on a 32-bit platform where pointers are the same size as int. However, on a 64-bit platform, a pointer is the same size as a long and the value retrieved from the arra...
2019 Aug 15
2
[nbdkit PATCH] ocaml: Add support for dynamic .thread_model
...= caml_callback_exn (config_complete_fn, Val_unit); + if (Is_exception_result (rv)) { + nbdkit_error ("%s", caml_format_exception (Extract_exception (rv))); + caml_enter_blocking_section (); + CAMLreturnT (int, -1); + } + + caml_enter_blocking_section (); + CAMLreturnT (int, Int_val (rv)); +} + /*----------------------------------------------------------------------*/ /* set_* functions called from OCaml code at load time to initialize * fields in the plugin struct. */ -value -ocaml_nbdkit_set_thread_model (value modelv) -{ - plugin._thread_model = Int_val (modelv); -...
2015 Dec 02
4
[PATCH 0/3] supermin: add --include-packagelist
Hi, to ease debugging issues with appliances (e.g. when used in libguestfs), using --include-packagelist will add a file containing the list of all the packages used. Thanks, Pino Toscano (3): ext2: add ext2fs_chmod and ext2fs_chown chroot: factor out file copy code Add --include-packagelist src/build.ml | 42 +++++++++++++++++++++++++------ src/chroot.ml | 29
2019 Apr 08
0
[PATCH v4 2/7] common: Bundle the libvirt-ocaml library for use by virt-v2v
...b = bv == Val_true ? 1 : 0; + + NONBLOCKING (r = $c_name ($1, b)); + CHECK_ERROR (r == -1, \"$c_name\"); + + CAMLreturn (Val_unit); +" + } elsif ($sig eq "conn, int : int array") { + "\ + CAMLlocal1 (rv); + virConnectPtr conn = Connect_val (connv); + int i = Int_val (iv); + int *ids, r; + + /* Some libvirt List* functions still throw exceptions if i == 0, + * so catch that and return an empty array directly. This changes + * the semantics slightly (masking other failures) but it's + * unlikely anyone will care. RWMJ 2008/06/10 + */ + if (i ==...
2017 Sep 20
4
[PATCH 0/4] Replace some uses of the Str module with PCRE.
Str is a pretty ugly regexp module. Let's try to replace it with PCRE. This series of commits goes some small way towards that eventual goal. - - - I wonder if there was a deep reason why we had this? let unix2dos s = String.concat "\r\n" (Str.split_delim (Str.regexp_string "\n") s) I replaced it with what I think should be (nearly) equivalent: let unix2dos s =
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 |
2018 May 03
1
[PATCH] daemon: fix memory allocation and leaks in OCaml stubs
..._with_perror (\"malloc\");\n"; + pr " reply_with_perror (\"calloc\");\n"; pr " return NULL;\n"; pr " }\n"; pr "\n"; @@ -644,16 +646,20 @@ let generate_daemon_caml_stubs () = pr " ret->%s = Int_val (v);\n" n ) struc.s_cols; pr "\n"; - pr " return ret;\n"; + pr " real_ret = ret;\n"; + pr " ret = NULL;\n"; + pr " return real_ret;\n"; pr "}\n"; pr "\n" and emit_return_struct_list t...
2019 Aug 10
0
[PATCH libnbd 3/9] generator: Add Enum type for enumerated types / unions.
...x; enums } = + pr "/* Convert OCaml %s.t to int. */\n" enum_prefix; + pr "static int\n"; + pr "%s_val (value v)\n" enum_prefix; + pr "{\n"; + pr " CAMLparam1 (v);\n"; + pr " int i, r = 0;\n"; + pr "\n"; + pr " i = Int_val (Field (v, 0));\n"; + pr " /* i is the index of the enum in the type\n"; + pr " * (eg. i = 0 => enum = %s.%s).\n" enum_prefix (fst (List.hd enums)); + pr " * Convert it to the C representation.\n"; + pr " */\n"; + pr " switch (i) {\n...
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
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