Displaying 20 results from an estimated 37 matches for "guestfs_int_".
2018 May 03
1
[PATCH] daemon: fix memory allocation and leaks in OCaml stubs
...erate_daemon_caml_stubs () =
(* Implement code for returning structs and struct lists. *)
let emit_return_struct typ =
let struc = Structs.lookup_struct typ in
+ let uc_typ = String.uppercase_ascii typ in
pr "/* Implement RStruct (%S, _). */\n" typ;
pr "static guestfs_int_%s *\n" typ;
pr "return_%s (value retv)\n" typ;
pr "{\n";
- pr " guestfs_int_%s *ret;\n" typ;
+ pr " CLEANUP_FREE_%s guestfs_int_%s *ret = NULL;\n" uc_typ typ;
+ pr " guestfs_int_%s *real_ret;\n" typ;
pr " value...
2017 Apr 25
0
[PATCH] daemon: Use CLEANUP_* functions to avoid an explicit free in stub functions.
...g _ | RConstOptString _ ->
failwithf "RConstString|RConstOptString cannot be used by daemon functions"
- | RString _ -> pr " char *r;\n"
- | RStringList _ | RHashtable _ -> pr " char **r;\n"
- | RStruct (_, typ) -> pr " guestfs_int_%s *r;\n" typ
- | RStructList (_, typ) -> pr " guestfs_int_%s_list *r;\n" typ
+ | RString _ -> pr " CLEANUP_FREE char *r = NULL;\n"
+ | RStringList _ | RHashtable _ -> pr " CLEANUP_FREE_STRING_LIST char **r = NULL;\n"
+ | RStruct...
2017 Mar 10
2
[PATCH 1/2] daemon: generate cleanup handlers for structs
...r " * these functions directly.\n";
+ pr " */\n";
+ pr "\n";
+
+ List.iter (
+ fun { s_name = typ; s_cols = cols } ->
+ pr "void\n";
+ pr "cleanup_free_int_%s (void *ptr)\n" typ;
+ pr "{\n";
+ pr " struct guestfs_int_%s *x = (* (struct guestfs_int_%s **) ptr);\n" typ typ;
+ pr "\n";
+ pr " if (x) {\n";
+ pr " xdr_free ((xdrproc_t) xdr_guestfs_int_%s, (char *) x);\n" typ;
+ pr " free (x);\n";
+ pr " }\n";
+ pr "}\n&q...
2017 Jul 21
0
[PATCH v2 01/23] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...+
+#include <caml/alloc.h>
+#include <caml/mlvalues.h>
+#include <caml/memory.h>
+#include <caml/unixsupport.h>
+
+#include "daemon.h"
+#include "daemon-c.h"
+
+/* Convert an OCaml exception to a reply_with_error_errno call
+ * as best we can.
+ */
+void
+guestfs_int_daemon_exn_to_reply_with_error (const char *func, value exn)
+{
+ const char *exn_name;
+
+ /* This is not the official way to do this, but I could not get the
+ * official way to work, and this way does work. See
+ * http://caml.inria.fr/pub/ml-archives/caml-list/2006/05/097f63cfb39a80418f95...
2020 Jan 09
1
[common/libguestfs PATCH] utils: conditionally include config.h on HAVE_CONFIG_H
....c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/utils/stringlists-utils.c b/utils/stringlists-utils.c
index 92c8030..97ad360 100644
--- a/utils/stringlists-utils.c
+++ b/utils/stringlists-utils.c
@@ -23,7 +23,9 @@
* such as C<safe_*>, C<error> or C<perrorf>, or any C<guestfs_int_*>.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
#include <stdlib.h>
#include <string.h>
--
2.24.1
2017 Jul 14
0
[PATCH 23/27] daemon: Reimplement ‘md_detail’ API in OCaml.
...e, RPlainString, _). */
static char **
return_hashtable_mountable_string (value retv)
@@ -878,6 +902,9 @@ return_hashtable_mountable_string (value retv)
pr " return_%s_list (retv);\n" typ;
pr " /* caller frees */\n";
pr " CAMLreturnT (guestfs_int_%s_list *, ret);\n" typ
+ | RHashtable (RPlainString, RPlainString, _) ->
+ pr " char **ret = return_hashtable_string_string (retv);\n";
+ pr " CAMLreturnT (char **, ret); /* caller frees */\n"
| RHashtable (RMountable, RPlainString, _) -...
2017 Jun 05
19
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
v2 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00008.html
This series gets as far as a working (and faster) reimplementation of
‘guestfs_list_filesystems’.
I also have another patch series on top of this one which reimplements
the inspection APIs inside the daemon, but that needs a bit more work
still, since inspection turns out to be a very large piece of code.
Rich.
2017 Apr 25
1
[Bug #1406906] [PATCH] python: fix segmentation fault when setting non UTF-8 strings
...---
1 file changed, 97 insertions(+), 46 deletions(-)
diff --git a/generator/python.ml b/generator/python.ml
index 11dc48102..7d86131b1 100644
--- a/generator/python.ml
+++ b/generator/python.ml
@@ -152,12 +152,20 @@ and generate_python_structs () =
pr "PyObject *\n";
pr "guestfs_int_py_put_%s_list (struct guestfs_%s_list *%ss)\n" typ typ typ;
pr "{\n";
- pr " PyObject *list;\n";
+ pr " PyObject *list, *element;\n";
pr " size_t i;\n";
pr "\n";
pr " list = PyList_New (%ss->len);\n" t...
2017 Jul 27
23
[PATCH v3 00/23] Reimplement many daemon APIs in OCaml.
I think this fixes everything mentioned:
- Added the Optgroups module as suggested.
- Remove command temporary files.
- Replace command ~flags with ?fold_stdout_on_stderr.
- Nest _with_mounted function.
- Rebase & retest.
Rich.
2017 Jul 21
27
[PATCH v2 00/23] Reimplement many daemon APIs in OCaml.
...e changes are moved into the
first patch. This wasn't quite straightforward because I also had
to move the static functions into a separate file so that bisection
wouldn't break.
- Related to previous change, move ocaml_exn_to_reply_with_error to
daemon/daemon-c.c, and rename it
guestfs_int_daemon_exn_to_reply_with_error.
- Move separate patches implementing optgroups and
CommandFlagFoldStdoutOnStderr into the first patch.
- daemon/Makefile.am: Deduplicate BUILT_SOURCES & generator_built vars.
- daemon/chroot.mli: In a comment, fix misspelled parmeter -> parameter.
- daemo...
2017 Jul 14
45
[PATCH 00/27] Reimplement many daemon APIs in OCaml.
Previously posted as part of the mega utilities/inspection
series here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00232.html
What I've done is to extract just the parts related to rewriting
daemon APIs in OCaml, rebase them on top of the current master, fix a
few things, and recompile and test everything.
Rich.
2018 Feb 15
0
[PATCH] Introduce a wrapper around xmlParseURI.
...(strv));
+ if (uri == NULL)
+ caml_invalid_argument ("parse_uri: unable to parse URI");
+
+ rv = Val_uri (uri);
xmlFreeURI (uri);
+ CAMLreturn (rv);
+}
+
+value
+mllib_xml_parse_nonstandard_uri (value strv)
+{
+ CAMLparam1 (strv);
+ CAMLlocal1 (rv);
+ xmlURIPtr uri;
+ uri = guestfs_int_parse_nonstandard_uri (String_val (strv));
+ if (uri == NULL)
+ unix_error (errno, (char *) "Xml.parse_uri", strv);
+
+ rv = Val_uri (uri);
+ xmlFreeURI (uri);
CAMLreturn (rv);
}
diff --git a/common/mlxml/xml.ml b/common/mlxml/xml.ml
index 5b5c09c00..faeea35ee 100644
--- a/common...
2018 Nov 02
0
[PATCH REPOST] Introduce a wrapper around xmlParseURI.
...(strv));
+ if (uri == NULL)
+ caml_invalid_argument ("parse_uri: unable to parse URI");
+
+ rv = Val_uri (uri);
xmlFreeURI (uri);
+ CAMLreturn (rv);
+}
+
+value
+mllib_xml_parse_nonstandard_uri (value strv)
+{
+ CAMLparam1 (strv);
+ CAMLlocal1 (rv);
+ xmlURIPtr uri;
+ uri = guestfs_int_parse_nonstandard_uri (String_val (strv));
+ if (uri == NULL)
+ unix_error (errno, (char *) "Xml.parse_uri", strv);
+
+ rv = Val_uri (uri);
+ xmlFreeURI (uri);
CAMLreturn (rv);
}
diff --git a/common/mlxml/xml.ml b/common/mlxml/xml.ml
index 5b5c09c00..faeea35ee 100644
--- a/common...
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
2018 Nov 02
2
[PATCH REPOST] Introduce a wrapper around xmlParseURI.
Previously posted:
https://www.redhat.com/archives/libguestfs/2017-December/msg00046.html
Rich.
2019 Dec 20
3
[common/libguestfs PATCH 0/2] Fix OCaml/Python linking
Make sure they can build also in no as-neede setups.
Pino Toscano (1):
utils: split string list functions in own file
build: use split stringlist functions from common/utils
utils/Makefile.am | 2 +
utils/guestfs-stringlists-utils.h | 30 +++++
utils/guestfs-utils.h | 7 +-
utils/stringlists-utils.c | 197 ++++++++++++++++++++++++++++++
utils/utils.c
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...- n + sizeof (struct inotify_event) + event->len > inotify_posn)
- break;
+ n + sizeof (struct inotify_event) + event->len > inotify_posn)
+ break;
#else
#error "this code needs fixing so it works on non-GCC compilers"
#endif
np = realloc (ret->guestfs_int_inotify_event_list_val,
- (ret->guestfs_int_inotify_event_list_len + 1) *
- sizeof (guestfs_int_inotify_event));
+ (ret->guestfs_int_inotify_event_list_len + 1) *
+ sizeof (guestfs_int_inotify_event));
if (np == NULL) {
- reply_with_perror...
2017 Jul 14
0
[PATCH 19/27] daemon: Reimplement ‘list_filesystems’ API in the daemon, in OCaml.
...mount.ml \
parted.ml \
+ listfs.ml \
realpath.ml \
callbacks.ml \
daemon.ml
diff --git a/daemon/ldm.ml b/daemon/ldm.ml
index dc7b36f9c..19cd03e83 100644
--- a/daemon/ldm.ml
+++ b/daemon/ldm.ml
@@ -20,6 +20,9 @@ open Std_utils
open Utils
+external available : unit -> bool =
+ "guestfs_int_daemon_optgroup_lvm2_available" "noalloc"
+
(* All device mapper devices are called /dev/mapper/ldm_vol_*. XXX We
* could tighten this up in future if ldmtool had a way to read these
* names back after they have been created.
diff --git a/daemon/ldm.mli b/daemon/ldm.mli
index 78...
2016 Aug 08
0
ANNOUNCE: libguestfs 1.34 released
...ot need to specify one.
The C API tests now use larger test disks, allowing BTRFS to be tested
properly (Pino Toscano).
The tests should now work on a pure Python 3 host (Pino Toscano).
In C bindings, internal functions are now (mostly) consistently named
"guestfs_int_*" whereas previously there was no consistent scheme.
The old "safe_malloc" etc functions are now no longer exported by the
library, nor used in language bindings.
Setting TMPDIR to a path longer than ~ 100 characters will no longer
cause libguestfs to fa...
2017 Jun 19
29
[PATCH v7 00/29] Reimplement inspection in the daemon.
v6 was posted here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html
and this requires the utilities refactoring posted here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html
Inspection is now complete[*], although not very well tested. I'm
intending to compare the output of many guests using old & new
virt-inspector to see if I can find any