search for: generic_read_cache

Displaying 12 results from an estimated 12 matches for "generic_read_cache".

2017 Sep 12
2
Re: [PATCH v2 2/5] lib: qemu: Factor out common code for reading and writing cache files.
On Tuesday, 12 September 2017 14:29:13 CEST Richard W.M. Jones wrote: > +/** > + * Generic functions for reading and writing the cache files, used > + * where we are just reading and writing plain text strings. > + */ > +static int > +generic_read_cache (guestfs_h *g, const char *filename, char **strp) > +{ > + if (access (filename, R_OK) == -1 && errno == ENOENT) > + return 0; /* no cache, run the test instead */ This will go ahead if access() failed for any other error though; IMHO a better check could be:...
2017 Sep 12
0
[PATCH v2 2/5] lib: qemu: Factor out common code for reading and writing cache files.
...ar *filename); +static int write_cache_qemu_stat (guestfs_h *g, const struct qemu_data *data, const char *filename); static void parse_qemu_version (guestfs_h *g, const char *, struct version *qemu_version); static void read_all (guestfs_h *g, void *retv, const char *buf, size_t len); +static int generic_read_cache (guestfs_h *g, const char *filename, char **strp); +static int generic_write_cache (guestfs_h *g, const char *filename, const char *str); + +/* This structure abstracts the data we are reading from qemu and how + * we get it. + */ +static const struct qemu_fields { + const char *name; + /* Functi...
2017 Sep 12
0
[PATCH v2 3/5] lib: qemu: Run QMP ‘query-commands’, ‘query-qmp-schema’ against the qemu binary.
...nst struct qemu_data *data, const char *filename); static void parse_qemu_version (guestfs_h *g, const char *, struct version *qemu_version); +static void parse_json (guestfs_h *g, const char *, yajl_val *); static void read_all (guestfs_h *g, void *retv, const char *buf, size_t len); static int generic_read_cache (guestfs_h *g, const char *filename, char **strp); static int generic_write_cache (guestfs_h *g, const char *filename, const char *str); +static int generic_qmp_test (guestfs_h *g, struct qemu_data *data, const char *qmp_command, char **outp); /* This structure abstracts the data we are reading...
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.
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.
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.
2018 Sep 13
1
[PATCH] lib: direct: Query qemu binary for availability of KVM (RHBZ#1605071).
...parse_qemu_version (guestfs_h *g, const char *, struct version *qemu_version); static void parse_json (guestfs_h *g, const char *, json_t **); +static void parse_has_kvm (guestfs_h *g, const char *, bool *); static void read_all (guestfs_h *g, void *retv, const char *buf, size_t len); static int generic_read_cache (guestfs_h *g, const char *filename, char **strp); static int generic_write_cache (guestfs_h *g, const char *filename, const char *str); @@ -105,6 +124,8 @@ static const struct qemu_fields { test_qemu_devices, read_cache_qemu_devices, write_cache_qemu_devices }, { "qmp-schema",...
2017 Sep 12
0
Re: [PATCH v2 2/5] lib: qemu: Factor out common code for reading and writing cache files.
...cano wrote: > On Tuesday, 12 September 2017 14:29:13 CEST Richard W.M. Jones wrote: > > +/** > > + * Generic functions for reading and writing the cache files, used > > + * where we are just reading and writing plain text strings. > > + */ > > +static int > > +generic_read_cache (guestfs_h *g, const char *filename, char **strp) > > +{ > > + if (access (filename, R_OK) == -1 && errno == ENOENT) > > + return 0; /* no cache, run the test instead */ > > This will go ahead if access() failed for any other error though; >...
2018 Feb 12
0
[PATCH v2 1/1] Switch from YAJL to Jansson
...arse_qemu_version (guestfs_h *g, const char *, struct version *qemu_version); -static void parse_json (guestfs_h *g, const char *, yajl_val *); +static void parse_json (guestfs_h *g, const char *, json_t **); static void read_all (guestfs_h *g, void *retv, const char *buf, size_t len); static int generic_read_cache (guestfs_h *g, const char *filename, char **strp); static int generic_write_cache (guestfs_h *g, const char *filename, const char *str); @@ -405,17 +405,17 @@ parse_qemu_version (guestfs_h *g, const char *qemu_help, * is not possible. */ static void -parse_json (guestfs_h *g, const char *json...
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...arse_qemu_version (guestfs_h *g, const char *, struct version *qemu_version); -static void parse_json (guestfs_h *g, const char *, yajl_val *); +static void parse_json (guestfs_h *g, const char *, json_t **); static void read_all (guestfs_h *g, void *retv, const char *buf, size_t len); static int generic_read_cache (guestfs_h *g, const char *filename, char **strp); static int generic_write_cache (guestfs_h *g, const char *filename, const char *str); @@ -405,17 +405,17 @@ parse_qemu_version (guestfs_h *g, const char *qemu_help, * is not possible. */ static void -parse_json (guestfs_h *g, const char *json...
2018 Feb 12
2
[PATCH v2 0/1] RFC: switch from YAJL to Jansson
Hi, recently, there was a discussion in the development list of libvirt on switching to a different JSON library than YAJL [1]. Since we use YAJL, and the points there IMHO apply to libguestfs as well, I decided to give a try in switching to Jansson [2]. The result IMHO is nice, with the additional APIs of Jansson that simplify some of our code. Unlike with YAJL, I did not set a minimum
2017 Nov 23
4
[PATCH 0/1] RFC: switch from YAJL to Jansson
Hi, recently, there was a discussion in the development list of libvirt on switching to a different JSON library than YAJL [1]. Since we use YAJL, and the points there IMHO apply to libguestfs as well, I decided to give a try in switching to Jansson [2]. The result IMHO is nice, with the additional APIs of Jansson that simplify some of our code. Unlike with YAJL, I did not set a minimum