search for: parse_qemu_version

Displaying 20 results from an estimated 28 matches for "parse_qemu_version".

2016 Mar 22
0
[PATCH v3 07/11] launch: direct: Don't run qemu -version.
.../* Output of qemu -help. */ - char *qemu_version; /* Output of qemu -version. */ char *qemu_devices; /* Output of qemu -device ? */ /* qemu version (0, 0 if unable to parse). */ @@ -931,22 +930,18 @@ print_qemu_command_line (guestfs_h *g, char **argv) static void parse_qemu_version (guestfs_h *g, struct backend_direct_data *data); static void read_all (guestfs_h *g, void *retv, const char *buf, size_t len); -/* Test qemu binary (or wrapper) runs, and do 'qemu -help' and - * 'qemu -version' so we know what options this qemu supports and - * the version. +/*...
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
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.
2017 Sep 12
0
[PATCH v2 2/5] lib: qemu: Factor out common code for reading and writing cache files.
...te_cache_qemu_devices (guestfs_h *g, const struct qemu_data *data, const char *filename); +static int read_cache_qemu_stat (guestfs_h *g, struct qemu_data *data, const char *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 cha...
2016 May 26
1
[PATCH] lib: qemu: use guestfs_int_version_from_x_y for qemu version parsing
...l.h" #include "guestfs_protocol.h" -COMPILE_REGEXP (re_major_minor, "(\\d+)\\.(\\d+)", 0) - struct qemu_data { char *qemu_help; /* Output of qemu -help. */ char *qemu_devices; /* Output of qemu -device ? */ @@ -265,29 +261,15 @@ static void parse_qemu_version (guestfs_h *g, const char *qemu_help, struct version *qemu_version) { - CLEANUP_FREE char *major_s = NULL, *minor_s = NULL; - int major_i, minor_i; - version_init_null (qemu_version); - if (!match2 (g, qemu_help, re_major_minor, &major_s, &minor_s)) { - parse_...
2017 Sep 12
0
[PATCH v2 3/5] lib: qemu: Run QMP ‘query-commands’, ‘query-qmp-schema’ against the qemu binary.
...rite_cache_qmp_schema (guestfs_h *g, const struct qemu_data *data, const char *filename); static int read_cache_qemu_stat (guestfs_h *g, struct qemu_data *data, const char *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 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...
2016 May 12
0
[PATCH 4/4] lib: qemu: Memoize qemu feature detection.
...ns(-) diff --git a/src/qemu.c b/src/qemu.c index feb8bd6..259a6fd 100644 --- a/src/qemu.c +++ b/src/qemu.c @@ -58,23 +58,163 @@ struct qemu_data { guestfs_int_qemu_supports_virtio_scsi */ }; +static int test_qemu (guestfs_h *g, struct qemu_data *data); static void parse_qemu_version (guestfs_h *g, struct qemu_data *data); static void read_all (guestfs_h *g, void *retv, const char *buf, size_t len); +/* This is saved in the qemu.stat file, so if we decide to change the + * test_qemu memoization format/data in future, we should increment + * this to discard any memoized data...
2016 May 18
2
[PATCH v2 0/2] lib: qemu: Memoize qemu feature detection.
v1 -> v2: - Rebase on top of Pino's version work. Two patches went upstream, these are the two remaining patches. Note the generation number is still inside the qemu.stat file. We could put it in the filename, I have no particular preference. Rich.
2013 Dec 09
1
[PATCH] launch: switch from -nographic to -display none
...one"); guestfs___cmd_add_arg (cmd2, "-version"); guestfs___cmd_set_stdout_callback (cmd2, read_all, &data->qemu_version, CMD_STDOUT_FLAG_WHOLE_BUFFER); @@ -938,7 +941,8 @@ test_qemu (guestfs_h *g, struct backend_direct_data *data) parse_qemu_version (g, data); guestfs___cmd_add_arg (cmd3, g->hv); - guestfs___cmd_add_arg (cmd3, "-nographic"); + guestfs___cmd_add_arg (cmd3, "-display"); + guestfs___cmd_add_arg (cmd3, "none"); guestfs___cmd_add_arg (cmd3, "-machine"); guestfs___cmd_add_arg...
2016 May 12
7
[PATCH 0/4] lib: qemu: Memoize qemu feature detection.
Doing qemu feature detection in the direct backend takes ~100ms because we need to run `qemu -help' and `qemu -devices ?', and each of those interacts with glibc's very slow link loader. Fixing the link loader is really hard. Instead memoize the output of those two commands. This patch series first separates all the code dealing with qemu into a separate module (src/qemu.c) and
2018 Sep 13
1
[PATCH] lib: direct: Query qemu binary for availability of KVM (RHBZ#1605071).
...write_cache_query_kvm (guestfs_h *g, const struct qemu_data *data, const char *filename); static int read_cache_qemu_stat (guestfs_h *g, struct qemu_data *data, const char *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 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...
2016 May 17
0
[PATCH 1/2] src: start unifying version handling
...safe as * long as qemu >= 1.5. */ - if (major > 1 || (major == 1 && minor >= 5)) + if (guestfs_int_version_is (&data->qemu_version, 1, 5, 0)) discard_mode = ",discard=unmap"; break; } @@ -1002,8 +999,7 @@ parse_qemu_version (guestfs_h *g, struct backend_direct_data *data) CLEANUP_FREE char *major_s = NULL, *minor_s = NULL; int major_i, minor_i; - data->qemu_version_major = 0; - data->qemu_version_minor = 0; + version_init_null (&data->qemu_version); if (!data->qemu_help) return; @@...
2016 May 25
4
[PATCH 0/4] qemu: Use sqlite to store qemu detection data.
Patches 1 & 2 were posted previously here: https://www.redhat.com/archives/libguestfs/2016-May/msg00134.html Patch 3 is a hack so I can test this using my own version of qemu (the `-L ?' stuff is not upstream). Patch 4 is where the real action takes place: Replace the caching of qemu features in blob-like files with a sqlite database. Probably the best way to approach this patch is to
2018 Feb 12
0
[PATCH v2 1/1] Switch from YAJL to Jansson
...+73,7 @@ static int write_cache_qmp_schema (guestfs_h *g, const struct qemu_data *data, c static int read_cache_qemu_stat (guestfs_h *g, struct qemu_data *data, const char *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 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_cach...
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...+73,7 @@ static int write_cache_qmp_schema (guestfs_h *g, const struct qemu_data *data, c static int read_cache_qemu_stat (guestfs_h *g, struct qemu_data *data, const char *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 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_cach...
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
2016 Mar 22
19
[PATCH v3 0/11] tests/qemu: Add program for tracing and analyzing boot times.
Lots of changes since v2, too much to remember or summarize. Please ignore patch 11/11, it's just for my testing. Rich.
2016 May 17
3
[PATCH 0/2] src: introduce an helper version struct
Hi, this adds an helper version struct, and uses it in the backends (for the libvirt and qemu versions) and inspection code. This also moves common code to that, so it is not repeated in many places. This should help with the small refactoring proposed with https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html Thanks, Pino Toscano (2): src: start unifying version handling