Displaying 11 results from an estimated 11 matches for "guestfs_abort_cb".
2009 Aug 31
1
two small patches to appease clang/llvm static analysis
...384.g5fc62
>From 97ef6a82ed32404b751a23b6658e0f9c7ab3298c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Mon, 31 Aug 2009 20:29:08 +0200
Subject: [PATCH libguestfs 2/2] maint: guestfs.c: avoid warning about possible NULL deref from llvm/clang
* src/guestfs.h (guestfs_abort_cb): Declare with attribute noreturn.
---
src/guestfs.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/guestfs.h b/src/guestfs.h
index f2e108b..6412a53 100644
--- a/src/guestfs.h
+++ b/src/guestfs.h
@@ -41,7 +41,7 @@ extern void guestfs_close (guestfs_h *g);
extern con...
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
2015 Jun 06
0
[PATCH 2/5] threads: Acquire and release the lock around each public guestfs_* API.
...o (guestfs_h *g)
{
- return g->last_errnum;
+ int r;
+
+ ACQUIRE_LOCK (g);
+ r = unlocked_last_errno (g);
+ RELEASE_LOCK (g);
+ return r;
}
static void
@@ -164,36 +186,64 @@ guestfs_int_perrorf (guestfs_h *g, const char *fs, ...)
void
guestfs_set_out_of_memory_handler (guestfs_h *g, guestfs_abort_cb cb)
{
+ ACQUIRE_LOCK (g);
g->abort_cb = cb;
+ RELEASE_LOCK (g);
+}
+
+static guestfs_abort_cb
+unlocked_get_out_of_memory_handler (guestfs_h *g)
+{
+ return g->abort_cb;
}
guestfs_abort_cb
guestfs_get_out_of_memory_handler (guestfs_h *g)
{
- return g->abort_cb;
+ guestfs_abo...
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
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 Jun 27
9
[PATCH v3 0/5] threads: Add support for thread-safe handle.
Previously posted in 2015:
v1: https://www.redhat.com/archives/libguestfs/2015-June/msg00048.html
v2: https://www.redhat.com/archives/libguestfs/2015-June/msg00118.html
I have rebased and tidied up the patches, fixing a few spelling
mistakes, but they are broadly the same as before. I also ran all the
tests, which pass.
As with the previous versions, this makes a change to the API, where
you
2011 Mar 10
1
[PATCH for discussion only] New event API (RHBZ#664558).
...r/generator_c.ml
+++ b/generator/generator_c.ml
@@ -28,6 +28,7 @@ open Generator_api_versions
open Generator_optgroups
open Generator_actions
open Generator_structs
+open Generator_events
(* Generate C API. *)
@@ -396,6 +397,39 @@ extern void guestfs_set_out_of_memory_handler (guestfs_h *g, guestfs_abort_cb);
extern guestfs_abort_cb guestfs_get_out_of_memory_handler (guestfs_h *g);
/* Events. */
+";
+
+ List.iter (
+ fun (name, bitmask) ->
+ pr "#define GUESTFS_EVENT_%-16s 0x%04x\n"
+ (String.uppercase name) bitmask
+ ) events;
+ pr "#define GUESTFS_EVENT_%...
2017 Jun 27
0
[PATCH v3 3/5] threads: Use thread-local storage for errors.
...*error_cb_stack;
+ gl_tls_key_t error_data;
+
+ /* Linked list of error_data structures allocated for this handle,
+ * plus a mutex to protect the linked list.
+ */
+ gl_lock_define (, error_data_list_lock);
+ struct error_data *error_data_list;
/* Out of memory error handler. */
guestfs_abort_cb abort_cb;
@@ -706,7 +699,7 @@ extern char *guestfs_int_safe_asprintf (guestfs_h *g, const char *fs, ...)
#define safe_asprintf guestfs_int_safe_asprintf
/* errors.c */
-extern void guestfs_int_init_error_handler (guestfs_h *g);
+extern void guestfs_int_free_error_data_list (guestfs_h...
2015 Jun 06
0
[PATCH 3/5] threads: Use thread-local storage for errors.
...*error_cb_stack;
+ gl_tls_key_t error_data;
+
+ /* Linked list of error_data structures allocated for this handle,
+ * plus a mutex to protect the linked list.
+ */
+ gl_lock_define (, error_data_list_lock);
+ struct error_data *error_data_list;
/* Out of memory error handler. */
guestfs_abort_cb abort_cb;
@@ -657,7 +652,7 @@ struct guestfs_progress;
extern int guestfs_int_get_backend_setting_bool (guestfs_h *g, const char *name);
/* errors.c */
-extern void guestfs_int_init_error_handler (guestfs_h *g);
+extern void guestfs_int_free_error_data_list (guestfs_h *g);
extern v...
2017 Jul 21
6
[PATCH v3 REPOST 0/5] threads: Add support for thread-safe handle.
Previously posted in 2015:
v1: https://www.redhat.com/archives/libguestfs/2015-June/msg00048.html
v2: https://www.redhat.com/archives/libguestfs/2015-June/msg00118.html
This series was posted about 4 weeks ago:
v3: https://www.redhat.com/archives/libguestfs/2017-June/msg00287.html
There is no change in this series except I rebased it against current
upstream head and retested. Last time there
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...ppercase n);
+ pr " GUESTFS_%s_%s, " (String.uppercase_ascii c_name)
+ (String.uppercase_ascii n);
match argt with
| OBool n -> pr "int %s,\n" n
| OInt n -> pr "int %s,\n" n
@@ -508,7 +510,7 @@ extern GUESTFS_DLL_PUBLIC guestfs_abort_cb guestfs_get_out_of_memory_handler (gu
List.iter (
fun (name, bitmask) ->
pr "#define GUESTFS_EVENT_%-16s 0x%04x\n"
- (String.uppercase name) bitmask
+ (String.uppercase_ascii name) bitmask
) events;
pr "#define GUESTFS_EVENT_%-16s 0x%04x\n"...