Displaying 18 results from an estimated 18 matches for "dir_contains_fil".
Did you mean:
dir_contains_file
2017 May 05
2
Re: [PATCH v2 1/2] appliance: search all types of appliances for each path separately
...Looks good. I'll push this if it passes 'make check && make check-valgrind'
> >which I'm currently running.
>
> Thanks.
>
>
> It is not connected with the current patch-set, but I noticed a
> possible bug in appliance.c:
>
> static int
> dir_contains_files (guestfs_h *g, const char *dir, ...)
> {
> va_list args;
> const char *file;
>
> va_start (args, dir);
> while ((file = va_arg (args, const char *)) != NULL) {
> if (!dir_contains_file (g, dir, file)) {
> ...
>
> static int
> contains_fixed_appliance...
2016 Mar 07
2
[PATCH v2] Use less stack.
...char *initrd_name = "initramfs." host_cpu ".img";
static int build_appliance (guestfs_h *g, char **kernel, char **initrd, char **appliance);
static int find_path (guestfs_h *g, int (*pred) (guestfs_h *g, const char *pelem, void *data), void *data, char **pelem);
-static int dir_contains_file (const char *dir, const char *file);
-static int dir_contains_files (const char *dir, ...);
+static int dir_contains_file (guestfs_h *g, const char *dir, const char *file);
+static int dir_contains_files (guestfs_h *g, const char *dir, ...);
static int contains_old_style_appliance (guestfs_h *g,...
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames.
Rich.
2017 Apr 28
0
Re: [PATCH] appliance: more reliable check for the supermin appliance
...dex f12918573..5738e4e7f 100644
> --- a/lib/appliance.c
> +++ b/lib/appliance.c
> @@ -199,7 +199,9 @@ contains_fixed_appliance (guestfs_h *g, const char *path, void *data)
> static int
> contains_supermin_appliance (guestfs_h *g, const char *path, void *data)
> {
> - return dir_contains_files (g, path, "supermin.d", NULL);
> + return dir_contains_files (g, path,
> + "supermin.d/base.tar.gz",
> + "supermin.d/packages", NULL);
> }
Thanks - I've pushed this.
Rich.
--
Richard Jones,...
2010 Jul 05
5
[PATCH 0/3] RFC: Allow use of external QEMU process with libguestfs
This attempts to implement the idea proposed in
https://www.redhat.com/archives/libguestfs/2010-April/msg00087.html
The idea is that an externally managed QEMU (manual, or via libvirt)
can boot the appliance kernel/initrd. libguestfs can then be just told
of the UNIX domain socket associated with the guest daemon.
An example based on guestfish.
1. Step one, find the appliance kernel/initrd
2016 Mar 07
0
Re: [PATCH v2] Use less stack.
...t;= NULL" here.
> diff --git a/src/appliance.c b/src/appliance.c
> index dbde35e..d7cc60b 100644
> --- a/src/appliance.c
> +++ b/src/appliance.c
> @@ -396,27 +386,24 @@ find_path (guestfs_h *g,
>
> /* Returns true iff file is contained in dir. */
> static int
> -dir_contains_file (const char *dir, const char *file)
> +dir_contains_file (guestfs_h *g, const char *dir, const char *file)
> {
> - size_t dirlen = strlen (dir);
> - size_t filelen = strlen (file);
> - size_t len = dirlen + filelen + 2;
> - char path[len];
> + CLEANUP_FREE char *path;
M...
2013 Sep 06
1
[PATCH] arm: appliance: Add support for device trees (dtb's).
This is the libguestfs companion patch to:
https://www.redhat.com/archives/libguestfs/2013-September/msg00045.html
Rich.
2017 May 05
0
Re: [PATCH v2 1/2] appliance: search all types of appliances for each path separately
...nstant leak), in part _because_ of the commonality of passing
NULL through varargs functions.
>>
>> In practice, this means that if NULL is defined as integer and we have
>> 64 bit architecture, then here as the last argument - 4 bytes are
>> written on the stack:
>> dir_contains_files (g, path,
>> "README.fixed", "kernel", "initrd", "root", NULL);
>>
>> But va_arg() will read 8 bytes:
>> while ((file = va_arg (args, const char *)) != NULL) {
>>
>> I don't know how real can be t...
2016 Feb 04
0
[PATCH] aarch64: Use a common table of AAVMF paths.
...ls-c.c | 27 +++++++++++++++++++++++++++
v2v/utils.ml | 7 +++----
5 files changed, 48 insertions(+), 25 deletions(-)
diff --git a/src/appliance.c b/src/appliance.c
index 1dbf9c7..dbde35e 100644
--- a/src/appliance.c
+++ b/src/appliance.c
@@ -443,32 +443,15 @@ dir_contains_files (const char *dir, ...)
*
* XXX See also v2v/utils.ml:find_uefi_firmware
*/
-#ifdef __aarch64__
-
-static const char *uefi_firmware[] = {
- "/usr/share/AAVMF/AAVMF_CODE.fd",
- "/usr/share/AAVMF/AAVMF_VARS.fd",
-
- "/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw&q...
2016 May 12
0
[PATCH 3/4] appliance: Move code for creating supermin appliance directory to tmpdirs.c.
...nternal.h | 1 +
src/tmpdirs.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 63 insertions(+), 33 deletions(-)
diff --git a/src/appliance.c b/src/appliance.c
index 2cf6374..d293c2b 100644
--- a/src/appliance.c
+++ b/src/appliance.c
@@ -48,7 +48,7 @@ static int dir_contains_files (guestfs_h *g, const char *dir, ...);
static int contains_old_style_appliance (guestfs_h *g, const char *path, void *data);
static int contains_fixed_appliance (guestfs_h *g, const char *path, void *data);
static int contains_supermin_appliance (guestfs_h *g, const char *path, void *data);
-st...
2015 Jan 21
0
[PATCH] aarch64: appliance: Use AAVMF (UEFI) if available for running the appliance.
...ppliance.c
+++ b/src/appliance.c
@@ -1,5 +1,5 @@
/* libguestfs
- * Copyright (C) 2010-2012 Red Hat Inc.
+ * Copyright (C) 2010-2014 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -459,3 +459,67 @@ dir_contains_files (const char *dir, ...)
va_end (args);
return 1;
}
+
+#ifdef __aarch64__
+
+#define AAVMF_DIR "/usr/share/AAVMF"
+
+/* Return the location of firmware needed to boot the appliance. This
+ * is aarch64 only currently, since that's the only architecture where
+ * UEFI is mandat...
2010 Sep 20
1
[PATCH] Fix error launching libguestfs when euid != uid
...);
+ }
+ }
+
+ int r;
+ if (waitpid(pid, &r, 0) == -1) {
+ error (g, _("error waiting for command: %s (%m)"), cmd);
+ return -1;
+ }
+
+ if (WEXITSTATUS (r) != 0) {
error (g, _("external command failed: %s"), cmd);
return -1;
}
@@ -463,3 +537,45 @@ dir_contains_files (const char *dir, ...)
va_end (args);
return 1;
}
+
+/* Launch may be called by a seteuid/setegid process (virt-v2v does this).
+ * Unfortunately, execve resets EGID/EUID to GID/UID. This means that files
+ * created by a subprocess will have the wrong ownership. To work round this,
+ * we...
2016 Aug 17
1
[PATCH] v2v: Use OVMF secure boot file (RHBZ#1367615).
This is only lightly tested. In particularly I only tested that the
non-secure-boot path still works. I didn't test it on RHEL 7.3 yet
because I haven't got enough free disk space for these giant source
*.ova files :-( Will try to give that a go later.
Rich.
2016 Aug 18
3
[PATCH v2 0/2] v2v: Use OVMF secure boot file (RHBZ#1367615).
First version was posted here:
https://www.redhat.com/archives/libguestfs/2016-August/thread.html#00100
This is semantically the same as the first version. However
I've split the patch up into two parts. In the first part,
I factor out the UEFI paths so now they are created by the
generator and written in the library and v2v/ directory directly,
instead of the complex business of having a C
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...(len == 0 || (len == 1 && *pelem == '.')) {
if (g->verbose)
- fprintf (stderr,
- "looking for supermin appliance in current directory\n");
+ fprintf (stderr,
+ "looking for supermin appliance in current directory\n");
if (dir_contains_files (".",
- supermin_name, supermin_hostfiles_name,
- "kmod.whitelist", NULL)) {
- if (build_supermin_appliance (g, ".", &kernel, &initrd) == -1)
- return -1;
- break;
+ supermin_name, supermin_hostfiles_name,
+...
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
2012 Oct 18
10
[PATCH 0/10] Add a mini-library for running external commands.
Inspired by libvirt's virCommand* internal mini-library, this adds
some internal APIs for running commands.
The first patch contains the new APIs. The subsequent patches change
various parts of the library over to use it.
Rich.
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.