search for: guestfs_next_priv

Displaying 20 results from an estimated 29 matches for "guestfs_next_priv".

2011 Mar 14
1
[PATCH] New APIs: guestfs_first_private, guestfs_next_private to walk over the private data area.
...sts. http://et.redhat.com/~rjones/virt-p2v -------------- next part -------------- >From 9cebd2178ffc99a233af32f2477ef4c0f84f3f1c Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones <rjones at redhat.com> Date: Mon, 14 Mar 2011 13:19:47 +0000 Subject: [PATCH] New APIs: guestfs_first_private, guestfs_next_private to walk over the private data area. This commit adds new APIs for walking over the keys and pointers in the private data area associated with each handle (note this is only applicable to the C API). --- .gitignore | 1 + capitests/Makefile.am | 13 ++++- capite...
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 Mar 03
5
[PATCH v2 0/4] Avoid 0-bytes malloc in bindings
Hi, some of the bindings may try to malloc with 0 bytes as size when closing an handle, because there were no event handlers registered. Since this can have different behaviours in POSIX, avoid that situation altogether by just skipping allocating anything when there were no event handlers. Thanks, Pino Toscano (4): ocaml: do not try to malloc 0 elements in get_all_event_callbacks python:
2017 Mar 03
14
[PATCH 00/11] Various Coverity fixes
Hi, this patch series fixes some issues discovered by Coverity. Most of them are memory leaks, usually on error; there are also invalid memory access issues. Thanks, Pino Toscano (11): java: link libguestfs_jni against libutils java: fix invalid memory access for FBuffer in struct lists daemon: tsk: properly use GUESTFS_MAX_CHUNK_SIZE edit: fix small memory leak on error java: fix
2016 Nov 08
4
[PATCH 1/3] generator: c: move internal functions
...nerator/c.ml | 163 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 82 insertions(+), 81 deletions(-) diff --git a/generator/c.ml b/generator/c.ml index 6f5a517..f0df5ea 100644 --- a/generator/c.ml +++ b/generator/c.ml @@ -585,21 +585,85 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char * /* Structures. */ "; - (* The structures are carefully written to have exactly the same - * in-memory format as the XDR structures that we use on the wire to - * the daemon. The reason for creating copies of these structures - * here is just so we don...
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.
2015 Jun 06
0
[PATCH 2/5] threads: Acquire and release the lock around each public guestfs_* API.
...* Iterator. */ -void * -guestfs_first_private (guestfs_h *g, const char **key_rtn) +static void * +unlocked_first_private (guestfs_h *g, const char **key_rtn) { if (g->pda == NULL) return NULL; @@ -122,7 +137,18 @@ guestfs_first_private (guestfs_h *g, const char **key_rtn) } void * -guestfs_next_private (guestfs_h *g, const char **key_rtn) +guestfs_first_private (guestfs_h *g, const char **key_rtn) +{ + void *r; + + ACQUIRE_LOCK (g); + r = unlocked_first_private (g, key_rtn); + RELEASE_LOCK (g); + return r; +} + +static void * +unlocked_next_private (guestfs_h *g, const char **key_rtn) {...
2013 Jan 30
1
[PATCH] Make internal-only functions and structures private
...sorted by name. *) + val test_functions : Types.action list (** Internal test functions used to test the language bindings. *) diff --git a/generator/c.ml b/generator/c.ml index f0102df..76397d6 100644 --- a/generator/c.ml +++ b/generator/c.ml @@ -576,7 +576,7 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char * *) (* Public structures. *) - List.iter ( + let generate_all_structs = List.iter ( fun { s_name = typ; s_cols = cols } -> pr "struct guestfs_%s {\n" typ; List.iter ( @@ -603,7 +603,9 @@ extern GUESTFS_DLL_PUBLIC void *guestfs...
2017 Mar 03
0
[PATCH 08/11] ocaml: do not try to malloc 0 elements in get_all_event_callbacks
...} /* Copy them into the return array. */ - r = malloc (sizeof (value *) * (*len_rtn)); + r = malloc (sizeof (value *) * (*len_rtn + 1)); if (r == NULL) caml_raise_out_of_memory (); i = 0; @@ -323,6 +323,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn) } root = guestfs_next_private (g, &key); } + r[i] = NULL; return r; } -- 2.9.3
2017 Mar 03
1
Re: [PATCH 08/11] ocaml: do not try to malloc 0 elements in get_all_event_callbacks
...if (r == NULL) caml_raise_out_of_memory (); + if (*len_rtn > 0 && r == NULL) caml_raise_out_of_memory (); (same comment in the following patches) Rich. > > i = 0; > @@ -323,6 +323,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn) > } > root = guestfs_next_private (g, &key); > } > + r[i] = NULL; > > return r; > } > -- > 2.9.3 > > _______________________________________________ > Libguestfs mailing list > Libguestfs@redhat.com > https://www.redhat.com/mailman/listinfo/libguestfs -- Richard Jones, Virtua...
2015 May 26
6
[PATCH 0/6] Update the way that API versions are generated for the man page.
The existing mechanism was clunky, slow and used ~ 10 MB of local disk. Rich.
2014 Jun 27
3
[PATCH WIP] Can't generate argv variant
Hi everyone, lately I've been getting familiar with library and working on slight re-layering of the library. It's about having locking layer in public API and tracing one layer below that (let's call it __t_ layer. I'm not very good at making up names, so this is temporary:) ). Then making sure that all generated public stuff call __t_ layer and all other internal stuff
2016 Nov 08
0
[PATCH 2/3] Split internal stuff out of guestfs.h
...r is_private (actions |> sort) +let internal_functions_sorted = + List.filter is_internal (actions |> sort) + (* Generate a C function prototype. *) let rec generate_prototype ?(extern = true) ?(static = false) ?(semicolon = true) @@ -607,13 +616,6 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char * generate_all_headers private_functions_sorted; - pr "\ -/* Private structures. */ - -"; - - generate_all_structs internal_structs; - pr "\ #endif /* End of GUESTFS_PRIVATE. */ @@ -650,6 +652,34 @@ pr "\ #endif /* GUESTFS_H_ */ "...
2015 Jun 06
7
[PATCH 0/5] Add support for thread-safe handle.
This patch isn't ready to go upstream. In fact, I think we might do a quick 1.30 release soon, and save this patch, and also the extensive changes proposed for the test suite[1], to after 1.30. Currently it is not safe to use the same handle from multiple threads, unless you implement your own mutexes. See: http://libguestfs.org/guestfs.3.html#multiple-handles-and-multiple-threads These
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 Apr 23
8
[PATCH 0/7] Make deprecation warnings more prominent
Since there are deprecated APIs, make sure that users notice they are deprecated in more prominent ways than done so far: - using deprecated C functions now warns by default - it is possible to use the C library making sure no deprecated function is ever used - Python/Ruby/Perl scripts now get warning messages (configured according to their own systems) when deprecated functions are used The
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...UESTFS_EVENT_%-16s 0x%04x\n" - (String.uppercase name) bitmask + (String.uppercase_ascii name) bitmask ) events; pr "#define GUESTFS_EVENT_%-16s 0x%04x\n" "ALL" all_events_bitmask; pr "\n"; @@ -601,7 +603,7 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char * (* Public structures. *) let generate_all_structs = List.iter ( fun { s_name = typ; s_cols = cols } -> - pr "#define GUESTFS_HAVE_STRUCT_%s 1\n" (String.uppercase typ); + pr "#define GUESTFS_HAVE_STRUCT_%s 1\n" (String.upper...
2017 Oct 04
0
[PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...rate_actions_pod_back_compat_entry ({ name; style = ret, args, _ } as f) = pr "=head2 guestfs_%s\n\n" name; generate_prototype ~extern:false ~indent:" " ~handle:"g" @@ -644,7 +644,7 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char * let generate_action_header { name = shortname; style = ret, args, optargs as style; - deprecated_by = deprecated_by } = + deprecated_by } = pr "#define GUESTFS_H...
2015 Jun 16
5
[PATCH threads v2 0/5] Add support for thread-safe handle.
Previous discussion here: https://www.redhat.com/archives/libguestfs/2015-June/thread.html#00048 v2: - Use a cleanup handler to release the lock. - Rebase to upstream. Note I have not fixed the problem(s) with error handling (patch 3).
2017 Mar 03
2
[PATCH] generator: Allow actions to be deprecated with no replacement.
...(guestfs_h *g, guestfs_progress_cb cb, void *opaque) - GUESTFS_DEPRECATED_BY(\"set_event_callback\"); + GUESTFS_DEPRECATED_REPLACED_BY(\"set_event_callback\"); /* Private data area. */ #define GUESTFS_HAVE_SET_PRIVATE 1 @@ -662,8 +665,12 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char * generate_prototype ~single_line:true ~semicolon:false ~dll_public:true ~handle:"g" ~prefix:"guestfs_" shortname style; (match deprecated_by with - | Some fn -> pr "\n GUESTFS_DEPRECATED_BY (%S);\n" fn - | None -...