search for: guestfs_int_cmd_add_arg

Displaying 20 results from an estimated 46 matches for "guestfs_int_cmd_add_arg".

2016 Mar 22
0
[PATCH v3 07/11] launch: direct: Don't run qemu -version.
...); - data->qemu_version = NULL; free (data->qemu_devices); data->qemu_devices = NULL; @@ -960,34 +955,24 @@ test_qemu (guestfs_h *g, struct backend_direct_data *data) if (r == -1 || !WIFEXITED (r) || WEXITSTATUS (r) != 0) goto error; + parse_qemu_version (g, data); + guestfs_int_cmd_add_arg (cmd2, g->hv); guestfs_int_cmd_add_arg (cmd2, "-display"); guestfs_int_cmd_add_arg (cmd2, "none"); - guestfs_int_cmd_add_arg (cmd2, "-version"); - guestfs_int_cmd_set_stdout_callback (cmd2, read_all, &data->qemu_version, - CMD_STDOUT_FLAG_WH...
2017 Sep 12
0
[PATCH v2 2/5] lib: qemu: Factor out common code for reading and writing cache files.
...a *data) +test_qemu_help (guestfs_h *g, struct qemu_data *data) { - CLEANUP_CMD_CLOSE struct command *cmd1 = guestfs_int_new_command (g); - CLEANUP_CMD_CLOSE struct command *cmd2 = guestfs_int_new_command (g); + CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); int r; - guestfs_int_cmd_add_arg (cmd1, g->hv); - guestfs_int_cmd_add_arg (cmd1, "-display"); - guestfs_int_cmd_add_arg (cmd1, "none"); - guestfs_int_cmd_add_arg (cmd1, "-help"); - guestfs_int_cmd_set_stdout_callback (cmd1, read_all, &data->qemu_help, - CMD_STDOUT_FLAG_WHOLE_BU...
2018 Sep 12
1
[PATCH] lib: Use qemu-img info -U option to avoid locking error.
https://bugs.launchpad.net/qemu/+bug/1740364 --- lib/info.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/info.c b/lib/info.c index 442a9755b..86044855e 100644 --- a/lib/info.c +++ b/lib/info.c @@ -149,6 +149,7 @@ get_json_output (guestfs_h *g, const char *filename) guestfs_int_cmd_add_arg (cmd, QEMU_IMG); guestfs_int_cmd_add_arg (cmd, "info"); + guestfs_int_cmd_add_arg (cmd, "-U"); guestfs_int_cmd_add_arg (cmd, "--output"); guestfs_int_cmd_add_arg (cmd, "json"); if (filename[0] == '/') -- 2.19.0.rc0
2017 Oct 06
2
[PATCH] lib: Pick up qemu-img path at build time.
...has a +nonstandard name. + =item B<SUPERMIN> This environment variable can be set to choose an alternative diff --git a/lib/command.c b/lib/command.c index bfec76f19..3d8bc7dbf 100644 --- a/lib/command.c +++ b/lib/command.c @@ -35,7 +35,7 @@ * * I<Either> add arguments: * - * guestfs_int_cmd_add_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). * - * guestf...
2015 Oct 02
1
[PATCH 1/2] launch: direct: Use a single -machine [type, ]accel=... option.
..._supports (g, data, "-enable-kvm")) - ADD_CMDLINE ("-enable-kvm"); - } - if (g->smp > 1) { ADD_CMDLINE ("-smp"); ADD_CMDLINE_PRINTF ("%d", g->smp); @@ -997,12 +983,12 @@ test_qemu (guestfs_h *g, struct backend_direct_data *data) guestfs_int_cmd_add_arg (cmd3, g->hv); guestfs_int_cmd_add_arg (cmd3, "-display"); guestfs_int_cmd_add_arg (cmd3, "none"); -#ifdef MACHINE_TYPE - guestfs_int_cmd_add_arg (cmd3, "-M"); - guestfs_int_cmd_add_arg (cmd3, MACHINE_TYPE); -#endif guestfs_int_cmd_add_arg (cmd3, "-m...
2017 Dec 15
2
[PATCH v2] lib/info: Remove /dev/fd hacking and pass a true filename
v1 posted here: https://www.redhat.com/archives/libguestfs/2017-December/msg00050.html v2 fixes the tests by rewriting relative paths as ./filename (so that filenames like "file:foo" work).
2017 Dec 15
0
[PATCH v2] lib/info: Remove /dev/fd hacking and pass a true filename to qemu-img info.
...- close (fd); - return NULL; - } - if (S_ISDIR (statbuf.st_mode)) { - error (g, "disk info: %s is a directory", filename); - close (fd); - return NULL; - } - - snprintf (fdpath, sizeof fdpath, "/dev/fd/%d", fd); - guestfs_int_cmd_clear_close_files (cmd); guestfs_int_cmd_add_arg (cmd, "qemu-img"); guestfs_int_cmd_add_arg (cmd, "info"); guestfs_int_cmd_add_arg (cmd, "--output"); guestfs_int_cmd_add_arg (cmd, "json"); - guestfs_int_cmd_add_arg (cmd, fdpath); + if (filename[0] == '/') + guestfs_int_cmd_add_arg (cmd...
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 21
4
[PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...son_t_decref (void *ptr) #endif static json_t *get_json_output (guestfs_h *g, const char *filename); +static int qemu_img_supports_U_option (guestfs_h *g); static void set_child_rlimits (struct command *); char * @@ -149,6 +150,11 @@ get_json_output (guestfs_h *g, const char *filename) guestfs_int_cmd_add_arg (cmd, "qemu-img"); guestfs_int_cmd_add_arg (cmd, "info"); + switch (qemu_img_supports_U_option (g)) { + case -1: return NULL; + case 0: break; + default: guestfs_int_cmd_add_arg (cmd, "-U"); + } guestfs_int_cmd_add_arg (cmd, "--output"); guestf...
2020 Aug 12
2
[PATCH v2] appliance: extract UUID from QCOW2 disk image
...+ * the QCOW2 disk image with further L<file(1)> command. + * The function returns zero if successful, otherwise -1. + */ +static int +run_qemu_img_dd (guestfs_h *g, const char *in_file, char *out_file) +{ + CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); + int r; + + guestfs_int_cmd_add_arg (cmd, "qemu-img"); + guestfs_int_cmd_add_arg (cmd, "dd"); + guestfs_int_cmd_add_arg_format (cmd, "if=%s", in_file); + guestfs_int_cmd_add_arg_format (cmd, "of=%s", out_file); + guestfs_int_cmd_add_arg (cmd, "bs=256k"); + guestfs_int_cmd_add_arg...
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.
2016 May 17
2
[PATCH 0/2] Use -bios bios-fast.bin where supported.
NOTE: Not for upstream, yet. This depends on 3 non-upstream patches. - The qemu rework in libguestfs, which in turn depends on what Pino is up to. - Support for '-L ?' in qemu: https://lists.gnu.org/archive/html/qemu-devel/2016-05/threads.html#02596 - Support for bios-fast.bin in qemu: https://lists.gnu.org/archive/html/qemu-devel/2016-05/threads.html#02408 This commit
2020 Aug 13
2
[PATCH v3] appliance: extract UUID from QCOW2 disk image
...+ * the QCOW2 disk image with further L<file(1)> command. + * The function returns zero if successful, otherwise -1. + */ +static int +run_qemu_img_dd (guestfs_h *g, const char *in_file, char *out_file) +{ + CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); + int r; + + guestfs_int_cmd_add_arg (cmd, "qemu-img"); + guestfs_int_cmd_add_arg (cmd, "dd"); + guestfs_int_cmd_add_arg_format (cmd, "if=%s", in_file); + guestfs_int_cmd_add_arg_format (cmd, "of=%s", out_file); + guestfs_int_cmd_add_arg (cmd, "bs=256k"); + guestfs_int_cmd_add_arg...
2016 May 18
2
[PATCH v2 0/2] Use -bios bios-fast.bin where supported.
This commit uses -bios bios-fast.bin if available, which basically stops SeaBIOS from trying to do PCI probing during boot, which is a waste of time when using the -kernel option. v1 -> v2: - Rebase on top of Pino's work. This still has 3 dependencies: - The qemu memoization work (v2). - Support for '-L ?' in qemu:
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
2017 Dec 12
1
Re: failure to virt-sysprep (FC27?)
...- close (fd); - return NULL; - } - if (S_ISDIR (statbuf.st_mode)) { - error (g, "disk info: %s is a directory", filename); - close (fd); - return NULL; - } - - snprintf (fdpath, sizeof fdpath, "/dev/fd/%d", fd); - guestfs_int_cmd_clear_close_files (cmd); guestfs_int_cmd_add_arg (cmd, "qemu-img"); guestfs_int_cmd_add_arg (cmd, "info"); guestfs_int_cmd_add_arg (cmd, "--output"); guestfs_int_cmd_add_arg (cmd, "json"); - guestfs_int_cmd_add_arg (cmd, fdpath); + guestfs_int_cmd_add_arg (cmd, filename); guestfs_int_cmd_set_s...
2018 Oct 02
0
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...gt; static json_t *get_json_output (guestfs_h *g, const char *filename); > +static int qemu_img_supports_U_option (guestfs_h *g); > static void set_child_rlimits (struct command *); > > char * > @@ -149,6 +150,11 @@ get_json_output (guestfs_h *g, const char *filename) > > guestfs_int_cmd_add_arg (cmd, "qemu-img"); > guestfs_int_cmd_add_arg (cmd, "info"); > + switch (qemu_img_supports_U_option (g)) { > + case -1: return NULL; > + case 0: break; > + default: guestfs_int_cmd_add_arg (cmd, "-U"); > + } > guestfs_int_cmd_add_arg (cm...
2017 Sep 19
0
[PATCH 6/6] lib: Use guestfs_int_make_temp_path in a few more places.
...ace read-only as that triggers a different * path inside UEFI. */ - varst = safe_asprintf (g, "%s/vars.fd.%d", g->tmpdir, ++g->unique); + varst = guestfs_int_make_temp_path (g, "vars", "fd"); + if (!varst) + return -1; guestfs_int_cmd_add_arg (copycmd, "cp"); guestfs_int_cmd_add_arg (copycmd, varsfile); guestfs_int_cmd_add_arg (copycmd, varst); diff --git a/lib/command.c b/lib/command.c index bc469de59..7018c3ac0 100644 --- a/lib/command.c +++ b/lib/command.c @@ -815,8 +815,9 @@ guestfs_int_cmd_pipe_run (struct c...
2018 Aug 22
1
[PATCH] lib: create: avoid one extra string allocation
When creating the qemu-img command, use the guestfs_int_cmd_add_arg & guestfs_int_cmd_add_arg_format APIs to add the proper filename directly, without creating a string for it. This should cause no functional change. --- lib/create.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/create.c b/lib/create.c ind...