Displaying 20 results from an estimated 50 matches for "generate_client_act".
2015 Jun 06
0
[PATCH 2/5] threads: Acquire and release the lock around each public guestfs_* API.
...ndle.c | 20 ++++++++++++++-
src/private-data.c | 47 +++++++++++++++++++++++++++++++----
6 files changed, 218 insertions(+), 19 deletions(-)
diff --git a/generator/c.ml b/generator/c.ml
index a2b9c94..93f1e5b 100644
--- a/generator/c.ml
+++ b/generator/c.ml
@@ -1271,6 +1271,7 @@ and generate_client_actions hash () =
"%s: RConstOptString function has invalid parameter '%s'"
c_name n
| (`ErrorIsMinusOne |`ErrorIsNULL) as e -> e in
+ pr " RELEASE_LOCK (g);\n";
pr " return %s;\n"...
2014 May 15
2
[PATCH] Add global mutex around each C call
From: Maros Zatko <mzatko@redhat.com>
Patch adds recursive mutex around C calls, which tries to fix
potential race condition in guestfs_umount_local (see [1]).
[1] - https://bugzilla.redhat.com/show_bug.cgi?id=917706
Maros Zatko (1):
generator: c.ml - wrap non deamon function with recursive mutex
generator/c.ml | 12 ++++++++++++
1 file changed, 12 insertions(+)
--
1.8.5.3
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
2016 Feb 24
0
[PATCH 3/3] src: print contents of structs and struct lists on tracing
...d of getting just the name of the struct
returned.
---
generator/c.ml | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/generator/c.ml b/generator/c.ml
index 9af4529..7446412 100644
--- a/generator/c.ml
+++ b/generator/c.ml
@@ -1348,6 +1348,7 @@ and generate_client_actions hash () =
#include \"guestfs-internal-actions.h\"
#include \"guestfs_protocol.h\"
#include \"errnostring.h\"
+#include \"structs-print.h\"
";
@@ -1623,7 +1624,7 @@ and generate_client_actions hash () =
let needs_i =
match ret wi...
2016 Feb 24
3
[PATCH 1/3] src: generate code for printing contents of structs
...) in
+
+ write_structs external_structs;
+
+ pr "\
+
+#if GUESTFS_PRIVATE
+
+";
+
+ write_structs internal_structs;
+
+ pr "\
+
+#endif /* End of GUESTFS_PRIVATE. */
+
+#endif /* GUESTFS_INTERNAL_STRUCTS_PRINT_H_ */
+"
+
(* Generate the client-side dispatch stubs. *)
and generate_client_actions hash () =
generate_header CStyle LGPLv2plus;
diff --git a/generator/c.mli b/generator/c.mli
index 9a261a4..156b244 100644
--- a/generator/c.mli
+++ b/generator/c.mli
@@ -32,6 +32,8 @@ val generate_client_structs_cleanup : unit -> unit
val generate_client_structs_compare : unit -> unit...
2014 May 16
2
Re: [PATCH] generator: c.ml - wrap non deamon function with recursive mutex
...I think the lock needs to be per-handle
unless I'm misunderstanding what this is for.
Rich.
> + pr "\n";
> +
> pr "#endif /* GUESTFS_INTERNAL_ACTIONS_H_ */\n"
>
> (* Generate guestfs-internal-frontend-cleanups.h file. *)
> @@ -1567,6 +1574,8 @@ and generate_client_actions hash () =
> c_name style;
> pr "{\n";
>
> + pr " gl_recursive_lock_lock (global_lock);\n";
> +
> handle_null_optargs optargs c_name;
>
> pr " int trace_flag = g->trace;\n";
> @@ -1617,6 +1626,9 @@ and g...
2016 Sep 02
6
[PATCH 0/4] generator: Some work to split large C files
By splitting up large C files we can make parallel compiles
a bit faster.
Rich.
2014 Feb 10
5
[PATCH 0/4] add GUID validation (RHBZ#1008417)
Hi,
this patch serie adds a new GUID type in the generator, which would do
the same as String, but also validating (just in the C output) the
passed GUID string.
This allows to reject invalid GUIDs before passing them to low-level
tools.
Pino Toscano (4):
utils: add a function to validate a GUID string
generator: add a GUID parameter type
generator: generate code for parameter validation
2015 Oct 20
3
[PATCH 1/2] generator: add a RelativePathnameList parameter type
...else
pr "const char *%s" n
- | StringList n | DeviceList n ->
+ | StringList n | DeviceList n | RelativePathnameList n ->
next ();
pr "char *const *%s" n
| Bool n -> next (); pr "int %s" n
@@ -1252,7 +1252,8 @@ and generate_client_actions hash () =
| DeviceList n
| Key n
| Pointer (_, n)
- | GUID n ->
+ | GUID n
+ | RelativePathnameList n ->
pr " if (%s == NULL) {\n" n;
pr " error (g, \"%%s: %%s: parameter cannot be NULL\",\n";...
2015 Oct 21
2
[PATCH 1/2] generator: add a FilenameList parameter type
...t; n
else
pr "const char *%s" n
- | StringList n | DeviceList n ->
+ | StringList n | DeviceList n | FilenameList n ->
next ();
pr "char *const *%s" n
| Bool n -> next (); pr "int %s" n
@@ -1252,7 +1252,8 @@ and generate_client_actions hash () =
| DeviceList n
| Key n
| Pointer (_, n)
- | GUID n ->
+ | GUID n
+ | FilenameList n ->
pr " if (%s == NULL) {\n" n;
pr " error (g, \"%%s: %%s: parameter cannot be NULL\",\n";
p...
2014 May 29
2
[PATCH] library: per-handle locking support
...TERNAL_ACTIONS_H_\n";
pr "\n";
+ pr "#include \"locking.h\"\n";
+ pr "\n";
+
List.iter (
fun { c_name = c_name; style = style } ->
generate_prototype ~single_line:true ~newline:true ~handle:"g"
@@ -1569,6 +1572,9 @@ and generate_client_actions hash () =
handle_null_optargs optargs c_name;
+ pr " guestfs___per_handle_lock_lock (g);\n";
+ pr "\n";
+
pr " int trace_flag = g->trace;\n";
pr " struct trace_buffer trace_buffer;\n";
(match ret with
@@ -1617,6 +1623,1...
2015 Sep 30
0
Re: [PATCH 1/4] lib: actions: Remove some unused header files.
...9 September 2015 22:06:10 Richard W.M. Jones wrote:
> ---
> generator/c.ml | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/generator/c.ml b/generator/c.ml
> index 055b683..963cf21 100644
> --- a/generator/c.ml
> +++ b/generator/c.ml
> @@ -1213,9 +1213,7 @@ and generate_client_actions hash () =
> #include <stdlib.h>
> #include <stdint.h>
> #include <inttypes.h>
> -#include <sys/types.h>
> #include <sys/stat.h>
> -#include <string.h>
See 78b27cc0b64a3e7b72602fc05102968b34fe529d about this.
At least memset is used all...
2009 Nov 18
1
[PATCH] generator: Fix API of functions that return RBufferOut
...uot;\n");
+ InitISOFS, Always, TestOutputBuffer (
+ [["pread"; "/empty"; "0"; "100"]], "")],
"read part of a file",
"\
This command lets you read part of a file. It reads C<count>
@@ -5107,7 +5109,7 @@ and generate_client_actions () =
#define error guestfs_error
//#define perrorf guestfs_perrorf
-//#define safe_malloc guestfs_safe_malloc
+#define safe_malloc guestfs_safe_malloc
#define safe_realloc guestfs_safe_realloc
//#define safe_strdup guestfs_safe_strdup
#define safe_memdup guestfs_safe_memdup
@@ -5396,8 +5...
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...me);
- pr "#define CLEANUP_FREE_%s_LIST\n" (String.uppercase name)
+ pr "#define CLEANUP_FREE_%s\n" (String.uppercase_ascii name);
+ pr "#define CLEANUP_FREE_%s_LIST\n" (String.uppercase_ascii name)
) structs;
pr "\
@@ -1409,7 +1411,7 @@ and generate_client_actions actions () =
function
| OString n ->
pr " if ((optargs->bitmask & GUESTFS_%s_%s_BITMASK) &&\n"
- (String.uppercase c_name) (String.uppercase n);
+ (String.uppercase_ascii c_name) (String.uppercase_ascii n);
p...
2009 Aug 18
8
src/ is now warning-free, too
These patches first make src/ warning free, and then
turn on the strict warning options.
75 0001-build-suppress-an-ignored-write-return-value-warning.patch
38 0002-build-suppress-an-ignored-dup-return-value-warning.patch
27 0003-generator.ml-suppress-signed-unsigned-compare-warnin.patch
48 0004-build-don-t-perform-arithmetic-on-void-pointers.patch
30
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
2015 Sep 29
8
[PATCH 1/4] lib: actions: Remove some unused header files.
---
generator/c.ml | 2 --
1 file changed, 2 deletions(-)
diff --git a/generator/c.ml b/generator/c.ml
index 055b683..963cf21 100644
--- a/generator/c.ml
+++ b/generator/c.ml
@@ -1213,9 +1213,7 @@ and generate_client_actions hash () =
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <string.h>
#include \"guestfs.h\"
#include \"guestfs-internal.h\"
--
2.5.0
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.
2016 Nov 08
0
[PATCH 2/3] Split internal stuff out of guestfs.h
...t;guestfs-internal-frontend.h\"
";
@@ -1213,6 +1247,7 @@ and generate_client_structs_print_c () =
#include \"c-ctype.h\"
#include \"guestfs.h\"
+#include \"guestfs-private.h\"
#include \"structs-print.h\"
";
@@ -1341,6 +1376,7 @@ and generate_client_actions actions () =
#include <string.h>
#include \"guestfs.h\"
+#include \"guestfs-private.h\"
#include \"guestfs-internal.h\"
#include \"guestfs-internal-actions.h\"
#include \"guestfs_protocol.h\"
diff --git a/generator/c.mli b/generator...
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...n
+ if List.exists (function String (Key, _) -> true | _ -> false) args then
pr "This function takes a key or passphrase parameter which
could contain sensitive material. Read the section
L</KEYS AND PASSPHRASES> for more information.\n\n";
@@ -1372,20 +1367,10 @@ and generate_client_actions actions () =
List.iter (
function
(* parameters which should not be NULL *)
- | String n
- | Device n
- | Mountable n
- | Pathname n
- | Dev_or_Path n | Mountable_or_Path n
- | FileIn n
- | FileOut n
+ | String (_, n)
| BufferIn...