summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* docs: guestfs_set_out_of_memory_handler returns void, not int.Richard W.M. Jones2011-08-071-2/+2
| | | | | It always has done. The documentation was wrong. (cherry picked from commit 70f44cc0ea0bcdd025ed657461e07f6778be44ba)
* Change link, since PostgreSQL switched to using git.Richard W.M. Jones2011-08-071-1/+1
| | | | (cherry picked from commit 3cf31c2fe0b356ea5c04117c5235b0a3cfe34971)
* 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.
* blkid: Detect when value not found and return empty string.Richard W.M. Jones2011-07-271-0/+4
| | | | | | | | | | | | | | | If the blkid command returns 2, that means the value was not found. Note that this changes the output of the vfs-type API when the filesystem has no type (eg when it is empty). Previously this would return an error. Now it returns empty string "". We did not document this either way. Making it return empty string is consistent with vfs-label and vfs-uuid. This change broke list-filesystems, since that code was assuming that vfs-type could only return a filesystem type or an error. (cherry picked from commit 168fd4ad5d1e5da93e11388095d41aaa8f804ceb)
* appliance: Capture stderr from qemu to the event system.Richard W.M. Jones2011-07-271-1/+9
| | | | (cherry picked from commit 8b2e60ce4b46e86da093ee64d4e0b0ae3c998d55)
* appliance: Document pipe fds.Richard W.M. Jones2011-07-271-0/+2
| | | | (cherry picked from commit 70daccfe4e9939078436c2830928d8e53432dd84)
* Add caution subdirectory containing safety and liveness tests.Richard W.M. Jones2011-07-161-0/+5
| | | | | | | Not that I'm paranoid about qemu breaking snapshots of anything like that ... Cherry picked from commit f3ada2c7653866f2529c9f18aaa99f76cd984844.
* protocol: Enhance "unexpected end of file when reading from daemon" error.Richard W.M. Jones2011-06-131-2/+21
| | | | | | Make this error more informative, since it is a common error when the appliance fails to start up. (cherry picked from commit 2f73ea343cc4a3433f20e99a7835152767a70f80)
* 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.
* Compile rpcgen-generated files with -fno-strict-aliasingMatthew Booth2011-04-111-7/+4
| | | | | | rpcgen generates source which can't be safely compiled with strict-aliasing enabled. (cherry picked from commit 3a84e0784e1e3ab7b56850d0f8c9aa42f1ae3da1)
* 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)
* Add prototype for timeval_diff.Richard W.M. Jones2011-04-111-1/+2
| | | | | | This is just code motion. Cherry picked from commit 1e6be6afe58de5bfb1ac056b80d3210888edfead.
* docs: Progress messages don't necessarily reach 100% in the error case.Richard W.M. Jones2011-04-111-1/+2
| | | | | | This should be obvious, and now it is documented to avoid any confusion. (cherry picked from commit 05dbe09a5c5be3d5f68dc6eb033c4f642fbac8bf)
* Rename $tmpdir/sock to $tmpdir/guestfsd.sock.Richard W.M. Jones2011-03-292-6/+6
| | | | | | No functional change; this simply makes the purpose of the socket clearer. (cherry picked from commit 110bfe1fcc9964b82acf7df6d4d60774471f9157)
* inspect: Don't fail for Windows guests with multiple disks (RHBZ#674130).Richard W.M. Jones2011-03-292-2/+15
| | | | | 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)
* guestfs(3): 'kernel' -> 'supermin appliance'.Richard W.M. Jones2011-03-211-4/+4
| | | | (cherry picked from commit 1541f3a564f8ff14c1a63298120e4dc618ea3274)
* guestfs(3): Indent line to keep code together.Richard W.M. Jones2011-03-211-1/+1
| | | | (cherry picked from commit cf6f380c544456ee3e84fd41a480ea4cab3d94dd)
* proto: Fix both-ends-cancel case.Richard W.M. Jones2011-03-212-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case where both ends cancel at the same time (eg. both ends realize there are errors before or during the transfer), previously we skipped sending back an error from the daemon, on the spurious basis that the library would not need it (the library is cancelling because of its own error). However this is wrong: we should always send back an error message from the daemon in order to preserve synchronization of the protocol. A simple test case is: $ guestfish -N fs -m /dev/sda1 upload nosuchfile / libguestfs: error: open: nosuchfile: No such file or directory libguestfs: error: unexpected procedure number (66/282) (Notice two things: there are errors at both ends, and the loss of synchronization). After applying this commit, the loss of synchronization does not occur and we just see the library error: $ guestfish -N fs -m /dev/sda1 upload nosuchfile / libguestfs: error: open: nosuchfile: No such file or directory The choice of displaying the library or the daemon error is fairly arbitrary in this case -- it would be valid to display either or even to combine them into one error. Displaying the library error only makes the code considerably simpler. This commit also (re-)enables a test for this case. Cherry picked and rebased from commit f4d996fd26762053d68f46de5790aae893f03d38.
* proto: Don't drop outgoing message when daemon cancels (RHBZ#576879).Richard Jones2011-03-211-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a (potential) fix for the long standing protocol bug which causes loss of synchronization when a FileIn action fails very early on the daemon side. The canonical example would be the 'upload' action failing immediately if no filesystem is mounted. What's supposed to happen is this: (1) library sends request message (2) daemon processes request first chunk of data and sees that it will fail, sends cancellation (3) discards chunks of data (4) library sees daemon cancellation and stops sending chunks It was going wrong in step (1), in guestfs___send_to_daemon. In some (timing related) circumstances, send_to_daemon could receive the cancellation before sending the first chunk, at which point it would exit, *discarding the first chunk*. This causes the daemon to fail in step (3) since it reads the next request as if it was a chunk, thus losing synchronization. (The protocol specifies that you always have to send at least one chunk if there is a FileIn or FileOut parameter). The patch changes guestfs___send_to_daemon so that if it detects cancellation, it sends the remaining data in its output buffer instead of discarding it. (This also fixes another edge case to do with sending partial data although I don't think we ever saw that in practice). (cherry picked from commit c7368ce167d6dbfd3e69ba208301c5af3f17a8a1)
* check the pid is > 0 before calling waitpid()Angus Salkeld2011-03-211-1/+1
| | | | | Signed-off-by: Angus Salkeld <asalkeld@redhat.com> (cherry picked from commit d1f1f74e5f45fa5b94ebb096fa65fa33ecc23d09)
* check the pid is > 0 before calling waitpid()Angus Salkeld2011-03-211-1/+1
| | | | | Signed-off-by: Angus Salkeld <asalkeld@redhat.com> (cherry picked from commit 6f7c1a9f9d76bdf9f112e12e1508531fb41abfb2)
* RHEL5: Make use of 'futimens' function optional.Richard W.M. Jones2011-03-211-0/+4
| | | | (cherry picked from commit 003fbdfe5d8b237f42f575199b742c8dde9b8a11)
* 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)
* lib: Move appliance launching to separate function.Richard W.M. Jones2011-03-081-14/+24
| | | | | This is just code motion. (cherry picked from commit 99f0d8859fdc8f6c81873d4cdd1c8c780ac25e84)
* lib: Fix use-after-free bug in XPath parsing code.Richard W.M. Jones2011-03-081-1/+1
| | | | (cherry picked from commit 82f5fdb0dbbc0c7b04861edeadf70c86c9342df2)
* 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)
* docs: Refresh programming language list in guestfs(3).Richard W.M. Jones2011-01-101-5/+5
| | | | (cherry picked from commit 86a53e17de672a79a994b905676b4566da9f072c)
* docs: Refresh programming language equivalence example in guestfs(3).Richard W.M. Jones2011-01-101-3/+3
| | | | (cherry picked from commit 33e9639f2037540a89a9bbaf7212683e8a60fe84)
* docs: Fix missing g handle in guestfs(3) man page.Richard W.M. Jones2011-01-101-2/+2
| | | | (cherry picked from commit cdc798ac3558e416dc756a0fcefad2af5ca307e0)
* docs: Refresh guestfs(3)/DOWNLOADING.Richard W.M. Jones2011-01-101-4/+3
| | | | (cherry picked from commit 22042693cc1e0455a4a503dba93a9fedc9c74f04)
* docs: Refresh guestfs(3)/MOUNTINGRichard W.M. Jones2011-01-101-9/+15
| | | | (cherry picked from commit 1a9b7df8f2092701fdc5a77a4d9edfcaa1a20acf)
* docs: Update API support.Richard W.M. Jones2011-01-1013-6/+5043
|
* api-support: Fix detection of similar APIs.Richard W.M. Jones2011-01-101-1/+1
| | | | | | Because we didn't match on word boundaries, the previous code would get confused by similar APIs, eg. getxattr vs getxattrs. (cherry picked from commit 7ba1b55aa79c56ded770f8ea46716eb054fbfe78)
* docs: Obsolete HACKING file, move content into guestfs(3) man page.Richard W.M. Jones2011-01-102-1/+343
| | | | | | | Add a new section called "EXTENDING LIBGUESTFS" to the guestfs manual page which contains all the information previously in "HACKING". (cherry picked from commit d2400da92e5e2cc7fd5e33e61220a33214d5241c)
* docs: Add section on using /dev/fd/* with upload and download calls.Richard W.M. Jones2010-12-171-0/+21
|
* ntfs-3g: Document problems with symlinks and alternatives (RHBZ#663407).Richard W.M. Jones2010-12-161-0/+31
|
* New APIs: getxattr and lgetxattr to get single extended attributes.Richard W.M. Jones2010-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These APIs are essentially required to work around a problem with ntfs-3g. This filesystem (or FUSE?) does not list all extended attributes of a file when you call listxattr(2). However if you know the name of an extended attribute, you can retrieve it directly using getxattr(2). The current APIs (getxattrs etc) are simple to use, but they don't work if we can't list out the extended attributes (ie. by calling listxattr(2)). Example using the new APIs on an ntfs-3g filesystem: ><fs> lgetxattr "/Documents and Settings" system.ntfs_attrib | hexdump -C 00000000 16 24 00 00 |.$..| 00000004 ><fs> lgetxattr "/Documents and Settings" system.ntfs_reparse_data | hexdump -C 00000000 03 00 00 a0 34 00 00 00 00 00 18 00 1a 00 10 00 |....4...........| 00000010 5c 00 3f 00 3f 00 5c 00 43 00 3a 00 5c 00 55 00 |\.?.?.\.C.:.\.U.| 00000020 73 00 65 00 72 00 73 00 00 00 43 00 3a 00 5c 00 |s.e.r.s...C.:.\.| 00000030 55 00 73 00 65 00 72 00 73 00 00 00 |U.s.e.r.s...| 0000003c ><fs> getxattr "/Documents and Settings" system.ntfs_reparse_data | hexdump -C libguestfs: error: getxattr: getxattr: No such file or directory ><fs> getxattr "/Documents and Settings" system.ntfs_attrib | hexdump -C libguestfs: error: getxattr: getxattr: No such file or directory ><fs> lgetxattr "/Documents and Settings" system.ntfs_attrib | hexdump -C 00000000 16 24 00 00 |.$..| 00000004 ><fs> getxattr "/Users" system.ntfs_attrib | hexdump -C 00000000 11 00 00 00 |....| 00000004
* appliance: Don't set utime on cachedir until we know it is safe.Richard W.M. Jones2010-12-111-1/+2
| | | | | This could be used to touch an arbitrary file (albeit one which must already exist), and this could have been a security problem.
* appliance: Touch cached appliance files so they don't get tmp cleaned.Richard W.M. Jones2010-12-111-0/+5
|
* Remove extra \n character from end of error messages.Richard W.M. Jones2010-12-111-3/+3
|
* appliance: Be careful about cleaning up old appliances.Richard W.M. Jones2010-12-111-165/+296
| | | | | | | | | | | This change resolves several issues with current appliance building: (1) Old appliances are cleaned up. (2) Race conditions between appliance building is handled better. (3) Several bugs fixed.
* Remove several unused local variables.Richard W.M. Jones2010-12-102-5/+0
| | | | (Revealed by compiling under Debian where this is a warning).
* build: Remove check for root.Richard W.M. Jones2010-12-091-11/+0
| | | | | | | With the new package building system, it is no longer dangerous to run 'configure', 'make' or 'make check' as root (although it is still not necessary and not advisable). In any case we don't need to check this.
* docs: Link to guestfs-examples(3) after simple example.Richard W.M. Jones2010-12-071-1/+2
|
* docs: Note that guestfs_sync is no longer necessary.Richard W.M. Jones2010-12-071-6/+4
|
* appliance: Change to using febootstrap 3.x supermin appliance.Richard W.M. Jones2010-12-051-6/+1
| | | | | | | | | This removes all support for building the ordinary / old style appliance using febootstrap 2.x, debootstrap, debirf, fakeroot and fakechroot. Instead this uses febootstrap 3.x to build the supermin appliance in a simpler cross-distro manner.
* appliance: Don't look for kmod.whitelist.Richard W.M. Jones2010-12-041-1/+1
| | | | This file is not used for building the supermin appliance.