search for: extend_fses

Displaying 20 results from an estimated 27 matches for "extend_fses".

2015 Jun 04
3
[PATCH] Use safe_realloc() in favor of realloc overall.
...rc/inspect-fs.c @@ -47,7 +47,7 @@ COMPILE_REGEXP (re_major_minor, "(\\d+)\\.(\\d+)", 0) static int check_filesystem (guestfs_h *g, const char *mountable, const struct guestfs_internal_mountable *m, int whole_device); -static int extend_fses (guestfs_h *g); +static void extend_fses (guestfs_h *g); static int get_partition_context (guestfs_h *g, const char *partition, int *partnum_ret, int *nr_partitions_ret); /* Find out if 'device' contains a filesystem. If it does, add @@ -75,8 +75,7 @@ guestfs_int_check_for_filesystem_o...
2015 Jun 02
2
Re: [PATCH 2/3] inspection: Add support for CoreOS
...pections() >> * collect_coreos_inspection_info() >> to be returning a value at all. So, I'll remove the if check completely. >> >> Nikos >> >> P.S. You have a check like this one on >> guestfs_int_check_for_filesystem_on() a few lines above :-) > In extend_fses? That's a bug .. > > Rich. >
2013 Feb 07
2
[PATCH 1/2] Fix bogus partition number passed to guestfs___check_for_filesystem_on
...s.c @@ -79,47 +79,47 @@ free_regexps (void) pcre_free (re_major_minor); } -static int check_filesystem (guestfs_h *g, const char *device, int is_block, int is_partnum); +static int check_filesystem (guestfs_h *g, const char *device, + int whole_device); static int extend_fses (guestfs_h *g); /* Find out if 'device' contains a filesystem. If it does, add * another entry in g->fses. */ int -guestfs___check_for_filesystem_on (guestfs_h *g, const char *device, - int is_block, int is_partnum) +guestfs___check_for_filesyst...
2016 Mar 17
2
[PATCH] inspect: improve UsrMove detection (RHBZ#1186935)
...sertions(+), 2 deletions(-) diff --git a/src/inspect-fs.c b/src/inspect-fs.c index 02fdb2a..0714ae1 100644 --- a/src/inspect-fs.c +++ b/src/inspect-fs.c @@ -43,6 +43,7 @@ static int check_filesystem (guestfs_h *g, const char *mountable, int whole_device); static void extend_fses (guestfs_h *g); static int get_partition_context (guestfs_h *g, const char *partition, int *partnum_ret, int *nr_partitions_ret); +static int is_symlink_to (guestfs_h *g, const char *file, const char *wanted_target); /* Find out if 'device' contains a filesystem. If it does, add * an...
2014 Dec 09
0
[PATCH] inspection: Not an installer if there are multiple partitions (RHBZ#1171666).
...fs.c index e9cc2e9..7b116db 100644 --- a/src/inspect-fs.c +++ b/src/inspect-fs.c @@ -48,6 +48,7 @@ static int check_filesystem (guestfs_h *g, const char *mountable, const struct guestfs_internal_mountable *m, int whole_device); static int extend_fses (guestfs_h *g); +static int get_partition_context (guestfs_h *g, const char *partition, int *partnum_ret, int *nr_partitions_ret); /* Find out if 'device' contains a filesystem. If it does, add * another entry in g->fses. @@ -140,17 +141,18 @@ check_filesystem (guestfs_h *g, const...
2015 Jun 02
2
Re: [PATCH 2/3] inspection: Add support for CoreOS
On 02/06/15 17:10, Richard W.M. Jones wrote: Hello, > On Fri, May 29, 2015 at 12:24:58PM +0300, Nikos Skalkotos wrote: >> + if (collect_coreos_inspection_info (g)) { >> + guestfs_int_free_inspect_info (g); >> + return NULL; >> + } > Although this is stylistic, I think it's easier to understand if > you change the if condition to: > > if
2013 Jan 24
2
[PATCH 1/2] lib: Add CLEANUP_FREE macro which automatically calls 'free' when leaving scope.
From: "Richard W.M. Jones" <rjones@redhat.com> Use the macro like this to create temporary variables which are automatically cleaned up when the scope is exited: { CLEANUP_FREE (char *, foo, strdup (bar)); /* char *foo = strdup (bar) */ ... // no need to call free (foo)! } On GCC and LLVM, this is implemented using __attribute__((cleanup(...))). On other
2015 Jun 02
0
Re: [PATCH 2/3] inspection: Add support for CoreOS
...t; * guestfs_int_merge_fs_inspections() > * collect_coreos_inspection_info() > to be returning a value at all. So, I'll remove the if check completely. > > Nikos > > P.S. You have a check like this one on > guestfs_int_check_for_filesystem_on() a few lines above :-) In extend_fses? That's a bug .. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supp...
2015 Jun 02
0
Re: [PATCH 2/3] inspection: Add support for CoreOS
...fs += 2) { > if (guestfs_int_check_for_filesystem_on (g, *fs)) { > guestfs_int_free_inspect_info (g); > return NULL; > } > } Oh I see, yes that's a bug too. > I don't see the bug. I was looking at this other bug in src/inspect-fs.c: static int extend_fses (guestfs_h *g) { size_t n = g->nr_fses + 1; struct inspect_fs *p; p = realloc (g->fses, n * sizeof (struct inspect_fs)); if (p == NULL) { perrorf (g, "realloc"); return -1; } Should probably just call safe_realloc .. Rich. -- Richard Jones, Vir...
2015 Jun 02
1
Re: [PATCH 2/3] inspection: Add support for CoreOS
...filesystem_on (g, *fs)) { >> guestfs_int_free_inspect_info (g); >> return NULL; >> } >> } > Oh I see, yes that's a bug too. > >> I don't see the bug. > I was looking at this other bug in src/inspect-fs.c: > > static int > extend_fses (guestfs_h *g) > { > size_t n = g->nr_fses + 1; > struct inspect_fs *p; > > p = realloc (g->fses, n * sizeof (struct inspect_fs)); > if (p == NULL) { > perrorf (g, "realloc"); > return -1; > } > > Should probably jus...
2016 Mar 17
0
Re: [PATCH] inspect: improve UsrMove detection (RHBZ#1186935)
...iff --git a/src/inspect-fs.c b/src/inspect-fs.c > index 02fdb2a..0714ae1 100644 > --- a/src/inspect-fs.c > +++ b/src/inspect-fs.c > @@ -43,6 +43,7 @@ static int check_filesystem (guestfs_h *g, const char *mountable, > int whole_device); > static void extend_fses (guestfs_h *g); > static int get_partition_context (guestfs_h *g, const char *partition, int *partnum_ret, int *nr_partitions_ret); > +static int is_symlink_to (guestfs_h *g, const char *file, const char *wanted_target); > > /* Find out if 'device' contains a filesystem. If...
2010 Aug 02
5
[PATCH v3 0/5] Inspection code in C
The first three patches were posted previously: https://www.redhat.com/archives/libguestfs/2010-July/msg00082.html The last two patches in this series change guestfish -i to use this new code. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to
2010 Jul 29
4
[PATCH 0/3] Inspection code in C
These three patches (two were previously posted) can do simple operating system inspection in C. Example of use: ><fs> add-ro rhel55.img ><fs> run ><fs> inspect-os /dev/VolGroup00/LogVol00 ><fs> inspect-get-type /dev/VolGroup00/LogVol00 linux ><fs> inspect-get-distro /dev/VolGroup00/LogVol00 rhel ><fs> inspect-get-arch
2010 Aug 17
8
[PATCH v4 0/8] Inspection code in C
Previously discussed here: https://www.redhat.com/archives/libguestfs/2010-August/msg00002.html -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
2013 Feb 12
7
Remaining btrfs patches
[PATCH 1/7] mount: Add mount_vfs_nochroot This is significantly reworked from before. umount is gone as discussed, and variable motion is minimised. [PATCH 2/7] btrfs: Update btrfs_subvolume_list to take Already provisionally ACKed. Previous comment was that cleanup could be tidier. I looked into creating a new cleanup function for fs_buf, but it isn't possible (or simple, anyway) in this
2014 Nov 27
2
[PATCH 1/1] inspect: Fix a bug in the *BSD root detection
...0); } static void free_regexps (void) { - pcre_free (re_first_partition); + pcre_free (re_primary_partition); pcre_free (re_major_minor); } @@ -84,6 +84,39 @@ static int check_filesystem (guestfs_h *g, const char *mountable, int whole_device); static int extend_fses (guestfs_h *g); +/* On *BSD systems, sometimes /dev/sda[1234] is a shadow of the real root + * filesystem that is probably /dev/sda5 + * (see: http://www.freebsd.org/doc/handbook/disk-organization.html) + */ +void +guestfs___check_for_dublicated_bsd_root(guestfs_h *g) +{ + size_t i; + bool is_p...
2013 Jun 05
3
[PATCH 1/3] inspection: Refactor windows systemroot detection to allow re-use
...s.c @@ -175,6 +175,9 @@ check_filesystem (guestfs_h *g, const char *mountable, const struct guestfs_internal_mountable *m, int whole_device) { + /* Not CLEANUP_FREE, as it will be cleaned up with inspection info */ + char *windows_systemroot = NULL; + if (extend_fses (g) == -1) return -1; @@ -274,10 +277,11 @@ check_filesystem (guestfs_h *g, const char *mountable, guestfs_is_dir (g, "/spool") > 0) ; /* Windows root? */ - else if (guestfs___has_windows_systemroot (g) >= 0) { + else if ((windows_systemroot = guestfs___...
2013 Jan 25
4
[PATCH 0/3] Use __attribute__((cleanup(...)))
This patch series changes a small part of the library to use __attribute__((cleanup(...))) to automatically free memory when pointers go out of the current scope. In general terms this seems to be a small win although you do have to use it carefully. For functions where you can completely get rid of the "exit code paths", it can simplify things. For a good example, see the
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
This type is initially identical to Device. --- generator/bindtests.ml | 2 +- generator/c.ml | 7 +++++-- generator/csharp.ml | 6 ++++-- generator/daemon.ml | 4 ++-- generator/erlang.ml | 6 +++--- generator/fish.ml | 8 ++++---- generator/gobject.ml | 11 ++++++----- generator/haskell.ml | 11 +++++++---- generator/java.ml | 10 +++++-----
2017 Jun 16
1
[PATCH] inspection: Deprecate APIs and remove support for inspecting installer CDs.
...nagement (g, fs); - - return 1; -} diff --git a/lib/inspect-fs.c b/lib/inspect-fs.c index 9f7630bcf..655b1fb8e 100644 --- a/lib/inspect-fs.c +++ b/lib/inspect-fs.c @@ -86,22 +86,6 @@ guestfs_int_check_for_filesystem_on (guestfs_h *g, const char *mountable) } } - if (whole_device) { - extend_fses (g); - fs = &g->fses[g->nr_fses-1]; - - r = guestfs_int_check_installer_iso (g, fs, m->im_device); - if (r == -1) { /* Fatal error. */ - g->nr_fses--; - return -1; - } - if (r > 0) /* Found something. */ - return 0; - -...