Displaying 20 results from an estimated 55 matches for "guestfs_int_new_command".
2020 Aug 12
2
[PATCH v2] appliance: extract UUID from QCOW2 disk image
...7 @@ read_uuid (guestfs_h *g, void *retv, const char *line, size_t len)
* The L<file(1)> command does the hard work.
*/
static char *
-get_root_uuid (guestfs_h *g, const char *appliance)
+do_get_root_uuid (guestfs_h *g, const char *appliance)
{
CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
char *ret = NULL;
@@ -96,6 +96,74 @@ get_root_uuid (guestfs_h *g, const char *appliance)
}
/**
+ * Read the first 256k bytes of the in_file with L<qemu-img(1)> command
+ * and write them into the out_file. That may be useful to get UUID of
+ * the QCOW2 disk image with further L&l...
2016 Mar 22
0
[PATCH v3 07/11] launch: direct: Don't run qemu -version.
...this qemu supports and
- * the version.
+/* Test qemu binary (or wrapper) runs, and do 'qemu -help' so we know
+ * the version of qemu what options this qemu supports.
*/
static int
test_qemu (guestfs_h *g, struct backend_direct_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 *cmd3 = guestfs_int_new_command (g);
int r;
free (data->qemu_help);
data->qemu_help = NULL;
- free (data->qemu_version);
- data->qemu_version = NULL;
free (d...
2020 Aug 13
2
[PATCH v3] appliance: extract UUID from QCOW2 disk image
...ad_uuid (guestfs_h *g, void *retv, const char *line, size_t len)
* The L<file(1)> command does the hard work.
*/
static char *
-get_root_uuid (guestfs_h *g, const char *appliance)
+get_root_uuid_with_file (guestfs_h *g, const char *appliance)
{
CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
char *ret = NULL;
@@ -96,6 +96,72 @@ get_root_uuid (guestfs_h *g, const char *appliance)
}
/**
+ * Read the first 256k bytes of the in_file with L<qemu-img(1)> command
+ * and write them into the out_file. That may be useful to get UUID of
+ * the QCOW2 disk image with further L&l...
2018 Sep 21
4
[PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...in qemu 2.11. We can remove this test
+ * when 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 (!WI...
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 12
0
[PATCH] appliance: extract UUID from QCOW2 disk image
...7 @@ read_uuid (guestfs_h *g, void *retv, const char *line, size_t len)
* The L<file(1)> command does the hard work.
*/
static char *
-get_root_uuid (guestfs_h *g, const char *appliance)
+do_get_root_uuid (guestfs_h *g, const char *appliance)
{
CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
char *ret = NULL;
@@ -96,6 +96,74 @@ get_root_uuid (guestfs_h *g, const char *appliance)
}
/**
+ * Read the first 256k bytes of the in_file with L<qemu-img(1)> command
+ * and write them into the out_file. That may be useful to get UUID of
+ * the QCOW2 disk image with further L&l...
2017 Sep 12
0
[PATCH v2 2/5] lib: qemu: Factor out common code for reading and writing cache files.
...ata->qemu_help, &data->qemu_version);
return data;
+
+ error:
+ guestfs_int_free_qemu_data (data);
+ return NULL;
}
static int
-test_qemu (guestfs_h *g, struct qemu_data *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, &...
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:
2020 Aug 13
0
Re: [PATCH v3] appliance: extract UUID from QCOW2 disk image
...const char *line, size_t len)
> * The L<file(1)> command does the hard work.
> */
> static char *
> -get_root_uuid (guestfs_h *g, const char *appliance)
> +get_root_uuid_with_file (guestfs_h *g, const char *appliance)
> {
> CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
> char *ret = NULL;
> @@ -96,6 +96,72 @@ get_root_uuid (guestfs_h *g, const char *appliance)
> }
>
> /**
> + * Read the first 256k bytes of the in_file with L<qemu-img(1)> command
> + * and write them into the out_file. That may be useful to get UUID of
> +...
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.
2020 Aug 12
0
Re: [PATCH] appliance: extract UUID from QCOW2 disk image
...en)
> > * The L<file(1)> command does the hard work.
> > */
> > static char *
> >-get_root_uuid (guestfs_h *g, const char *appliance)
> >+do_get_root_uuid (guestfs_h *g, const char *appliance)
> > {
> > CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
> > char *ret = NULL;
> >@@ -96,6 +96,74 @@ get_root_uuid (guestfs_h *g, const char *appliance)
> > }
> > /**
> >+ * Read the first 256k bytes of the in_file with L<qemu-img(1)> command
> >+ * and write them into the out_file. That may be useful t...
2020 Aug 12
0
Re: [PATCH] appliance: extract UUID from QCOW2 disk image
...lt;file(1)> command does the hard work.
> >> */
> >> static char *
> >>-get_root_uuid (guestfs_h *g, const char *appliance)
> >>+do_get_root_uuid (guestfs_h *g, const char *appliance)
> >> {
> >> CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
> >> char *ret = NULL;
> >>@@ -96,6 +96,74 @@ get_root_uuid (guestfs_h *g, const char *appliance)
> >> }
> >> /**
> >>+ * Read the first 256k bytes of the in_file with L<qemu-img(1)> command
> >>+ * and write them into the out_fi...
2018 Oct 04
2
Re: [PATCH v2] lib: Use qemu-img info -U option to avoid locking error.
...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'");
>
> This may match...
2018 Aug 22
1
[PATCH] lib: create: avoid one extra string allocation
..._argv *optargs)
{
- CLEANUP_FREE char *filename = NULL;
const char *backingformat = NULL;
const char *preallocation = NULL;
const char *compat = NULL;
@@ -263,16 +262,6 @@ disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size,
CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g);
int r;
- /* If the filename is something like "file:foo" then qemu-img will
- * try to interpret that as "foo" in the file:/// protocol. To
- * avoid that, if the path is relative prefix it with "./" since
- * qemu-img won't try to interpret such...
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 12
0
[PATCH 4/4] lib: qemu: Memoize qemu feature detection.
...t) statbuf.st_size,
+ (uint64_t) statbuf.st_mtime,
+ g->hv) == -1)
+ goto stat_error;
+ if (fclose (fp) == -1)
+ goto stat_error;
+
+ return data;
+}
+
+static int
+test_qemu (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);
int r;
- struct qemu_data *data;
-
- data = safe_calloc (g, 1, sizeof *data);
guestfs_int_cmd_add_arg (cmd1, g->hv);
guestfs_int_cmd_add_arg (cmd1, "-display");
@@ -107,16 +247,14 @@ guestfs_int_...
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.
2023 Jul 11
1
[libguestfs PATCH] lib: remove guestfs_int_cmd_clear_close_files()
.../* When using the pipe_* APIs, stderr is pointed to a temporary file. */
char *error_file;
- /* Close file descriptors (defaults to true). */
- bool close_files;
-
/* Supply a callback to receive stdout. */
cmd_stdout_callback stdout_callback;
void *stdout_data;
@@ -186,7 +183,6 @@ guestfs_int_new_command (guestfs_h *g)
cmd = safe_calloc (g, 1, sizeof *cmd);
cmd->g = g;
cmd->capture_errors = true;
- cmd->close_files = true;
cmd->errorfd = -1;
cmd->outfd = -1;
return cmd;
@@ -358,17 +354,6 @@ guestfs_int_cmd_clear_capture_errors (struct command *cmd)
cmd->captu...
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