Displaying 20 results from an estimated 72 matches for "int64_val".
Did you mean:
int64_max
2016 Apr 14
1
Re: [PATCH v2] customize/perl_edit-c.c: Don't use internal APIs.
...e verbosev, value gv, value gpv,
> + value filev, value 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);
This causes warnings on 32bit platforms though:
perl_edit-c.c: In function 'virt_customize_edit_file_perl':
perl_edit-c.c:40:18: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
guestfs_h *g = (guestfs_h *) Int64_val (gpv);
^...
2017 Mar 29
1
[PATCH] mllib: cast integer pointers to intptr_t as intermediate step
This make sure there is no mismatch between the size of the integer
value that Int64_val returns, and the size of the guestfs_h pointer.
This should fix the warning on 32bit environments (and thus build, when
--enable-werror is enabled).
---
mllib/visit-c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mllib/visit-c.c b/mllib/visit-c.c
index b46dd33..b1c1216 100...
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.
2019 Sep 05
2
[PATCH 0/1] Build fix for future OCaml 4.09
This is a simple fix for building also with the upcoming OCaml 4.09,
which has a slight API change in the C library.
This does not cover embedded copies such as ocaml-augeas, and
ocaml-libvirt, which are being fixed separately, and will then be
synchronized.
Pino Toscano (1):
ocaml: make const the return value of caml_named_value()
common/mlpcre/pcre-c.c | 2 +-
common/mltools/uri-c.c |
2019 Sep 05
1
[PATCH] ocaml: Change calls to caml_named_value() to cope with const value* return.
...lvisit/visit-c.c
index 7137c4998..201f6d762 100644
--- a/common/mlvisit/visit-c.c
+++ b/common/mlvisit/visit-c.c
@@ -53,7 +53,6 @@ value
guestfs_int_mllib_visit (value gv, value dirv, value fv)
{
CAMLparam3 (gv, dirv, fv);
- value *visit_failure_exn;
guestfs_h *g = (guestfs_h *) (intptr_t) Int64_val (gv);
struct visitor_function_wrapper_args args;
/* The dir string could move around when we call the
@@ -84,8 +83,7 @@ guestfs_int_mllib_visit (value gv, value dirv, value fv)
* already printed the error to stderr (XXX - fix), so we raise a
* generic exception.
*/
- visi...
2010 Jun 28
8
[PATCH] add xl ocaml bindings
...v)
+{
+ CAMLparam1(v);
+ CAMLlocal1(infopriv);
+
+ c_val->timer_mode = Int_val(Field(v, 0));
+ c_val->hpet = Int_val(Field(v, 1));
+ c_val->vpt_align = Int_val(Field(v, 2));
+ c_val->max_vcpus = Int_val(Field(v, 3));
+ c_val->cur_vcpus = Int_val(Field(v, 4));
+ c_val->max_memkb = Int64_val(Field(v, 5));
+ c_val->target_memkb = Int64_val(Field(v, 6));
+ c_val->video_memkb = Int64_val(Field(v, 7));
+ c_val->shadow_memkb = Int64_val(Field(v, 8));
+ c_val->kernel = String_val(Field(v, 9));
+ c_val->hvm = Tag_val(Field(v, 10)) == 0;
+ infopriv = Field(Field(v, 10), 0);
+ if...
2016 Apr 11
0
[PATCH] customize/perl_edit-c.c: Don't use internal APIs.
....h"
-
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
value
@@ -43,12 +37,12 @@ virt_customize_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");...
2016 Apr 12
0
[PATCH v2] customize/perl_edit-c.c: Don't use internal APIs.
...virt_customize_edit_file_perl (value verbosev, value gv, value gpv,
+ value filev, value 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")...
2019 Sep 05
0
[PATCH 1/1] ocaml: make const the return value of caml_named_value()
...04aabc9d 100644
--- a/common/mlvisit/visit-c.c
+++ b/common/mlvisit/visit-c.c
@@ -53,7 +53,7 @@ value
guestfs_int_mllib_visit (value gv, value dirv, value fv)
{
CAMLparam3 (gv, dirv, fv);
- value *visit_failure_exn;
+ const value *visit_failure_exn;
guestfs_h *g = (guestfs_h *) (intptr_t) Int64_val (gv);
struct visitor_function_wrapper_args args;
/* The dir string could move around when we call the
diff --git a/generator/daemon.ml b/generator/daemon.ml
index a4e136aaa..b67c4d20b 100644
--- a/generator/daemon.ml
+++ b/generator/daemon.ml
@@ -746,7 +746,7 @@ let generate_daemon_caml_stubs...
2020 Jan 22
0
[PATCH] mltools, options: support --allow-discards when decrypting LUKS devices
..._mllib_inspect_decrypt (value gv, value gpv, value keysv)
+guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv, value allowdiscards)
{
- CAMLparam3 (gv, gpv, keysv);
+ CAMLparam4 (gv, gpv, keysv, allowdiscards);
CAMLlocal2 (elemv, v);
guestfs_h *g = (guestfs_h *) (intptr_t) Int64_val (gpv);
struct key_store *ks = NULL;
@@ -86,7 +86,7 @@ guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv)
keysv = Field (keysv, 1);
}
- inspect_do_decrypt (g, ks);
+ inspect_do_decrypt (g, ks, Int_val (allowdiscards));
CAMLreturn (Val_unit);
}
diff --git a/mlto...
2016 Sep 19
0
[PATCH 2/3] mllib: expose disk decrypt functionalities
...s_int_mllib_set_keys_from_stdin (value unitv);
+
+/* Interface with the guestfish inspection and decryption code. */
+int echo_keys = 0;
+int keys_from_stdin = 0;
+
+value
+guestfs_int_mllib_inspect_decrypt (value gv, value gpv)
+{
+ CAMLparam2 (gv, gpv);
+ guestfs_h *g = (guestfs_h *) (intptr_t) Int64_val (gpv);
+
+ inspect_do_decrypt (g);
+
+ CAMLreturn (Val_unit);
+}
+
+/* NB: This is a "noalloc" call. */
+value
+guestfs_int_mllib_set_echo_keys (value unitv)
+{
+ echo_keys = 1;
+ return Val_unit;
+}
+
+/* NB: This is a "noalloc" call. */
+value
+guestfs_int_mllib_set_keys_f...
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.
2017 Feb 10
0
[PATCH v3 06/10] mllib: ocaml wrapper for lib/osinfo
...raised by callback */
+ value *fvp; /* callback. */
+};
+
+static int read_osinfo_db_callback_wrapper (guestfs_h *g, const char *path, void *opaque);
+
+value
+guestfs_int_mllib_read_osinfo_db (value gv, value fv)
+{
+ CAMLparam2 (gv, fv);
+ guestfs_h *g = (guestfs_h *) Int64_val (gv);
+ struct callback_wrapper_args args;
+
+ /* This stack address is used to point to the exception, if one is
+ * raised in the visitor_function. Note that the macro initializes
+ * this to Val_unit, which is how we know if an exception was set.
+ */
+ CAMLlocal1 (exn);
+
+ args.exnp...
2017 Mar 07
0
[PATCH v4 3/9] mllib: ocaml wrapper for lib/osinfo
...raised by callback */
+ value *fvp; /* callback. */
+};
+
+static int read_osinfo_db_callback_wrapper (guestfs_h *g, const char *path, void *opaque);
+
+value
+guestfs_int_mllib_read_osinfo_db (value gv, value fv)
+{
+ CAMLparam2 (gv, fv);
+ guestfs_h *g = (guestfs_h *) Int64_val (gv);
+ struct callback_wrapper_args args;
+
+ /* This stack address is used to point to the exception, if one is
+ * raised in the visitor_function. Note that the macro initializes
+ * this to Val_unit, which is how we know if an exception was set.
+ */
+ CAMLlocal1 (exn);
+
+ args.exnp...
2017 Mar 23
0
[PATCH v5 03/10] mllib: ocaml wrapper for lib/osinfo
...raised by callback */
+ value *fvp; /* callback. */
+};
+
+static int read_osinfo_db_callback_wrapper (guestfs_h *g, const char *path, void *opaque);
+
+value
+guestfs_int_mllib_read_osinfo_db (value gv, value fv)
+{
+ CAMLparam2 (gv, fv);
+ guestfs_h *g = (guestfs_h *) Int64_val (gv);
+ struct callback_wrapper_args args;
+
+ /* This stack address is used to point to the exception, if one is
+ * raised in the visitor_function. Note that the macro initializes
+ * this to Val_unit, which is how we know if an exception was set.
+ */
+ CAMLlocal1 (exn);
+
+ exn = Val...
2014 Dec 10
2
[PATCH v1 0/2] Implement guestfs_add_libvirt_dom.
This is only lightly tested at the moment.
For context see:
https://bugzilla.redhat.com/show_bug.cgi?id=1138203#c40
https://bugzilla.redhat.com/show_bug.cgi?id=1075143
https://bugzilla.redhat.com/show_bug.cgi?id=1075164
Note this is not a complete fix. At least one more libguestfs patch
is required (to implement virDomainPtr in the python bindings). Plus
a virt-manager patch.
Rich.
2017 Apr 12
0
[PATCH v6 03/10] mllib: ocaml wrapper for lib/osinfo
...raised by callback */
+ value *fvp; /* callback. */
+};
+
+static int read_osinfo_db_callback_wrapper (guestfs_h *g, const char *path, void *opaque);
+
+value
+guestfs_int_mllib_read_osinfo_db (value gv, value fv)
+{
+ CAMLparam2 (gv, fv);
+ guestfs_h *g = (guestfs_h *) Int64_val (gv);
+ struct callback_wrapper_args args;
+
+ /* This stack address is used to point to the exception, if one is
+ * raised in the visitor_function. Note that the macro initializes
+ * this to Val_unit, which is how we know if an exception was set.
+ */
+ CAMLlocal1 (exn);
+
+ exn = Val...
2019 Aug 14
0
[PATCH libnbd 2/2] ocaml: Remove NBD.Buffer.free function, use the completion callback instead.
...name cbname;
pr " %s_callback.free = free_user_data;\n" cbname
| Enum (n, { enum_prefix }) ->
pr " int %s = %s_val (%sv);\n" n enum_prefix n
@@ -5154,6 +5156,19 @@ let print_ocaml_binding (name, { args; optargs; ret }) =
pr " uint64_t %s = Int64_val (%sv);\n" n n
) args;
+ (* If there is a BytesPersistIn/Out parameter then we need to
+ * register it as a global root and save that into the
+ * completion_callback.user_data so the root is removed on
+ * command completion.
+ *)
+ List.iter (
+ function
+ | BytesPersistI...
2014 Dec 10
3
[PATCH v2 0/3] Implement guestfs_add_libvirt_dom.
This completes the implementation on the libguestfs side, allowing
python-libvirt dom pointers to be passed to guestfs_add_libvirt_dom.
For context see:
https://bugzilla.redhat.com/show_bug.cgi?id=1138203#c40
https://bugzilla.redhat.com/show_bug.cgi?id=1075143
https://bugzilla.redhat.com/show_bug.cgi?id=1075164
Rich.
2014 Dec 11
4
[PATCH v3 0/4] Implement guestfs_add_libvirt_dom.
A hopefully cleaner implementation this time. It doesn't
require any special insights into how libvirt-python is
implemented. Instead, it requires a change to libvirt-python
to add a .c_pointer() method:
https://www.redhat.com/archives/libvir-list/2014-December/msg00615.html
Rich.