Commit Graph

171 Commits

Author SHA1 Message Date
Pino Toscano
64bb9edd52 tests: specify the image format when possible
When possible, make the disk image format explicit when invoking tools
or using add-drive. This avoids warnings from qemu about the unspecified
format for the image, and also makes qemu slightly faster (skipping the
disk image probing).
Tests checking the image probing are not touched.

This changes also:
- old-style invocations of tools (`$tool $filename`) into new style
  (`$tool -a $filename`)
- add-drive-ro/add-drive-with-if guestfish commands into add/add-drive
  with explicit readonly/iface arguments

There should be no change in the tests results.
2016-05-19 19:06:00 +02:00
Richard W.M. Jones
446f7794e0 podwrapper: Add --warning flag for manual pages of CLI tools (RHBZ#1293527).
This doesn't add --warning flags to the translated pages,
which is a bug to be fixed at some point.
2016-01-11 13:42:49 +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
dc1d0880b0 tests: Move the tests/data and tests/guests directories to test-data.
Create a new top-level directory called test-data, which will carry
all the test data which is large and/or shared between multiple tests.

There are actually several new subdirectories created:

test-data/binaries: The pre-built binary and library files for random
architectures that we use to test various architecture detection
features (was part of tests/data).

test-data/blank-disks: The blank disks which are used for disk format
detection (was part of tests/data).

test-data/files: Other miscellaneous test files from tests/data that
are not included in the above.

test-data/phony-guests: The phony guests (was tests/guests).

test-data: The top-level directory builds the 'test.iso' image file
that is used for testing the C API and in miscellaneous other tests.
2015-10-30 16:07:32 +00: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
3b3f06d224 virt-win-reg: Make output of --version flag consistent (RHBZ#1213247). 2015-04-20 08:51:13 +01:00
Richard W.M. Jones
c5800dc97d Update copyright dates for 2015. 2015-01-17 09:08:15 +00:00
Richard W.M. Jones
f955fec760 docs: Remove useless "SHELL QUOTING" section from manual pages. 2014-07-15 17:38:31 +01: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
d3512deb67 Rewrite virt-make-fs in C (originally Perl).
It should be very compatible with the Perl version.
2014-01-28 21:02:11 +00:00
Richard W.M. Jones
9015d5ac14 virt-make-fs: Use disk-create API instead of calling qemu-img create.
Strictly speaking this reduces the number of formats that virt-make-fs
can output to, but it's likely that no one cares and if they do we can
add new formats in future.
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
793a5677cb virt-win-reg: Allow URIs (RHBZ#912193). 2013-11-14 16:34:07 +00:00
Richard W.M. Jones
13b79aacca Use qemu-img -o preallocation=metadata where possible.
When format is qcow2 and we're *not* using a backing disk, we can use
preallocation=metadata for better performance.
2013-10-17 15:03:37 +01:00
Richard W.M. Jones
93dbeb6b6c tools: Generate a special POTFILES-pl and dump symlink hack in tools directory. 2013-09-26 22:01:41 +01:00
Richard W.M. Jones
e17cd73fb7 virt-make-fs: Add --label option for setting filesystem label.
$ ./run ./tools/virt-make-fs /tmp/supermin-4.1.4.tar.gz /tmp/test.img
$ ./run ./cat/virt-filesystems -a /tmp/test.img --all --long -h
Name      Type        VFS   Label  MBR  Size  Parent
/dev/sda  filesystem  ext2  -      -    3.7M  -
/dev/sda  device      -     -      -    3.7M  -

$ ./run ./tools/virt-make-fs /tmp/supermin-4.1.4.tar.gz /tmp/test.img --label=BOOT
$ ./run ./cat/virt-filesystems -a /tmp/test.img --all --long -h
Name      Type        VFS   Label  MBR  Size  Parent
/dev/sda  filesystem  ext2  BOOT   -    3.7M  -
/dev/sda  device      -     -      -    3.7M  -

Thanks: Gerd Hoffmann (kraxel)
2013-08-29 11:38:09 +01:00
Richard W.M. Jones
b922f6521e uml: virt-make-fs: Modify test so it doesn't use qcow2 under UML.
Modify the test so it doesn't try to test qcow2 format when the
backend is User-Mode Linux which doesn't support qcow2.
2013-08-13 15:46:55 +01:00
Richard W.M. Jones
4275404626 virt-list-filesystems: Fix to use $g->canonical_device_name instead of homebrew function.
The homebrew function didn't recognize /dev/ubd* device names, and in
any case using the API function is shorter and clearer.
2013-08-13 15:46:54 +01:00
Richard W.M. Jones
5724efa69f tools: 'test.img' is no longer used.
This probably used to be a temporary file used for testing.
2013-07-20 16:31:42 +01:00
Richard W.M. Jones
a30b41f735 tools: The programs are located in the source directory. 2013-04-25 14:21:55 +01:00
Richard W.M. Jones
667482ca9a perl: Remove Sys::Guestfs::Lib.
See announcement on the mailing list for more details about this change:

https://www.redhat.com/archives/libguestfs/2013-April/msg00001.html
2013-04-02 15:26:05 +01:00
Richard W.M. Jones
2287b988ee perl: Remove use of Sys::Guestfs::Lib::open_guest function.
This obsolete function does all sorts of libvirt/XML things, which can
now be replaced by using ordinary API calls; especially $g->add_domain.
2013-04-02 13:30:19 +01:00
Richard W.M. Jones
1cb38ab924 New API: feature-available.
This API is an easier to use version of the existing guestfs_available,
because the new API returns true/false instead of throwing an error
when a feature from the list is not available.

In truth we've had this implementation internally in the library
and several tools and in Sys::Guestfs::Lib for a long time.  This
change just turns it into a publicly consumable API.
2013-04-02 12:38:50 +01:00
Richard W.M. Jones
0d18a8b407 Update copyright dates for 2013. 2013-02-02 13:56:19 +00:00
Richard W.M. Jones
e18e20793f tests: virt-make-fs: Allow btrfs to be skipped. 2013-01-21 08:15:54 +00:00
Richard W.M. Jones
b57ab59b8e doc: Document problems with hibernated Windows guests and Windows 8 "fast startup" (RHBZ#882299). 2012-12-01 13:25:56 +00:00
Richard W.M. Jones
9ea6e97014 inspection: Fix calls to case_sensitive_path (RHBZ#858126).
Don't assume that if guestfs_case_sensitive_path returns NULL, that it
means the file does not exist.

The (previously undefined) behaviour of case_sensitive_path was that a
NULL return meant "either the file doesn't exist or some other error".
However in commit 973581780d this was
changed so that if the last element of the path didn't exist, it was
assumed to be a new file and the (non-NULL) path of the new file is
returned.

This change breaks code (including in libguestfs) which tries to use
case_sensitive_path as a dual-purpose call to fix-up a path for
Windows and test if the file exists.  Such code should be rewritten so
that it explicitly tests for file existence after calling
case_sensitive_path.

I examined all the calls to case_sensitive_path in libguestfs and
modified them where necessary.
2012-09-28 15:09:50 +01:00
Richard W.M. Jones
a1d981edea tests: Attach copyright and license (GPLv2+) notices to various test scripts.
For some reason these tests did not have license notices.
2012-08-31 19:12:27 +01:00
Richard W.M. Jones
23b7fe09e1 tools: Fix podwrapper errors in tools directory.
This also makes the test for license "code" less strict, so it should
only match POD, not Perl comments.

This fixes commit 2f97bf873b.
2012-08-28 13:18:40 +01:00
Richard W.M. Jones
2f97bf873b podwrapper: Add --license parameter, which is required.
This adds standard LICENSE and BUGS sections to all of the man pages
that are processed by podwrapper.

Modify all the calls to $(PODWRAPPER) to add the right --license
parameter according to the content.  Note that this relaxes the
license on some code example pages, making them effectively BSD-style
licensed.
2012-08-21 20:33:21 +01:00
Richard W.M. Jones
864ef706a8 Add optional compress flag to tar-in, tar-out APIs.
The compress flag can be used to control compression, one of: (none),
"compress", "gzip", "bzip2", "xz", "lzop".  Thus these calls can now
be used instead of tgz-in/tgz-out/txz-in/txz-out, and also support
more compression types.

Mark these APIs as once_had_no_optargs so that compatibility code is
generated.
2012-08-14 09:53:37 +01:00
Richard W.M. Jones
2c046c0d6f virt-make-fs: Don't display output of 'qemu-img' except on error path. 2012-08-11 20:53:00 +01:00
Richard W.M. Jones
2295b09f25 virt-make-fs: Remove note about vfat and ownership of tarball files.
This problem has been fixed in
commit 50780a84f6.
2012-08-11 20:51:28 +01:00
Richard W.M. Jones
9c2b9c2df6 virt-make-fs: Suggest guestfish for complex layouts in man page. 2012-07-18 11:14:19 +01:00
Richard W.M. Jones
f2ea617e22 build: Change calls to podwrapper.sh to use $(PODWRAPPER).
This will allow us to easily change the location of this
script in future.
2012-07-16 18:56:57 +01:00
Richard W.M. Jones
c7d342a94a virt-make-fs: Add --floppy option to make preconfigured vfd's. 2012-07-16 16:47:44 +01:00
Richard W.M. Jones
24b7979ea2 virt-make-fs: Recognize "msdos" as a partition or filesystem type.
Set MBR partition type byte accordingly.
2012-07-16 16:26:26 +01:00
Richard W.M. Jones
7486fc6f43 generator: Rename 'add_drive_opts' API to 'add_drive'.
By using the once_had_no_optargs flag, this change is backwards
compatible for callers (except Haskell, PHP and GObject as discussed
in earlier commit).
2012-07-14 12:42:24 +01:00
Richard W.M. Jones
ffbf1475f7 New API: guestfs_shutdown: Cleanly shutdown the backend.
The new API splits orderly close into a two-step process:

  if (guestfs_shutdown (g) == -1) {
    /* handle the error, eg. qemu error */
  }
  guestfs_close (g);

Note that the explicit shutdown step is only necessary in the case
where you have made changes to the disk image and want to handle write
errors.  Read the documentation for further information.

This change also:

 - deprecates guestfs_kill_subprocess

 - turns guestfs_kill_subprocess into the same as guestfs_shutdown

 - changes guestfish and other tools to call shutdown + close
   where necessary (not for read-only tools)

 - updates documentation

 - updates examples
2012-07-03 21:27:29 +01:00
Richard W.M. Jones
927ef14c58 run: Set MALLOC_PERTURB_ to a random value.
MALLOC_PERTURB_ is a glibc feature which causes malloc to wipe memory
before and after it is used, allowing both use-after-free and
uninitialized reads to be detected with relatively little performance
penalty:

  http://udrepper.livejournal.com/11429.html?nojs=1

Modify the ./run script so that it always sets this.

We were already using MALLOC_PERTURB_ in most tests.  Since ./run is
now setting this, we can remove it from individual Makefiles.  Most
TESTS_ENVIRONMENT will now simply look like this:

  TESTS_ENVIRONMENT = $(top_builddir)/run --test
2012-06-28 13:19:39 +01:00
Richard W.M. Jones
05d4e07918 tests: Add ./run --test option.
This option, when added via
  TESTS_ENVIRONMENT = [...] $(top_builddir)/run --test
allows us to run the tests and only print the full output (including
debugging etc) when the test fails.
2012-06-26 23:34:30 +01:00
Richard W.M. Jones
d5d9ceee8b virt-make-fs: When writing vfat, add utf8 option to mount (RHBZ#823885). 2012-05-24 14:40:52 +01:00
Richard W.M. Jones
975a41db20 virt-make-fs: Provide a clearer error message when mkfs fails (RHBZ#823883). 2012-05-24 12:30:50 +01:00
Richard W.M. Jones
a2cc317c03 virt-make-fs: Add a test of btrfs (regression test for RHBZ#816098). 2012-05-03 14:32:25 +01:00
Richard W.M. Jones
c53ea071c6 virt-make-fs: Simplify test code.
This is just code motion.
2012-05-03 14:32:24 +01:00
Richard W.M. Jones
0cc3525142 virt-make-fs: Fix estimation when making btrfs (RHBZ#816098).
This also disables data and metadata duplication, which is not very
useful on a constructed filesystem on a virtual disk.
2012-05-03 14:32:24 +01:00
Richard W.M. Jones
93734c78d8 virt-make-fs: Use mount instead of mount_options. 2012-05-03 14:32:24 +01:00
Richard W.M. Jones
e60556d927 virt-make-fs: Fix filesystem type check when estimating ntfs. 2012-05-03 14:32:24 +01:00