Displaying 20 results from an estimated 28 matches for "guestfs_int_cmd_add_string_unquoted".
2017 Sep 12
0
[PATCH v2 3/5] lib: qemu: Run QMP ‘query-commands’, ‘query-qmp-schema’ against the qemu binary.
...t qemu_data *data,
+ const char *qmp_command,
+ char **outp)
+{
+ CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
+ int r, fd;
+ CLEANUP_FCLOSE FILE *fp = NULL;
+ CLEANUP_FREE char *line = NULL;
+ size_t allocsize = 0;
+ ssize_t len;
+
+ guestfs_int_cmd_add_string_unquoted (cmd, "echo ");
+ /* QMP is modal. You have to send the qmp_capabilities command first. */
+ guestfs_int_cmd_add_string_unquoted (cmd, "'{ \"execute\": \"qmp_capabilities\" }' ");
+ guestfs_int_cmd_add_string_unquoted (cmd, "'{ \"exe...
2019 Mar 23
1
[PATCH] lib: direct: Set QEMU_AUDIO_DRV=none when testing schema.
...gi?id=1692047
---
lib/qemu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/qemu.c b/lib/qemu.c
index 10bb83105..2f3493217 100644
--- a/lib/qemu.c
+++ b/lib/qemu.c
@@ -566,6 +566,7 @@ generic_qmp_test (guestfs_h *g, struct qemu_data *data,
/* Exit QEMU after sending the commands. */
guestfs_int_cmd_add_string_unquoted (cmd, "'{ \"execute\": \"quit\" }' ");
guestfs_int_cmd_add_string_unquoted (cmd, " | ");
+ guestfs_int_cmd_add_string_unquoted (cmd, "QEMU_AUDIO_DRV=none ");
guestfs_int_cmd_add_string_quoted (cmd, g->hv);
guestfs_int_cmd_add_st...
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 19
0
[PATCH 6/6] lib: Use guestfs_int_make_temp_path in a few more places.
...n_cirros (guestfs_h *g, size_t *size_r)
return NOT_FOUND;
/* Use pbmtext to render it. */
- pngfile = safe_asprintf (g, "%s/cirros.png", g->tmpdir);
+ pngfile = guestfs_int_make_temp_path (g, "cirros", "png");
+ if (!pngfile)
+ return NOT_FOUND;
guestfs_int_cmd_add_string_unquoted (cmd, PBMTEXT " < ");
guestfs_int_cmd_add_string_quoted (cmd, local);
@@ -474,7 +476,9 @@ icon_windows_xp (guestfs_h *g, const char *systemroot, size_t *size_r)
if (filename_downloaded == NULL)
return NOT_FOUND;
- pngfile = safe_asprintf (g, "%s/windows-xp-icon.png...
2018 Sep 21
4
[PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...hen we can assume everyone is using qemu >= 2.11.
+ */
+static int
+qemu_img_supports_U_option (guestfs_h *g)
+{
+ if (g->qemu_img_supports_U_option >= 0)
+ return g->qemu_img_supports_U_option;
+
+ CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
+ int r;
+
+ guestfs_int_cmd_add_string_unquoted (cmd,
+ "qemu-img info --help | "
+ "grep -sq -- 'info.*-U'");
+ r = guestfs_int_cmd_run (cmd);
+ if (r == -1)
+ return -1;
+ if (!WIFEXITED (r)) {
+ guestfs_int_external_command_failed...
2017 Jul 14
0
[PATCH 12/27] daemon: Reimplement ‘file_architecture’ API in OCaml.
...-
- if (mkdtemp (dir) == NULL) {
- perrorf (g, "mkdtemp");
- goto out;
- }
-
- initrd = safe_asprintf (g, "%s/initrd", dir);
- if (guestfs_download (g, path, initrd) == -1)
- goto out;
-
- /* Construct a command to extract named binaries from the initrd file. */
- guestfs_int_cmd_add_string_unquoted (cmd, "cd ");
- guestfs_int_cmd_add_string_quoted (cmd, dir);
- guestfs_int_cmd_add_string_unquoted (cmd, " && ");
- guestfs_int_cmd_add_string_unquoted (cmd, method);
- guestfs_int_cmd_add_string_unquoted (cmd, " initrd | cpio --quiet -id");
- for (i =...
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.
2018 Oct 04
2
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...supports_U_option (guestfs_h *g)
> > +{
> > + if (g->qemu_img_supports_U_option >= 0)
> > + return g->qemu_img_supports_U_option;
> > +
> > + CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
> > + int r;
> > +
> > + guestfs_int_cmd_add_string_unquoted (cmd,
> > + "qemu-img info --help | "
> > + "grep -sq -- 'info.*-U'");
>
> This may match something else in future, in case some other command of
> qemu-img gets another opt...
2017 Oct 06
2
[PATCH] lib: Pick up qemu-img path at build time.
...dd_arg (cmd, "qemu-img");
+ * guestfs_int_cmd_add_arg (cmd, QEMU_IMG);
* guestfs_int_cmd_add_arg (cmd, "info");
* guestfs_int_cmd_add_arg (cmd, filename);
*
@@ -48,7 +48,7 @@
* shell commands, with the added safety of allowing args to be quoted
* properly).
*
- * guestfs_int_cmd_add_string_unquoted (cmd, "qemu-img info ");
+ * guestfs_int_cmd_add_string_unquoted (cmd, "file info ");
* guestfs_int_cmd_add_string_quoted (cmd, filename);
*
* =item 4.
diff --git a/lib/create.c b/lib/create.c
index fff5cf332..b4865172c 100644
--- a/lib/create.c
+++ b/lib/create.c
@@ -31...
2018 Oct 04
1
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...f (g->qemu_img_supports_U_option >= 0)
> > > > + return g->qemu_img_supports_U_option;
> > > > +
> > > > + CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
> > > > + int r;
> > > > +
> > > > + guestfs_int_cmd_add_string_unquoted (cmd,
> > > > + "qemu-img info --help | "
> > > > + "grep -sq -- 'info.*-U'");
> > >
> > > This may match something else in future, in case some other c...
2018 Sep 26
0
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...t; + */
> +static int
> +qemu_img_supports_U_option (guestfs_h *g)
> +{
> + if (g->qemu_img_supports_U_option >= 0)
> + return g->qemu_img_supports_U_option;
> +
> + CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
> + int r;
> +
> + guestfs_int_cmd_add_string_unquoted (cmd,
> + "qemu-img info --help | "
> + "grep -sq -- 'info.*-U'");
This may match something else in future, in case some other command of
qemu-img gets another option with "info"...
2018 Oct 02
0
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...t; + */
> +static int
> +qemu_img_supports_U_option (guestfs_h *g)
> +{
> + if (g->qemu_img_supports_U_option >= 0)
> + return g->qemu_img_supports_U_option;
> +
> + CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
> + int r;
> +
> + guestfs_int_cmd_add_string_unquoted (cmd,
> + "qemu-img info --help | "
> + "grep -sq -- 'info.*-U'");
> + r = guestfs_int_cmd_run (cmd);
> + if (r == -1)
> + return -1;
> + if (!WIFEXITED (r)) {
> + g...
2018 Oct 04
0
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...t; > +{
> > > + if (g->qemu_img_supports_U_option >= 0)
> > > + return g->qemu_img_supports_U_option;
> > > +
> > > + CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
> > > + int r;
> > > +
> > > + guestfs_int_cmd_add_string_unquoted (cmd,
> > > + "qemu-img info --help | "
> > > + "grep -sq -- 'info.*-U'");
> >
> > This may match something else in future, in case some other command of
> >...
2017 Sep 20
7
[PATCH v2] 0/6] Various clean ups in lib/
v1 -> v2:
- Remove the unnecessary calls to guestfs_int_lazy_make_tmpdir
in the final patch.
Rich.
2017 Sep 19
7
[PATCH 0/6] Various clean ups in lib/
Miscellaneous small cleanups in lib/ directory.
Rich.
2017 Jun 03
12
[PATCH v2 00/12] Allow APIs to be implemented in OCaml.
Version 1 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00003.html
This patch series reimplements a few more APIs in OCaml, including
some very important core APIs like ?list_filesystems? and ?mount?.
All the tests pass after this.
The selection of APIs that I have moved may look a little random, but
in fact they are all APIs consumed by the inspection code (and some
more
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.
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...MAX_WINDOWS_EXPLORER_SIZE);
+ "explorer.exe",
+ MAX_WINDOWS_EXPLORER_SIZE);
if (filename_downloaded == NULL)
return NOT_FOUND;
@@ -472,7 +472,7 @@ icon_windows_xp (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
guestfs_int_cmd_add_string_unquoted (cmd, WRESTOOL " -x --type=2 --name=143 ");
guestfs_int_cmd_add_string_quoted (cmd, filename_downloaded);
guestfs_int_cmd_add_string_unquoted (cmd,
- " | " BMPTOPNM " | " PNMTOPNG " > ");
+ " | &qu...
2017 Jun 05
19
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
v2 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00008.html
This series gets as far as a working (and faster) reimplementation of
‘guestfs_list_filesystems’.
I also have another patch series on top of this one which reimplements
the inspection APIs inside the daemon, but that needs a bit more work
still, since inspection turns out to be a very large piece of code.
Rich.