Displaying 10 results from an estimated 10 matches for "guestfs_int_cmd_add_arg_format".
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
index 60e467fb6..fcc5855e0 100644
--- a/...
2020 Aug 12
2
[PATCH v2] appliance: extract UUID from QCOW2 disk image
...ul, 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 (cmd, "count=1");
+
+ r = guestfs_int_cmd_run (cmd);
+ if (r == -1) {
+ error (g, "Failed to...
2020 Aug 13
2
[PATCH v3] appliance: extract UUID from QCOW2 disk image
...ul, 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 (cmd, "count=1");
+
+ r = guestfs_int_cmd_run (cmd);
+ if (r == -1) {
+ error (g, "Failed to...
2018 Jan 12
1
Re: [PATCH v2] lib/info: Remove /dev/fd hacking and pass a true filename to qemu-img info.
...ose_files (cmd);
Don't we want this regardless?
> + if (filename[0] == '/')
> + guestfs_int_cmd_add_arg (cmd, filename);
> + else {
> + rel_filename = safe_asprintf (g, "./%s", filename);
> + guestfs_int_cmd_add_arg (cmd, rel_filename);
There's guestfs_int_cmd_add_arg_format, so that can be used to avoid
the temporary string.
Thanks,
--
Pino Toscano
2020 Aug 12
0
[PATCH] appliance: extract UUID from QCOW2 disk image
...ul, 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 (cmd, "count=1");
+
+ r = guestfs_int_cmd_run (cmd);
+ if (r == -1) {
+ error (g, "Failed to...
2020 Aug 13
0
Re: [PATCH v3] appliance: extract UUID from QCOW2 disk image
...+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 (cmd, "count=1");
> +
> + r = guestfs_int_cmd_run (cmd);
> + if (r == -1) {...
2020 Aug 12
0
Re: [PATCH] appliance: extract UUID from QCOW2 disk image
...*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 (cmd, "count=1");
> >+
> >+ r = guestfs_int_cmd_run (cmd);
>...
2020 Aug 12
0
Re: [PATCH] appliance: extract UUID from QCOW2 disk image
...r *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 (cmd, "count=1");
> >>+
> >>+ r = guestfs_in...
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).
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.