search for: nr_fses

Displaying 20 results from an estimated 34 matches for "nr_fses".

2013 Feb 07
2
[PATCH 1/2] Fix bogus partition number passed to guestfs___check_for_filesystem_on
...debug (g, "check_for_filesystem_on: %s (%s)", + device, vfs_type ? vfs_type : "failed to get vfs type"); - if (is_swap) { + if (vfs_type && STREQ (vfs_type, "swap")) { if (extend_fses (g) == -1) return -1; - fs = &g->fses[g->nr_fses-1]; + struct inspect_fs *fs = &g->fses[g->nr_fses-1]; fs->device = safe_strdup (g, device); return 0; } /* If it's a whole device, see if it is an install ISO. */ - if (is_block) { + int whole_device = guestfs_is_whole_device (g, device); + if (whole_device...
2015 Jun 04
3
[PATCH] Use safe_realloc() in favor of realloc overall.
...add @@ -75,8 +75,7 @@ guestfs_int_check_for_filesystem_on (guestfs_h *g, const char *mountable) mountable, vfs_type ? vfs_type : "failed to get vfs type"); if (is_swap) { - if (extend_fses (g) == -1) - return -1; + extend_fses (g); fs = &g->fses[g->nr_fses-1]; fs->mountable = safe_strdup (g, mountable); return 0; @@ -95,8 +94,7 @@ guestfs_int_check_for_filesystem_on (guestfs_h *g, const char *mountable) } if (whole_device) { - if (extend_fses (g) == -1) - return -1; + extend_fses (g); fs = &g->fses[g->nr...
2016 Dec 06
9
[PATCH 0/5] Improve inspection of /usr filesystems
Hi, this patch series improves the way /usr filesystems are handled: tag them appropriately, so later on we can find them and merge results they contain directly back for the root filesystem. The series includes also a new private debug API, and its usage to fix the resolution of /dev/mapper/.. devices found in fstab; without it, LVM /usr filesystems are not recognized as belonging to their
2014 Nov 28
2
Re: [PATCH 1/1] inspect: Fix a bug in the *BSD root detection
...+ * (see: http://www.freebsd.org/doc/handbook/disk-organization.html) > + */ > +static void > +check_for_duplicated_bsd_root (guestfs_h *g) > +{ > + size_t i; > + bool is_primary, is_bsd; > + struct inspect_fs *fs, *bsd_primary = NULL; > + > + for (i = 0; i < g->nr_fses; ++i) { > + fs = &g->fses[i]; > + > + is_primary = match (g, fs->mountable, re_primary_partition); > + is_bsd = > + fs->type == OS_TYPE_FREEBSD || > + fs->type == OS_TYPE_NETBSD || > + fs->type == OS_TYPE_OPENBSD; > + > + 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/
2015 Jun 02
2
Re: [PATCH 2/3] inspection: Add support for CoreOS
Sorry, I don't get it. In inspect.c line 67 you have this: for (fs = fses; *fs; fs += 2) { if (guestfs_int_check_for_filesystem_on (g, *fs)) { guestfs_int_free_inspect_info (g); return NULL; } } I don't see the bug. On 02/06/15 18:30, Richard W.M. Jones wrote: > On Tue, Jun 02, 2015 at 06:18:38PM +0300, Nikos Skalkotos wrote: >> On 02/06/15 17:10,
2016 Dec 06
0
[PATCH 5/5] inspect: gather info from /usr filesystems as well (RHBZ#1401474)
...ection details + * to the root when they were set (i.e. because the /usr had os-release + * or other ways to identify the OS). + */ +static void +collect_linux_inspection_info_for (guestfs_h *g, struct inspect_fs *root) +{ + size_t i; + struct inspect_fs *usr = NULL; + + for (i = 0; i < g->nr_fses; ++i) { + struct inspect_fs *fs = &g->fses[i]; + size_t j; + + if (!(fs->distro == root->distro || fs->distro == OS_DISTRO_UNKNOWN) || + fs->role != OS_ROLE_USR) + continue; + + for (j = 0; j < root->nr_fstab; ++j) { + if (STREQ (fs->mountabl...
2014 Nov 27
2
[PATCH 1/1] inspect: Fix a bug in the *BSD root detection
...+ * 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_primary, is_bsd; + struct inspect_fs *fs, *bsd_primary = NULL; + + for (i = 0; i < g->nr_fses; ++i) { + fs = &g->fses[i]; + + is_primary = match (g, fs->mountable, re_primary_partition); + is_bsd = ((fs->type == OS_TYPE_FREEBSD) || \ + (fs->type == OS_TYPE_NETBSD) || \ + (fs->type == OS_TYPE_OPENBSD)); + + if (fs->is_root &&amp...
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
2016 Dec 07
3
[PATCH v2 0/2] Improve inspection of /usr filesystems
Hi, this patch series improves the way /usr filesystems are handled: tag them appropriately, so later on we can find them and merge results they contain directly back for the root filesystem. Changes in v2: - removed patches #1 and #2, already pushed - drop patch #3, no more needed - replace patch #4 with a better suggestion from Rich - change if into assert in patch #5 Thanks, Pino Toscano
2015 Jun 02
1
[PATCH 2/3] inspection: Add support for CoreOS
...ot;/" and "/usr" filesystems of a CoreOS image. If this is the case, + * sum up all the collected information on the root fs. + */ +static void +collect_coreos_inspection_info (guestfs_h *g) +{ + size_t i; + struct inspect_fs *root = NULL, *usr = NULL; + + for (i = 0; i < g->nr_fses; ++i) { + struct inspect_fs *fs = &g->fses[i]; + + if (fs->distro == OS_DISTRO_COREOS && fs->is_root) + root = fs; + } + + if (root == NULL) + return; + + for (i = 0; i < g->nr_fses; ++i) { + struct inspect_fs *fs = &g->fses[i]; + + if (fs-&g...
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 May 29
2
[PATCH 2/3] inspection: Add support for CoreOS
...uot;/" and "/usr" filesystems of a CoreOS image. If this is the case, + * sum up all the collected information on the root fs. + */ +static int +collect_coreos_inspection_info (guestfs_h *g) +{ + size_t i; + struct inspect_fs *root = NULL, *usr = NULL; + + for (i = 0; i < g->nr_fses; ++i) { + struct inspect_fs *fs = &g->fses[i]; + + if (fs->distro == OS_DISTRO_COREOS && fs->is_root) + root = fs; + } + + if (root == NULL) + return 0; + + for (i = 0; i < g->nr_fses; ++i) { + struct inspect_fs *fs = &g->fses[i]; + + if (fs-...
2015 Jun 02
0
Re: [PATCH 2/3] inspection: Add support for CoreOS
...stem_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, Virtualization Group, Red Hat http://people.redhat....
2015 Jun 02
1
Re: [PATCH 2/3] inspection: Add support for CoreOS
...ect_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. >
2014 Nov 28
0
Re: [PATCH 1/1] inspect: Fix a bug in the *BSD root detection
.../disk-organization.html) > > + */ > > +static void > > +check_for_duplicated_bsd_root (guestfs_h *g) > > +{ > > + size_t i; > > + bool is_primary, is_bsd; > > + struct inspect_fs *fs, *bsd_primary = NULL; > > + > > + for (i = 0; i < g->nr_fses; ++i) { > > + fs = &g->fses[i]; > > + > > + is_primary = match (g, fs->mountable, re_primary_partition); > > + is_bsd = > > + fs->type == OS_TYPE_FREEBSD || > > + fs->type == OS_TYPE_NETBSD || > > + fs->type == OS_...
2014 Nov 28
1
Re: [synnefo-devel] Re: [PATCH 1/1] inspect: Fix a bug in the *BSD root detection
...t;>> + */ >>> +static void >>> +check_for_duplicated_bsd_root (guestfs_h *g) >>> +{ >>> + size_t i; >>> + bool is_primary, is_bsd; >>> + struct inspect_fs *fs, *bsd_primary = NULL; >>> + >>> + for (i = 0; i < g->nr_fses; ++i) { >>> + fs = &g->fses[i]; >>> + >>> + is_primary = match (g, fs->mountable, re_primary_partition); >>> + is_bsd = >>> + fs->type == OS_TYPE_FREEBSD || >>> + fs->type == OS_TYPE_NETBSD || >>> +...
2014 Dec 09
0
[PATCH] inspection: Not an installer if there are multiple partitions (RHBZ#1171666).
...; m->im_type == MOUNTABLE_DEVICE && + guestfs___is_partition (g, m->im_device)) { + if (get_partition_context (g, m->im_device, + &partnum, &nr_partitions) == -1) + return -1; } struct inspect_fs *fs = &g->fses[g->nr_fses-1]; @@ -285,7 +287,7 @@ check_filesystem (guestfs_h *g, const char *mountable, * Skip these checks if it's not a whole device (eg. CD) or the * first partition (eg. bootable USB key). */ - else if ((whole_device || partnum == 1) && + else if ((whole_device || (partnum == 1...