Displaying 20 results from an estimated 32 matches for "abort_cb".
2011 Nov 24
2
[PATCH] NFC: Cleanup iteration over fstab entries in inspect_fs_unix.c
...augpath, "%s/file", lines[i]);
- char *mp = guestfs_aug_get (g, augpath);
- if (mp == NULL) {
- free (spec);
- goto error;
- }
+ for (char **entry = entries; *entry != NULL; entry++) {
+ if (asprintf (&augpath, "%s/spec", *entry) == -1) g->abort_cb();
+ char *spec = guestfs_aug_get (g, augpath);
+ if (spec == NULL) goto error;
- int r = add_fstab_entry (g, fs, spec, mp, md_map);
+ if (asprintf (&augpath, "%s/file", *entry) == -1) g->abort_cb();
+ char *mp = guestfs_aug_get (g, augpath);
+ if (mp == NULL)...
2012 Sep 20
1
[PATCH] rename local variable to avoid clash with match macro
...le.de>
diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
index 06ff96d..c30ad5a 100644
--- a/src/inspect-fs-unix.c
+++ b/src/inspect-fs-unix.c
@@ -1128,14 +1128,14 @@ map_md_devices(guestfs_h *g, Hash_table **map)
mdadm_app_free);
if (!*map) g->abort_cb();
- for (char **match = matches; *match != NULL; match++) {
+ for (char **_match = matches; *_match != NULL; _match++) {
/* Get device name and uuid for each array */
- char *dev_path = safe_asprintf(g, "%s/devicename", *match);
+ char *dev_path = safe_asprintf(g, "%s...
2015 Jun 06
0
[PATCH 2/5] threads: Acquire and release the lock around each public guestfs_* API.
...fs_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...
2011 Dec 01
2
[PATCH 0/2] handle MD devices in fstab
Only change from previous post is explicitly checking md_map for NULL before
hash_free and lookup.
2011 Nov 25
2
[PATCH 0/2] MD device inspection
These patches are rebased on top of current master. In addition, I've made the
following changes:
* Fixed whitespace error.
* Functions return -1 on error.
* Added a debug message when guest contains md devices, but nothing was parsed
from mdadm.conf.
2009 Aug 31
1
two small patches to appease clang/llvm static analysis
...uestfs through llvm+clang, today,
[http://clang.llvm.org/StaticAnalysis.html]
It found only two things worth changing -- neither is a real problems.
Adding the noreturn makes it so the tool understands line 541 of
guestfs.c is truly reachable only for non-NULL "p":
540 if (!p) g->abort_cb ();
541 memcpy (p, ptr, size);
>From 41f8b506924243d4fd7570913fbbbd9f8040e11f Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Mon, 31 Aug 2009 19:51:46 +0200
Subject: [PATCH libguestfs 1/2] maint: guestfs.c: remove unnecessary initialization
* src/guestfs.c...
2011 Dec 02
3
[PATCH 1/3] build: Add more suppressions for valgrind tests
---
extratests/suppressions | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/extratests/suppressions b/extratests/suppressions
index 97d4b78..78ca4ab 100644
--- a/extratests/suppressions
+++ b/extratests/suppressions
@@ -3,19 +3,19 @@
Memcheck:Cond
fun:*
fun:numa_node_size64
- fun:numa_init
+ obj:/usr/lib64/libnuma.so.1
}
{
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
2011 Nov 23
8
[PATCH 0/8] Add MD inspection support to libguestfs
...files in inspect_with_augeas
[PATCH 7/8] inspection: Handle MD devices in fstab
* Split out the NFCs
* Changed warning() to debug() in all cases
* Following the pattern of other code, I have:
* Not called error() when failure is due to the error return of a guestfs api
* Explicitly called g->abort_cb() for malloc failures, consistent with the safe_ functions
There are no other failure paths in the code.
[PATCH 8/8] inspection: Add a test for MD device mapping in fstab
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
0
[PATCH v3 3/5] threads: Use thread-local storage for errors.
...r_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.
...r_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 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
2016 Dec 18
3
[PATCH 1/2] launch: Rationalize how we construct the Linux kernel command line.
This is just code refactoring.
---
src/launch.c | 172 +++++++++++++++++++++++++++++++++++++----------------------
1 file changed, 109 insertions(+), 63 deletions(-)
diff --git a/src/launch.c b/src/launch.c
index 46d7ab9..84d5e82 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -293,9 +293,7 @@ guestfs_impl_config (guestfs_h *g,
#endif
#if defined(__aarch64__)
-#define EARLYPRINTK "
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
..."uuid for %s: %s", *md, *i);
+ "uuid for %s: %s", *md, *i);
md_uuid_free(entry);
continue;
}
const void *matched = NULL;
switch (hash_insert_if_absent(*map, entry, &matched)) {
- case -1:
- g->abort_cb();
+ case -1:
+ g->abort_cb();
- case 0:
- /* Duplicate uuid in for md device is weird, but not fatal. */
- debug(g, "inspect-os: md devices %s and %s have the same uuid",
- ((md_uuid *)matched)->path, entry->path);
- md_uui...
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
2010 Aug 31
13
[PATCH v2] Add progress bars
This is an updated and extended version of the original patch:
https://www.redhat.com/archives/libguestfs/2010-August/msg00163.html
This adds OCaml and Perl bindings (both tested), support for
progress bars in virt-resize, and adds progress notifications
to a number of the simpler commands.
Still to do is to add progress messages to more commands. There
are still a few commands which would be
2015 Oct 05
3
[PATCH 1/2] Change 'fprintf (stdout,...)' -> printf.
Result of earlier copy and paste.
---
align/scan.c | 35 ++++++++++---------
cat/cat.c | 39 +++++++++++----------
cat/filesystems.c | 69 +++++++++++++++++++-------------------
cat/log.c | 35 ++++++++++---------
cat/ls.c | 61 +++++++++++++++++----------------
df/main.c | 43 ++++++++++++------------
diff/diff.c | 67
2013 Mar 07
4
[PATCH 0/4] Small refactorings of the protocol layer.
As the start of work to add remote support, I'm taking a close look at
the protocol layer in the library. These are some small cleanups.
Rich.
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers.
These aren't valid for global names in C++.
(http://stackoverflow.com/a/228797)
These large but completely mechanical patches change the illegal
identifiers to legal ones.
Rich.