search for: s_list

Displaying 20 results from an estimated 69 matches for "s_list".

Did you mean: _list
2018 May 03
1
[PATCH] daemon: fix memory allocation and leaks in OCaml stubs
...t; ret = NULL;\n"; + pr " return real_ret;\n"; pr "}\n"; pr "\n" and emit_return_struct_list typ = + let uc_typ = String.uppercase_ascii typ in pr "/* Implement RStructList (%S, _). */\n" typ; pr "static guestfs_int_%s_list *\n" typ; pr "return_%s_list (value retv)\n" typ; pr "{\n"; - pr " guestfs_int_%s_list *ret;\n" typ; + pr " CLEANUP_FREE_%s_LIST guestfs_int_%s_list *ret = NULL;\n" uc_typ typ; + pr " guestfs_int_%s_list *real_ret;\n" typ;...
2017 Mar 10
2
[PATCH 1/2] daemon: generate cleanup handlers for structs
...quot; if (x) {\n"; + pr " xdr_free ((xdrproc_t) xdr_guestfs_int_%s, (char *) x);\n" typ; + pr " free (x);\n"; + pr " }\n"; + pr "}\n"; + pr "\n"; + + pr "void\n"; + pr "cleanup_free_int_%s_list (void *ptr)\n" typ; + pr "{\n"; + pr " struct guestfs_int_%s_list *x = (* (struct guestfs_int_%s_list **) ptr);\n" + typ typ; + pr "\n"; + pr " if (x) {\n"; + pr " xdr_free ((xdrproc_t) xdr_guestfs_int_%s_list, (...
2017 Apr 25
1
[Bug #1406906] [PATCH] python: fix segmentation fault when setting non UTF-8 strings
...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" typ; - pr &q...
2009 Aug 14
1
Code snippet to work out which RStruct/RStructList structs are used and how
-- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v -------------- next part -------------- >From 9efa77d717bd9bba5f61965eb6920429b7ae5d8e Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones
2020 Jun 01
1
[PATCH] erlang: Port to libei for Erlang 23
...ar **res, size_t *size); +extern int decode_bool (const char *buff, int *index, int *res); +extern int decode_int (const char *buff, int *index, int *res); +extern int decode_int64 (const char *buff, int *index, int64_t *res); "; let emit_copy_list_decl typ = - pr "ETERM *make_%s_list (const struct guestfs_%s_list *%ss);\n" + pr "int make_%s_list (ei_x_buff *buff, const struct guestfs_%s_list *%ss);\n" typ typ typ; in List.iter ( fun { s_name = typ; s_cols = cols } -> - pr "ETERM *make_%s (const struct guestfs_%s *%s);\n" ty...
2009 Aug 17
2
[PATCH libguestfs] generator.ml: do not emit unused print_*_list functions
I see the following warnings: cmds.c:934:13: warning: 'print_int_bool_list' defined but not used cmds.c:1093:13: warning: 'print_stat_list' defined but not used cmds.c:1124:13: warning: 'print_statvfs_list' defined but not used cmds.c:1171:13: warning: 'print_version_list' defined but not used This patch makes it so we don't emit the unused definitions: >From ff307d5e14b33fbbf97c411a97905127021b09fc Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering at redhat.com> Date...
2017 Mar 18
0
[PATCH] python: check return value of Python APIs
...97 insertions(+), 46 deletions(-) diff --git a/generator/python.ml b/generator/python.ml index 11dc48102..d03275276 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" typ; - pr &q...
2012 Oct 30
5
[PATCH v3 0/5] Add symbol versioning.
This is a simpler patch series to add symbol versioning. I have pushed patches 1-3 upstream. Rich.
2009 Aug 28
1
[PATCHES] avoid more warnings
...rc/generator.ml index fa7d240..569e1a1 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -6692,6 +6692,29 @@ copy_table (char * const * argv) "; (* Struct copy functions. *) + + let emit_ocaml_copy_list_function typ = + pr "static CAMLprim value\n"; + pr "copy_%s_list (const struct guestfs_%s_list *%ss)\n" typ typ typ; + pr "{\n"; + pr " CAMLparam0 ();\n"; + pr " CAMLlocal2 (rv, v);\n"; + pr " unsigned int i;\n"; + pr "\n"; + pr " if (%ss->len == 0)\n" typ; + pr "...
2012 Oct 30
7
[PATCH v2 0/7] Add symbol versioning (now working).
This rather more complex patch series adds symbol versioning (7/7 shows it in action). This works for me, tested by running old and new virt-inspector binaries against the new library. Rich.
2017 May 11
1
[PATCH v2] RHBZ#1406906: check return value of Python object functions
...644 python/t/test830RHBZ1406906.py diff --git a/generator/python.ml b/generator/python.ml index cf0829489..4cae24757 100644 --- a/generator/python.ml +++ b/generator/python.ml @@ -155,12 +155,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" typ; - pr &q...
2017 May 09
1
[PATCH] RHBZ#1406906: check return value of Python object functions
...644 python/t/test830RHBZ1406906.py diff --git a/generator/python.ml b/generator/python.ml index cf0829489..4cae24757 100644 --- a/generator/python.ml +++ b/generator/python.ml @@ -155,12 +155,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" typ; - pr &q...
2017 Mar 06
7
[PATCH 0/6] Various Coverity fixes #2
Hi, this patch series fixes few more issues discovered by Coverity. Thanks, Pino Toscano (6): tail: check the return value pf guestfs_set_pgroup daemon: btrfs: check end_stringsbuf return values everywhere java: use cleanup handlers for structs (lists) as return values lib: qemu: improve handling of FILE* p2v: check more return values p2v: fix possible close(-1) issue cat/tail.c
2017 May 06
5
[Bug 1406906] [PATCH 0/3] Fix segmentation fault in Python bindings
This series addresses the issue where non UTF8 file names in a guest image lead to libguestfs segfault with Python 3 APIs. The core issue is the APIs are not checking the return value when constructing a new PyObject. Therefore NULL pointers are added to Python collections (lists and dictionaries) crashing the application. Few notes regarding the comments on the previous patch. - Added a
2016 Feb 24
0
[PATCH 3/3] src: print contents of structs and struct lists on tracing
...t_%s_indent (%s, trace_buffer.fp, \", \", \"\");\n" + indent typ rv; + pr "%s fprintf (trace_buffer.fp, \">\");\n" indent | RStructList (_, typ) -> - pr "%s fprintf (trace_buffer.fp, \"<struct guestfs_%s_list *>\");\n" - indent typ (* XXX *) + pr "%s fprintf (trace_buffer.fp, \"<struct guestfs_%s_list(%%u)\", %s->len);\n" + indent typ rv; + pr "%s if (%s->len > 0)\n" indent rv; + pr "%s fprintf (...
2017 Apr 25
0
[PATCH] daemon: Use CLEANUP_* functions to avoid an explicit free in stub functions.
...t 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 (_, typ) -> pr " CLEANUP_FREE guestfs_int_%s *r = NULL;\n" typ +...
2012 Jan 18
4
[PATCH 1/4] ocaml: Add -Wno-missing-field-initializers to avoid a warning.
From: "Richard W.M. Jones" <rjones at redhat.com> --- configure.ac | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index fa97479..6e42423 100644 --- a/configure.ac +++ b/configure.ac @@ -141,6 +141,10 @@ if test "$gl_gcc_warnings" = yes; then # Work around warning in src/inspect.c. This seems to be a bug in gcc
2017 Jul 14
0
[PATCH 23/27] daemon: Reimplement ‘md_detail’ API in OCaml.
...return NULL; + + return take_stringsbuf (&ret); /* caller frees */ +} + /* Implement RHashtable (RMountable, 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"; +...
2015 Sep 15
3
[PATCH 3/3] python: Allow bindings to be compiled with different version of libguestfs (RHBZ#1262983).
Patch to fix: https://bugzilla.redhat.com/show_bug.cgi?id=1262983 Note this won't help until the first two patches get backported to the stable branches, since <guestfs.h> won't define the necessary GUESTFS_HAVE_* macros. Rich.
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
..., typ) -> + pr "This function returns a C<struct guestfs_%s *>, or NULL if there was an error. I<The caller must call C<guestfs_free_%s> after use>.\n\n" typ typ - | RStructList (_, typ) -> - pr "This function returns a C<struct guestfs_%s_list *> + | RStructList (_, typ) -> + pr "This function returns a C<struct guestfs_%s_list *> (see E<lt>guestfs-structs.hE<gt>), or NULL if there was an error. I<The caller must call C<guestfs_free_%s_list> after use>.\n\n" typ typ -...