search for: guestfs_int_first_line_of_fil

Displaying 17 results from an estimated 17 matches for "guestfs_int_first_line_of_fil".

2017 Mar 22
1
[PATCH v2] inspect: improve detection of Mageia install discs
...quot; file in an architecture-specific subdirectory of the main partition, and use its data to improve the data on the media. Only Mageia as distribution name is recognized there, since most probably this file will not be available on other distros. --- Changes in v2: - simplify file reading using guestfs_int_first_line_of_file lib/inspect-fs-cd.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/lib/inspect-fs-cd.c b/lib/inspect-fs-cd.c index 278386e..1cff560 100644 --- a/lib/inspect-fs-cd.c +++ b/lib/inspect-fs-cd.c @@ -21,6 +21,8 @@ #include <stdio.h>...
2017 Mar 22
2
[PATCH] inspect: improve detection of Mageia install discs
Check for a "product.id" file in an architecture-specific subdirectory of the main partition, and use its data to improve the data on the media. Only Mageia as distribution name is recognized there, since most probably this file will not be available on other distros. --- lib/inspect-fs-cd.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+)
2017 Mar 22
1
Re: [PATCH] inspect: improve detection of Mageia install discs
...uot; PRIi64 " bytes)"), > > + filename, size); > > + return -1; > > + } > > + > > + lines = guestfs_head_n (g, 1, filename); > > + if (lines == NULL) > > + return -1; > > Could the above code be replaced by a call to > guestfs_int_first_line_of_file ? Indeed, good catch -- thanks! > > + elem = strtok_r (lines[0], ",", &saveptr); > > You can probably use strtok here [I think?] if it's simpler. I'd maybe if this was in the daemon, which runs single-threaded. OTOH, using a non-reentrant strtok in the librar...
2017 Mar 22
0
Re: [PATCH] inspect: improve detection of Mageia install discs
...(g, _("size of %s is unreasonably large (%" PRIi64 " bytes)"), > + filename, size); > + return -1; > + } > + > + lines = guestfs_head_n (g, 1, filename); > + if (lines == NULL) > + return -1; Could the above code be replaced by a call to guestfs_int_first_line_of_file ? > + elem = strtok_r (lines[0], ",", &saveptr); You can probably use strtok here [I think?] if it's simpler. Rich. > + while (elem) { > + const char *equal = strchr (elem, '='); > + if (equal == NULL || equal == elem) > + return -1; > +...
2015 Jun 02
1
[PATCH 1/3] inspection: Add func for merging fs inspections
...src/inspect-fs.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 4f06c37..7d30e8e 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -788,6 +788,7 @@ extern char *guestfs_int_first_line_of_file (guestfs_h *g, const char *filename) extern int guestfs_int_first_egrep_of_file (guestfs_h *g, const char *filename, const char *eregex, int iflag, char **ret); extern void guestfs_int_check_package_format (guestfs_h *g, struct inspect_fs *fs); extern void guestfs_int_check_package_management (...
2015 May 29
2
[PATCH 1/3] inspection: Add func for merging fs inspections
...src/inspect-fs.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 4f06c37..01cbca7 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -788,6 +788,7 @@ extern char *guestfs_int_first_line_of_file (guestfs_h *g, const char *filename) extern int guestfs_int_first_egrep_of_file (guestfs_h *g, const char *filename, const char *eregex, int iflag, char **ret); extern void guestfs_int_check_package_format (guestfs_h *g, struct inspect_fs *fs); extern void guestfs_int_check_package_management (...
2017 Jun 16
1
[PATCH] inspection: Deprecate APIs and remove support for inspecting installer CDs.
...e could parse it out of the product name - * string, but that seems quite hairy. We could look for the names - * of packages. Also note that some Debian install disks are - * multiarch. - */ -static int -check_debian_installer_root (guestfs_h *g, struct inspect_fs *fs) -{ - fs->product_name = guestfs_int_first_line_of_file (g, "/.disk/info"); - if (!fs->product_name) - return -1; - - fs->type = OS_TYPE_LINUX; - if (STRPREFIX (fs->product_name, "Ubuntu")) - fs->distro = OS_DISTRO_UBUNTU; - else if (STRPREFIX (fs->product_name, "Debian")) - fs->distro = OS_D...
2017 Jul 17
12
[PATCH v9 00/11] Reimplement inspection in the daemon.
This depends on the patch series "[PATCH 00/27] Reimplement many daemon APIs in OCaml." (https://www.redhat.com/archives/libguestfs/2017-July/msg00098.html) v8 was posted here: https://www.redhat.com/archives/libguestfs/2017-June/msg00274.html v9: - I split up the mega-patch into a more reviewable series of smaller, incremental patches. There are some other changes vs v8, but
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.
2017 Jul 21
10
[PATCH v10 00/10] Reimplement inspection in the daemon.
v9 was here: https://www.redhat.com/archives/libguestfs/2017-July/msg00139.html This depends on these three series (the first two being single minor patches): https://www.redhat.com/archives/libguestfs/2017-July/msg00207.html https://www.redhat.com/archives/libguestfs/2017-July/msg00209.html https://www.redhat.com/archives/libguestfs/2017-July/msg00215.html There is no substantive change. I
2017 Aug 09
16
[PATCH v12 00/11] Reimplement inspection in the daemon.
This fixes almost everything. Note that it adds an extra commit which fixes the whole utf8/iconv business. It's probably better to list what isn't fixed: (1) I didn't leave the osinfo code around because I'm still haven't looked too closely at virt-builder-repository. Can't we just fetch this code from the git history when we need it? (2) I didn't change the way
2017 Jul 31
16
[PATCH v11 00/10] Reimplement inspection in the daemon.
v10: https://www.redhat.com/archives/libguestfs/2017-July/msg00245.html No actual change here, but I rebased and retested. Also this series now does not depend on any other patch series since everything else needed is upstream. Rich.
2017 Jun 19
29
[PATCH v7 00/29] Reimplement inspection in the daemon.
v6 was posted here: https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html and this requires the utilities refactoring posted here: https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html Inspection is now complete[*], although not very well tested. I'm intending to compare the output of many guests using old & new virt-inspector to see if I can find any
2017 Jun 21
45
[PATCH v8 00/42] Refactor utilities and reimplement inspection.
v7 was: https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html https://www.redhat.com/archives/libguestfs/2017-June/msg00184.html I believe this addresses all comments received so far. Also it now passes a test where I compared about 100 disk images processed with old and new virt-inspector binaries. The output is identical in all cases except one which is caused by a bug in blkid
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...mroot) == -1) + return -1; + } /* Windows volume with installed applications (but not root)? */ else if (guestfs_int_is_dir_nocase (g, "/System Volume Information") > 0 && guestfs_int_is_dir_nocase (g, "/Program Files") > 0) @@ -630,7 +630,7 @@ guestfs_int_first_line_of_file (guestfs_h *g, const char *filename) */ int guestfs_int_first_egrep_of_file (guestfs_h *g, const char *filename, - const char *eregex, int iflag, char **ret) + const char *eregex, int iflag, char **ret) { char **lines; int64_t size; diff --git a/src/ins...
2015 Oct 05
3
[PATCH 1/2] Change 'fprintf (stdout,...)' -> printf.
Result of earlier copy and paste. --- align/scan.c | 35 ++++++++++--------- cat/cat.c | 39 +++++++++++---------- cat/filesystems.c | 69 +++++++++++++++++++------------------- cat/log.c | 35 ++++++++++--------- cat/ls.c | 61 +++++++++++++++++---------------- df/main.c | 43 ++++++++++++------------ diff/diff.c | 67
2017 Jun 15
45
[PATCH v6 00/41] Refactor utilities, reimplement inspection in the daemon.
v5: https://www.redhat.com/archives/libguestfs/2017-June/msg00065.html Since v5, this now implements inspection almost completely for Linux and Windows guests. Rich.