summaryrefslogtreecommitdiffstats
path: root/src/inspect.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't fail if HOSTNAME field is missing on Red Hat guests (RHBZ#726739).Richard W.M. Jones2011-08-071-3/+10
| | | | Cherry picked from commit bad3f4b54a959685f3c0697238fc5753096834fb.
* inspect: Look for %systemroot%/system32 for Windows heuristic.Richard W.M. Jones2011-05-181-3/+3
| | | | | | | | The virt-v2v transfer ISO had a /windows directory. The core inspection code thought this was a Windows root filesystem. Cherry picked and backported from commit 0da6f55a6745686ca056c6bc8ebf647f111cb8e8.
* list-applications: If software hive is missing, this is an error.Richard W.M. Jones2011-05-181-5/+5
| | | | | | | | virt-inspector would exit silently if list-applications failed along this error path. Cherry picked and backported from commit 782f3a36469ca396dbf998ea82af2699153be3ed.
* Rename resolve_windows_path_silently to case_sensitive_path_silently.Richard W.M. Jones2011-04-111-9/+9
| | | | | | | A more accurate description of what this function does. This is just code motion. (cherry picked from commit f3eea44f97340f747e46b0df6931a04b53abaf01)
* inspect: Don't fail for Windows guests with multiple disks (RHBZ#674130).Richard W.M. Jones2011-03-291-2/+13
| | | | | Cherry picked from commit d06fee159c14d4fe7654a02bae8849c4f82565f8 and backported to stable-1.8 branch.
* inspect: Simplify Windows root heuristic code.Richard W.M. Jones2011-03-291-12/+38
| | | | | | | Add special is_file_nocase and is_dir_nocase functions and remove the duplicate checks for files and directories with different cases. (cherry picked from commit 5776c145d411e5ae00072ecf422055f3d0bd29e2)
* Detect Red Hat Desktop as 'rhel' distro (RHBZ#682979).Richard W.M. Jones2011-03-081-3/+3
| | | | | | | | | | | | | | /etc/redhat-release on Red Hat Desktop contains the following string: Red Hat Desktop release 4 (Nahant Update 8) Previously we matched against the string "Red Hat Enterprise Linux" but since this does not contain that string, this distro wasn't being detected correctly. Note this also changes the obsolete Perl code, for the benefit of virt-v2v. (cherry picked from commit c1a227a960066fb9552e0c225bc473be365b67b0)
* Fix inspection code when PCRE or hivex is missing.Richard W.M. Jones2011-03-081-0/+24
| | | | (cherry picked from commit 2b26c7f721fc8ed2e6f64963289981ac286c02aa)
* inspect: Add macros for file size limits.Richard W.M. Jones2011-03-081-9/+37
| | | | | | | This also bumps the file size limit for "small text files" up to 2 MB, since we want to parse Windows CD txtsetup.sif files that are usually around 500K in size. (cherry picked from commit 4402e6048fb2a56461f9e4d474fc2f1391248781)
* Remove several unused local variables.Richard W.M. Jones2010-12-101-4/+0
| | | | (Revealed by compiling under Debian where this is a warning).
* inspect: Detect if db_dump and db_load programs are available.Richard W.M. Jones2010-11-241-1/+7
| | | | | | If db_dump is not available then disable RPM application detection. Note these utilities have odd names on Debian.
* inspect: Fix memory leak of hostname.Richard W.M. Jones2010-11-191-0/+1
| | | | | This fixes a memory leak introduced by commit fab75c0337d7897d10ea5e95e47ac05eab81ace9.
* New API: inspect-get-hostname to return the hostname of the guest.Richard W.M. Jones2010-11-161-3/+238
| | | | | This returns the hostname of the guest. Tested on RHEL, Fedora, Debian 5, Ubuntu 10.10, FreeBSD 8, Windows 7.
* inspect: Check /etc/lsb-release is not too large before calling head on it.Richard W.M. Jones2010-11-161-1/+16
|
* inspect: Add function to read the first line of a file, with safety checks.Richard W.M. Jones2010-11-161-14/+42
|
* inspect: Abstract the wrapper that sets up Augeas.Richard W.M. Jones2010-11-161-33/+50
| | | | This is just code motion.
* New API: inspect-list-applications.Richard W.M. Jones2010-11-151-0/+452
| | | | | | | | This converts the current Perl code in virt-inspector for listing applications, into C, making it a part of the core API. This is also capable of fetching the list of Windows applications from the registry.
* inspect: Centralize all file downloads through a single function.Richard W.M. Jones2010-11-151-32/+52
|
* inspect: Add support for Linux Mint and Mandriva.Richard Jones2010-11-151-1/+35
| | | | | | | | Linux Mint is derived from Ubuntu. Mandriva has a release file, but it also has /etc/lsb-release and the same parsing code can be reused. Mandriva has a package manager called urpmi.
* inspect: Fix error out path if minor_version parsing fails.Richard W.M. Jones2010-11-131-1/+1
|
* inspect: Refuse to download software hive if it is huge.Richard W.M. Jones2010-11-131-0/+8
|
* inspect: Refuse to parse /etc/fstab if it is huge.Richard W.M. Jones2010-11-131-0/+8
|
* lib: Make some error strings localizable.Richard W.M. Jones2010-11-131-3/+3
|
* inspect: Inspection support for FreeBSD.Richard W.M. Jones2010-11-131-11/+111
| | | | | | | | | | This adds inspection support for FreeBSD. However this is not quite enough to allow guestfish -i freebsd.img to work, because guestfish will try to mount the filesystems, which cannot be done because Linux requires special mount options for the Universal Filesystem (UFS) used by *BSD. Nevertheless you can manually run the same commands.
* inspect: Optimize root filesystem check.Richard W.M. Jones2010-11-131-8/+13
| | | | Avoid duplicate checks for things like /etc and /bin.
* lib: Add match3 function.Richard W.M. Jones2010-11-131-0/+25
|
* New APIs: inspect-get-package-format, inspect-get-package-management.Richard Jones2010-11-121-0/+146
| | | | This APIs reimplement some parts of virt-inspector in C.
* lib: Make pcre, libmagic and hivex libraries optional.Richard Jones2010-11-101-425/+182
| | | | | | | | | | | | | | | This change makes these libraries optional. If they are not available at compile time then certain core API features will be disabled (see below). This also changes PCRE detection to use pkg-config instead of the ad hoc autoconf checks. The large inspect.c file has been split out into separate function-specific files. file-architecture: requires pcre & libmagic inspection: requires pcre & hivex
* inspect: win64 regexp was dead code.Richard Jones2010-11-101-2/+0
|
* lib: Augeas (client side) is not needed by the library.Richard Jones2010-11-101-2/+1
| | | | However it is used by the daemon.
* New API: inspect-get-roots to return roots from last inspection.Richard W.M. Jones2010-11-051-20/+34
| | | | | Return the roots found by the last call to inspect-os, but without redoing the whole inspection.
* inspect: Add support for MeeGo.stable-1.6Richard W.M. Jones2010-11-021-0/+10
|
* inspect: Add support for Ubuntu.Richard Jones2010-10-291-1/+75
|
* inspect: Add detection of Gentoo.Richard Jones2010-10-291-0/+10
|
* inspect: Add detection of Arch Linux.Richard Jones2010-10-291-0/+8
|
* inspect: Add detection of Pardus.Richard Jones2010-10-291-0/+10
|
* inspect: Generic parsing of MAJOR.MINOR in product names.Richard Jones2010-10-291-16/+26
|
* inspect: Generic parsing of release files.Richard Jones2010-10-291-26/+25
|
* inspect: Ignore Pardus "/.swap" swapfile.Richard W.M. Jones2010-10-291-4/+5
|
* New API: inspect-get-windows-systemroot to get systemroot.Richard W.M. Jones2010-10-281-23/+30
| | | | | | We are already using heuristics in the C inspection code to determine the Windows %SYSTEMROOT% directory. This change just exposes this information through the API.
* inspection: Ignore floppy disks and CD-ROM drives (RHBZ#642929).Richard W.M. Jones2010-10-271-0/+7
|
* /dev/mapper paths should not be returned from C inspection APIs (RHBZ#638899).Richard W.M. Jones2010-10-271-17/+32
| | | | | | | | | | | | | | | | With this patch, /dev/mapper paths do not appear in the output of guestfs_inspect_os, as you can see from this example: Welcome to guestfish, the libguestfs filesystem interactive shell for editing virtual machine filesystems. Type: 'help' for a list of commands 'man' to read the manual 'quit' to quit the shell Operating system: Fedora release 13 (Goddard) /dev/vg_f13x64/lv_root mounted on / <--- NB /dev/vda1 mounted on /boot
* Allow $TMPDIR to override most temporary directory uses.Richard W.M. Jones2010-09-241-16/+28
| | | | | | | Be more consistent in allowing the user to override use of the temporary directory by specifying $TMPDIR. Also prefer P_tmpdir macro (defined in <stdio.h>) if that is defined, rather than hard-coding "/tmp" for the fallback location.
* leak: Free PCRE regexps when library is unloaded.Richard W.M. Jones2010-09-211-0/+18
| | | | | | | The compiled PCRE regexps used for inspection were being leaked when the library was unloaded. (Found by valgrind).
* New API: list-filesystems: list filesystemsRichard Jones2010-09-151-0/+137
| | | | | | | | | | | | | | | | | | This API is a simpler replacement for the guestfish commands list-devices / list-partitions / lvs, in the case where you are just examining a guest by hand to see what it contains. Typical usage and output in guestfish is like this: $ guestfish --ro -a /dev/vg_trick/F13x64 ><fs> run ><fs> list-filesystems /dev/vda1: ext4 /dev/vg_f13x64/lv_root: ext4 /dev/vg_f13x64/lv_swap: swap It can also be used to replace programs that try to mount devices to determine if they are mountable filesystems.
* syntax: Remove trailing spaces.Richard Jones2010-09-101-2/+2
|
* New APIs for guest inspection.Richard Jones2010-08-171-0/+1017
| | | | | | | | | | | | | | | | | | | | | This commit converts (some of) the Perl inspection code to C and makes it available through core APIs. The new APIs are: inspect-os - Does the inspection, returns list of OSes inspect-get-* - Get results of the inspection where '*' is one of: type - 'windows' or 'linux' distro - Linux distro arch - architecture product-name - long product name string major-version minor-version - major.minor version of OS mountpoints - get a list of the mountpoints filesystems - get all filesystems associated with the OS This works for all existing supported Linux and Windows OSes.
* New API: file-architectureRichard Jones2010-08-171-0/+280
This change simply converts the existing Perl-only function file_architecture into a core API call. The core API call is written in C and available in all languages and from guestfish.