227 Commits

Author SHA1 Message Date
Richard W.M. Jones
d5a8f82887 Use 'const' for stack integers where possible.
May improve optimization possibilities in a few cases.
2016-07-26 10:43:45 +01:00
Richard W.M. Jones
07c496c53c Use less stack.
GCC has two warnings related to large stack frames.  We were already
using the -Wframe-larger-than warning, but this reduces the threshold
from 10000 to 5000 bytes.

However that warning only covers the static part of frames (not
alloca).  So this change also enables -Wstack-usage=10000 which covers
both the static and dynamic usage (alloca and variable length arrays).

Multiple changes are made throughout the code to reduce frames to fit
within these new limits.

Note that stack allocation of large strings can be a security issue.
For example, we had code like:

 size_t len = strlen (fs->windows_systemroot) + 64;
 char software[len];
 snprintf (software, len, "%s/system32/config/software",
           fs->windows_systemroot);

where fs->windows_systemroot is guest controlled.  It's not clear what
the effects might be of allowing the guest to allocate potentially
very large stack frames, but at best it allows the guest to cause
libguestfs to segfault.  It turns out we are very lucky that
fs->windows_systemroot cannot be set arbitrarily large (see checks in
is_systemroot).

This commit changes those to large heap allocations instead.
2016-03-07 17:36:24 +00:00
Richard W.M. Jones
307c83177c Update copyright dates for 2016.
Run the following command over the source:

  perl -pi.bak -e 's/(20[01][0-9])-2015/$1-2016/g' `git ls-files`
2016-01-02 21:19:51 +00:00
Richard W.M. Jones
a2edda266e build: Make 'make clean' remove more files.
Remove man pages and other pages which 'make clean' did not remove
before.

To evaluate which pages could be removed, I did a full build and
check, and then ran 'make clean' followed by 'git clean -xdf'.  By
examining the output of the git clean command I could see which files
were being missed.

Files that are _not_ removed by make clean or make distclean:

 - generator-built files

 - Makefile, Makefile.in, .deps, .depend

 - any ./configure output files (maybe they should be?)
2015-11-03 13:53:37 +00:00
Richard W.M. Jones
47b095b928 website: Put website into a separate directory.
Move the random set of HTML files we build from html/ into
the website/ directory.

Also in the website/ directory, put the index.html file from
http://libguestfs.org, which was previously not under version control.
It is generated from index.html.in so we can automatically add the
current version and release date.

Also in the website/ directory, put various CSS file, images, etc.
which are required by the website and were also previously not under
version control.

Change the 'make website' rule to 'make maintainer-upload-website'.
As the name suggests, it is only useful for the maintainer, and will
fail with an error for anyone else.
2015-10-31 17:09:29 +00:00
Richard W.M. Jones
6219e61cba Move miscellaneous documentation from examples/ to docs/.
Wasn't very logical putting these doc files in the examples directory.
2015-10-21 11:17:14 +01:00
Richard W.M. Jones
eb36df827b guestfs-performance: Add a note about Xen dom0. 2015-10-21 10:36:07 +01:00
Richard W.M. Jones
0294b1f9b2 guestfs-performance: Use lowercase in =head2 sections.
Makes it easier to read.
2015-10-21 10:35:03 +01:00
Pino Toscano
d98c9c0e0b Fix shebang in perl scripts
Instead of hardcoding the location of perl (assuming it is installed in
/usr), use /usr/bin/env to run it, and thus picking it from $PATH.
This makes it possible to run these scripts also on installations with
perl in a different prefix than /usr.

Also, given that we want enable warnings on scripts, turn the -w
previously in shebang to explicit "use warnings;" in scripts which
didn't have it before.
2015-10-05 15:43:35 +02:00
Richard W.M. Jones
677c721e85 Fix whitespace.
Because of previous automated commits, such as changing 'guestfs___'
-> 'guestfs_int_', several function calls no longer lined up with
their parameters, and some lines were too long.

The bulk of this commit was done using emacs batch mode and the
technique described here:

  http://www.cslab.pepperdine.edu/warford/BatchIndentationEmacs.html

The changes suggested by emacs were then reviewed by hand.
2015-10-05 14:28:33 +01:00
Richard W.M. Jones
97bd64f588 FAQ: the -> and in previous commit.
This fixes commit 571fca8e71.
2015-08-13 22:54:30 +01:00
Richard W.M. Jones
571fca8e71 FAQ: Further improve debugging section. 2015-08-13 22:51:43 +01:00
Pino Toscano
993140219c Improve fixed appliance documentation
Move the "FIXED APPLIANCE" section from
libguestfs-make-fixed-appliance(1) to the "INTERNALS" section of
guestfs(3), so it's more visible and less hidden in the documentation
of a rarely-used tool.  Also slightly improve it.

Expand the FAQ question about libguestfs without supermin, mentioning
the build options needed and pointing to the aforementioned new section.
2015-06-16 14:57:19 +02:00
Richard W.M. Jones
533901409e pod: Use F<> for filenames instead of C<>.
Done using a sequence of regular expressions like this:

  perl -pi.bak -e 's{C</}{F</}g' `git ls-files \*.pod` generator/actions.ml
  perl -pi.bak -e 's{C<C:\\}{F<C:\\}g' `git ls-files \*.pod` generator/actions.ml
  [etc]

and then tediously checking every change by hand.
2015-06-15 15:42:46 +01:00
Richard W.M. Jones
47e9a3d739 FAQ: Add sections about libguestfs NTFS & XFS support.
Both popular questions.
2015-06-14 16:35:52 +01:00
Richard W.M. Jones
2dc88ba8cb FAQ: Document using libguestfs to access live guest disk images.
Gets asked on the mailing list several times a year.
2015-06-01 11:58:22 +01:00
Richard W.M. Jones
5bf7f770b6 When calling getline first time, initialize length to zero.
The man page for getline says:

   ssize_t getline(char **lineptr, size_t *n, FILE *stream);
 [...]
   If  *lineptr  is set to NULL and *n is set 0 before the call, then get‐
   line() will allocate a buffer for storing the line.  This buffer should
   be freed by the user program even if getline() failed.

which seems to indicate that we must initialize both line and len to 0
before the first call to getline.

In several places we were not initializing len.  The program still
worked fine, but it seems better to initialize the length anyway.
2015-05-14 13:22:00 +01:00
Richard W.M. Jones
e86df90e52 guestfs-performance: Suggest using 'ts' instead of annotate.
'ts' allows incremental timings which is a lot more useful.
2015-03-28 17:53:35 +00:00
Richard W.M. Jones
5a445c2e40 docs: You normally need to set SUPERMIN_KERNEL_VERSION as well. 2015-03-23 12:14:59 +00:00
Richard W.M. Jones
ce56c7d30e FAQ: Don't refer to RHEL 7 in future tense.
Thanks: orc_emacs on IRC.
2015-03-09 17:51:36 +00:00
Richard W.M. Jones
bfbcc01403 Change guestfs___* to guestfs_int_*
libguestfs has used double and triple underscores in identifiers.
These aren't valid for global names in C++.

The first step is to replace all guestfs___* (3 underscores) with
guestfs_int_*.  We've used guestfs_int_* elsewhere already as a prefix
for internal identifiers.

This is an entirely mechanical change done using:
  git ls-files | xargs perl -pi.bak -e 's/guestfs___/guestfs_int_/g'

Reference: http://stackoverflow.com/a/228797
2015-02-14 18:46:04 +00:00
Richard W.M. Jones
c5800dc97d Update copyright dates for 2015. 2015-01-17 09:08:15 +00:00
Richard W.M. Jones
ccb1f2a4a0 recipes: Tidy up section about hex-dumping and hex-editing sectors. 2014-12-13 14:49:50 +00:00
Richard W.M. Jones
7893a2cfb1 FAQ: Add a section on debugging libvirtd. 2014-10-10 11:47:26 +01:00
Richard W.M. Jones
f796435628 FAQ: Need to set SUPERMIN_KERNEL_VERSION in recent supermin. 2014-10-07 10:17:33 +01:00
Richard W.M. Jones
bced8f5289 FAQ: Note that update-guestfs-appliance is not needed with libguestfs >= 1.26. 2014-09-17 16:33:55 +01:00
Richard W.M. Jones
334dee64a2 FAQ: Repeat advice to use ./run.
The two adjacent sections can be read separately, and the second
section doesn't mention not using make install / using ./run, so
repeat it a second time.
2014-09-09 20:27:33 +01:00
Richard W.M. Jones
c435053b34 Improve diagrams on various manual pages using Unicode box drawing characters. 2014-09-01 21:29:13 +01:00
Richard W.M. Jones
4dc42693f2 guestfs-recipes: Fix language. 2014-05-04 20:57:41 +01:00
Richard W.M. Jones
b176bde942 FAQ: Describe better how to compile libguestfs from source using alternate qemu/supermin/kernel. 2014-04-22 13:32:49 +01:00
Richard W.M. Jones
ffffe71c16 build: Remove code coverage and code profiling options.
This reverts commit 5a2e320ec9.
2014-04-09 14:51:59 +01:00
Richard W.M. Jones
7173883154 recipes: Update the section on installing packages.
Libguestfs >= 1.26 makes this easy.
2014-04-03 20:27:43 +01:00
Richard W.M. Jones
4099880643 examples: Check return value from guestfs_list_filesystems.
Found by Coverity.
2014-03-26 20:25:05 +00:00
Richard W.M. Jones
c4dc70f8c4 podwrapper: Remove =encoding from input files and add it back in podwrapper.
This changes podwrapper so that the input (POD) files should not
contain an =encoding directive.  However they must be UTF-8.
Podwrapper then adds the '=encoding utf8' directive back during final
generation.

This in particular avoids problems with nested =encoding directives in
fragments.  These break POD, and are undesirable anyway.
2014-03-20 13:47:19 +00:00
Richard W.M. Jones
a13109c260 FAQ: Make issues which will be fixed in libguestfs >= 1.26 / supermin >= 5. 2014-03-13 10:38:41 +00:00
Richard W.M. Jones
8df1c47269 FAQ: Remove section that only applied to obsolete Fedora & RHEL releases.
Since this is fixed in all currently supported versions of Fedora
& RHEL, there's no need to document the problem in the FAQ.
2014-03-13 10:38:40 +00:00
Richard W.M. Jones
80d77e934f FAQ: Document virt-sparsify >= 1.26 can do in-place sparsification. 2014-03-13 10:38:40 +00:00
Richard W.M. Jones
b13c22668d appliance: Use supermin >= 5.
This requires the new version of supermin (5.1.0).
2014-02-26 15:21:08 +00:00
Richard W.M. Jones
b987be513a FAQ: Remove obsolete entry about libguestfs <= 1.13 and slow writes.
Long since not a problem.
2014-02-16 19:20:40 +00:00
Richard W.M. Jones
728ba9b33f FAQ: Add several common problems with opening disk images. 2014-02-16 19:15:49 +00:00
Richard W.M. Jones
c16d5d3de4 FAQ: Create new section about problems opening disk images.
Move the stuff about encoding problems here, because these are not
really common problems.
2014-02-16 19:15:49 +00:00
Richard W.M. Jones
6594e88d80 FAQ: Remove old RHEL 6.5 section. 2014-02-16 19:15:49 +00:00
Richard W.M. Jones
82a4a8f02c FAQ: Another common problem is permission denied errors when running as root. 2014-02-12 09:32:08 +00:00
Richard W.M. Jones
37aead588e FAQ: Add another common Ubuntu appliance problem. 2014-02-12 09:31:57 +00:00
Richard W.M. Jones
d60e6a23a6 examples: Update various examples to use new disk-create API. 2014-01-28 21:02:11 +00:00
Richard W.M. Jones
6c971faecf Update copyright dates for 2014. 2014-01-02 16:53:34 +00:00
Richard W.M. Jones
1ee879f3e5 New tool: virt-diff.
This tool can be used to show the differences between two
disk images.
2013-12-18 15:15:53 +00:00
Richard W.M. Jones
7775c121f7 recipes: Use new style -a/-d options in virt-edit example. 2013-12-11 19:22:12 +00:00
Richard W.M. Jones
5c76af3a95 recipes: Add a recipe for masking a systemd service. 2013-12-06 18:58:17 +00:00
Richard W.M. Jones
2d9f69db61 FAQ: "execl: /init: Permission denied" error also caused by /init not being executable.
This updates commit 98cd329323.
2013-11-19 17:50:04 +00:00