search for: guestfs_h

Displaying 20 results from an estimated 1007 matches for "guestfs_h".

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.
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 Sep 11
4
[PATCH 0/4] lib: qemu: Add test for mandatory locking.
The patch I posted last week to disable mandatory locking for readonly drives (https://www.redhat.com/archives/libguestfs/2017-September/msg00013.html) was wrong in a couple of respects. Firstly it didn't work, which I didn't detect because my tests were testing the wrong thing. Oops. Secondly it used a simple version number check to detect qemu binaries implementing mandatory locking.
2018 Sep 13
1
[PATCH] lib: direct: Query qemu binary for availability of KVM (RHBZ#1605071).
...+++++++++++++++++++++++- 3 files changed, 105 insertions(+), 30 deletions(-) diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h index 841fd515b..f5eed82a1 100644 --- a/lib/guestfs-internal.h +++ b/lib/guestfs-internal.h @@ -777,6 +777,7 @@ extern struct version guestfs_int_qemu_version (guestfs_h *g, struct qemu_data * extern int guestfs_int_qemu_supports (guestfs_h *g, const struct qemu_data *, const char *option); extern int guestfs_int_qemu_supports_device (guestfs_h *g, const struct qemu_data *, const char *device_name); extern int guestfs_int_qemu_mandatory_locking (guestfs_h *g, co...
2017 Sep 12
8
[PATCH v3 0/6] launch: direct: Disable qemu locking when opening drives readonly.
v2 -> v3: - I addressed everything that Pino mentioned last time. - It's tricky to get a stable run when multiple copies of qemu are involved, because the same cache files get overwritten by parallel libguestfs. So I changed the names of the cache files to include the qemu binary key (size, mtime), which removes this conflict. This is in new patch 4/6. Rich.
2017 Sep 12
9
[PATCH v2 0/5] launch: direct: Disable qemu locking when opening drives readonly (RHBZ#1417306)
Patches 1-4 are almost the same as they are when previously posted here: https://www.redhat.com/archives/libguestfs/2017-September/msg00039.html Patch 5 actually uses the mandatory locking test to turn off locking in the narrow case where a drive is opened readonly, and then only for the drive being inspected. Passes ordinary tests (‘check-direct’ and ‘check-valgrind-direct’). Rich.
2015 Jun 06
0
[PATCH 2/5] threads: Acquire and release the lock around each public guestfs_* API.
...turn ret_v;\n"; pr "}\n\n" in diff --git a/src/errors.c b/src/errors.c index 2d3ae84..d9959b2 100644 --- a/src/errors.c +++ b/src/errors.c @@ -29,16 +29,38 @@ #include "guestfs.h" #include "guestfs-internal.h" +static const char * +unlocked_last_error (guestfs_h *g) +{ + return g->last_error; +} + const char * guestfs_last_error (guestfs_h *g) { - return g->last_error; + const char *r; + + ACQUIRE_LOCK (g); + r = unlocked_last_error (g); + RELEASE_LOCK (g); + return r; +} + +static int +unlocked_last_errno (guestfs_h *g) +{ + return g->...
2016 Dec 11
3
[PATCH 0/2] generic function for temporary path generation
Cosmetic change as suggested in this previous patch: https://www.redhat.com/archives/libguestfs/2016-November/msg00111.html Matteo Cafasso (2): lib: generic function for temporary path generation lib: use guestfs_int_make_temp_path to generate temporary files src/drives.c | 5 ++--- src/file.c | 22 +++++++++------------- src/guestfs-internal.h | 1 + src/journal.c
2014 Mar 10
5
[PATCH 0/3] Add discard support.
These patches contain the beginnings of discard (a.k.a. trim or unmap) support. This will allow us to change virt-sparsify to work on disk images in-place (instead of using slow & inefficient copying). The approach used is to add an optional 'discard' parameter to add-drive. It has 3 possible settings: - 'disable' : the default, no discard is done - 'besteffort' :
2017 Feb 10
0
[PATCH v3 04/10] lib/osinfo.c: Extract xml processing into a callback
...assert.h> #include <sys/types.h> #include <libintl.h> @@ -71,10 +73,41 @@ gl_lock_define_initialized (static, osinfo_db_lock); static ssize_t osinfo_db_size = 0; /* 0 = unread, -1 = error, >= 1 = #records */ static struct osinfo *osinfo_db = NULL; -static int read_osinfo_db (guestfs_h *g); +#define XMLSTREQ(a,b) (xmlStrEqual((a),(b)) == 1) +typedef int (*read_osinfo_db_callback) (guestfs_h *g, const char *path, void *opaque); + +static int +read_osinfo_db (guestfs_h *g, + read_osinfo_db_callback callback, void *opaque); +static int read_osinfo_db_xml (guestfs_h *g...
2016 Feb 02
6
[PATCH 1/3] launch: add internal helper for socket paths creation
...c | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 5ecd322..bff9f64 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -782,6 +782,7 @@ extern void guestfs_int_launch_send_progress (guestfs_h *g, int perdozen); extern char *guestfs_int_appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags); #define APPLIANCE_COMMAND_LINE_IS_TCG 1 const char *guestfs_int_get_cpu_model (int kvm); +int guestfs_int_create_socketname (guestfs_h *g, const char *filename, char (*socknam...
2017 Mar 07
0
[PATCH v4 1/9] lib/osinfo.c: Extract xml processing into a callback
...assert.h> #include <sys/types.h> #include <libintl.h> @@ -71,10 +72,14 @@ gl_lock_define_initialized (static, osinfo_db_lock); static ssize_t osinfo_db_size = 0; /* 0 = unread, -1 = error, >= 1 = #records */ static struct osinfo *osinfo_db = NULL; -static int read_osinfo_db (guestfs_h *g); -static void free_osinfo_db_entry (struct osinfo *); - #define XMLSTREQ(a,b) (xmlStrEqual((a),(b)) == 1) +typedef int (*read_osinfo_db_callback) (guestfs_h *g, const char *path, void *opaque); + +static int +read_osinfo_db (guestfs_h *g, + read_osinfo_db_callback callback, void...
2017 Mar 23
0
[PATCH v5 01/10] lib/osinfo.c: Extract xml processing into a callback
...assert.h> #include <sys/types.h> #include <libintl.h> @@ -71,10 +72,11 @@ gl_lock_define_initialized (static, osinfo_db_lock); static ssize_t osinfo_db_size = 0; /* 0 = unread, -1 = error, >= 1 = #records */ static struct osinfo *osinfo_db = NULL; -static int read_osinfo_db (guestfs_h *g); -static void free_osinfo_db_entry (struct osinfo *); - #define XMLSTREQ(a,b) (xmlStrEqual((a),(b)) == 1) +typedef int (*read_osinfo_db_callback) (guestfs_h *g, const char *path, void *opaque); + +static int read_osinfo_db (guestfs_h *g, read_osinfo_db_callback callback, void *opaque); +static...
2017 Apr 12
0
[PATCH v6 01/10] lib/osinfo.c: Extract xml processing into a callback
...assert.h> #include <sys/types.h> #include <libintl.h> @@ -71,10 +72,11 @@ gl_lock_define_initialized (static, osinfo_db_lock); static ssize_t osinfo_db_size = 0; /* 0 = unread, -1 = error, >= 1 = #records */ static struct osinfo *osinfo_db = NULL; -static int read_osinfo_db (guestfs_h *g); -static void free_osinfo_db_entry (struct osinfo *); - #define XMLSTREQ(a,b) (xmlStrEqual((a),(b)) == 1) +typedef int (*read_osinfo_db_callback) (guestfs_h *g, const char *path, void *opaque); + +static int read_osinfo_db (guestfs_h *g, read_osinfo_db_callback callback, void *opaque); +static...
2017 Sep 12
0
[PATCH v2 3/5] lib: qemu: Run QMP ‘query-commands’, ‘query-qmp-schema’ against the qemu binary.
...ing fields are derived from the fields above. */ struct version qemu_version; /* Parsed qemu version number. */ + yajl_val qmp_commands_tree; /* qmp_commands parsed into a JSON tree */ + yajl_val qmp_schema_tree; /* qmp_schema parsed into a JSON tree */ }; static int test_qemu_help (guestfs_h *g, struct qemu_data *data); @@ -61,12 +67,20 @@ static int write_cache_qemu_help (guestfs_h *g, const struct qemu_data *data, co static int test_qemu_devices (guestfs_h *g, struct qemu_data *data); static int read_cache_qemu_devices (guestfs_h *g, struct qemu_data *data, const char *filename);...
2013 Feb 28
7
[PATCH 0/7] Fix SELinux security contexts so we can access shared disks (RHBZ#912499).
https://bugzilla.redhat.com/show_bug.cgi?id=912499 (especially comments 7 & 10) This patch set is the final fix so that we can access disks in use by other guests when SELinux and sVirt are enabled. Previously such disks were inaccessible because sVirt labels the disks with a random SELinux label to prevent other instances of qemu from being able to read them. So naturally the libguestfs
2013 Jan 25
4
[PATCH 0/3] Use __attribute__((cleanup(...)))
This patch series changes a small part of the library to use __attribute__((cleanup(...))) to automatically free memory when pointers go out of the current scope. In general terms this seems to be a small win although you do have to use it carefully. For functions where you can completely get rid of the "exit code paths", it can simplify things. For a good example, see the
2014 Dec 09
0
[PATCH] inspection: Not an installer if there are multiple partitions (RHBZ#1171666).
...pect.c | 22 ++++++++++++++++++++++ 4 files changed, 65 insertions(+), 33 deletions(-) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 0a4a6f2..0b25407 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -766,6 +766,7 @@ extern int guestfs___set_backend (guestfs_h *g, const char *method); extern void guestfs___free_inspect_info (guestfs_h *g); extern char *guestfs___download_to_tmp (guestfs_h *g, struct inspect_fs *fs, const char *filename, const char *basename, uint64_t max_size); extern struct inspect_fs *guestfs___search_for_root (guestfs_h *g, const c...
2016 Feb 03
4
[PATCH v2 1/2] launch: add internal helper for socket paths creation
...| 17 +++++++++++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 5ecd322..bff9f64 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -782,6 +782,7 @@ extern void guestfs_int_launch_send_progress (guestfs_h *g, int perdozen); extern char *guestfs_int_appliance_command_line (guestfs_h *g, const char *appliance_dev, int flags); #define APPLIANCE_COMMAND_LINE_IS_TCG 1 const char *guestfs_int_get_cpu_model (int kvm); +int guestfs_int_create_socketname (guestfs_h *g, const char *filename, char (*socknam...
2016 Jan 29
7
[PATCH 1/6] launch: unix: check for length of sockets
...t into sockaddr_un::sun_path, as we will not be able to connect to it. --- src/launch-unix.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/launch-unix.c b/src/launch-unix.c index 740c554..973e14b 100644 --- a/src/launch-unix.c +++ b/src/launch-unix.c @@ -47,6 +47,12 @@ launch_unix (guestfs_h *g, void *datav, const char *sockpath) return -1; } + if (strlen (sockpath) > UNIX_PATH_MAX-1) { + error (g, _("socket filename too long (more than %d characters): %s"), + UNIX_PATH_MAX-1, sockpath); + return -1; + } + if (g->verbose) guestfs_int_...