Commit Graph

462 Commits

Author SHA1 Message Date
Richard W.M. Jones
b527ff0dfc build: Require qemu >= 1.3.0 and yajl.
Require qemu >= 1.3.0, the first version that supported
`qemu-img --output=json'.

This means we require yajl (for parsing the JSON output of qemu-img),
and that in turn has consequences elsewhere.
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
9958dffc08 builder: Update Fedora 23 ppc64le image which was broken.
This updates commit d92758d8bb.
2015-12-19 21:30:50 +00:00
Richard W.M. Jones
d92758d8bb builder: Add Fedora 23 ppc64/ppc64le images. 2015-12-19 13:32:25 +00:00
Richard W.M. Jones
eed0e7a2e0 builder: Fix Fedora ppc64/ppc64le build scripts to use correct version. 2015-12-19 09:57:36 +00:00
Richard W.M. Jones
e44de65ec9 builder: Add CentOS 7.2 image. 2015-12-15 18:40:36 +00:00
Richard W.M. Jones
e69e9c1ece builder: website: Update comment in centos.sh script. 2015-12-15 18:20:17 +00:00
Richard W.M. Jones
0339b3d7a5 builder: Add Fedora 23 i686 image (RHBZ#1288733).
This includes the DNF fix, see
commit 59ea51d358.
2015-12-05 23:41:25 +00:00
Pino Toscano
a090a48f44 builder: create temporary images in the cachedir (RHBZ#1288201)
Temporary images can be quite big, more than the space available in
$TMPDIR when it's on a tmpfs; hence, place them in our cachedir
instead.
2015-12-04 11:06:35 +01:00
Richard W.M. Jones
59ea51d358 builder: Rebuild Fedora 23 image with new DNF (RHBZ#1280029, RHBZ#1278382).
We also need to add a small hack to the build script to ensure the
latest dnf is really included.
2015-12-01 13:03:31 +00:00
Richard W.M. Jones
4085acc67f builder: pxzcat: If write fails, display correct error message.
If uncompressing a template to a filesystem which is nearly full,
virt-builder displays an error which points to the wrong (source) file:

$ virt-builder fedora-22
[   1.2] Downloading: http://libguestfs.org/download/builder/fedora-22.xz
[   1.7] Planning how to build this image
[   1.7] Uncompressing
/home/rjones/.cache/virt-builder/fedora-22.x86_64.1: No space left on device
/home/rjones/.cache/virt-builder/fedora-22.x86_64.1: No space left on device
/home/rjones/.cache/virt-builder/fedora-22.x86_64.1: No space left on device
/home/rjones/.cache/virt-builder/fedora-22.x86_64.1: No space left on device

(The error message is usually printed once by each thread, so it is
printed several times.)

Change the error message to point to the output file, which might be a
temporary or the final file depending on the build plan:

$ virt-builder fedora-22
[   1.1] Downloading: http://libguestfs.org/download/builder/fedora-22.xz
[   1.6] Planning how to build this image
[   1.6] Uncompressing
fedora-22.img: No space left on device
fedora-22.img: No space left on device
fedora-22.img: No space left on device
fedora-22.img: No space left on device
2015-11-27 09:08:07 +00:00
Richard W.M. Jones
6e15468337 builder: rhel: Fix path in rhel-aarch64.sh. 2015-11-24 15:41:56 +00:00
Richard W.M. Jones
a4c981e7bb builder: Make the interface between cmdline.ml and builder.ml explicit. 2015-11-13 11:53:12 +00:00
Richard W.M. Jones
7747723aa0 builder: Add Fedora 23 aarch64 image. 2015-11-12 18:12:04 +00:00
Richard W.M. Jones
c15b877310 builder: fedora-aarch64.sh: Switch to using Gerd's edk2. 2015-11-12 16:41:36 +00:00
Richard W.M. Jones
9307087bb5 builder: Use the 'may' pattern in a few places. 2015-11-11 16:12:35 +00:00
Pino Toscano
4cc98d8f6e OCaml tools: use open_guestfs everywhere
Instead of creating Guestfs handles and manually apply common options
(e.g. debug and trace), use the open_guestfs in Common_utils.
This also applies the common options to handles which didn't set them
before, so we can inspect also their messages if needed.
2015-11-10 11:38:40 +01:00
Richard W.M. Jones
b20d36aa1b tests: Change more conflicting temporary output file names.
Various tests cannot be run in parallel just because they happen to
use conflicting names for temporary output files (eg. "test.out").

Change these tests to use unique temporary names, so the tests could
be run in parallel.
2015-11-05 13:48:38 +00:00
Richard W.M. Jones
226848762b builder: Add fedora-23 image. 2015-11-04 13:06:11 +00:00
Richard W.M. Jones
9f70d71d4a builder: Document using 'qemu-img amend' for RHEL 6 compat (RHBZ#1204131). 2015-11-03 21:14:40 +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
Richard W.M. Jones
63952d9666 ocaml: Rename Config module as Guestfs_config.
Unfortunately Coccinelle places a Config module in the ocaml libdir,
and this confuses ocamlfind (only when Coccinelle is installed).
Since this is a private module that only libguestfs tools use
internally, just rename it from Config -> Guestfs_config.
2015-10-30 09:45:02 +00:00
Richard W.M. Jones
25fee09a44 builder: Add Debian 7 sparc64 image. 2015-10-27 18:18:50 +00:00
Pino Toscano
a4da3f74c9 builder: run virt-resize with --unknown-filesystems=error
This way, we can make sure that if a template needs to be expanded, the
result will have all the filesystems correctly expanded, fitting into
the new sizes of their partitions.
2015-10-27 17:49:57 +01:00
Richard W.M. Jones
905a9c54e6 builder: Allow 'make install' to be run twice.
The error is:

ln -s xdg/virt-builder /tmp/p/etc/virt-builder
ln: failed to create symbolic link '/etc/virt-builder/virt-builder': File exists

There is no 'LN_SF' macro, but according to the documentation at
least, it should be safe to add a '-f' flag since it will work for
both the 'ln' and 'cp' variants of the macro.
2015-10-24 12:36:18 +01:00
Pino Toscano
753bf99f5c builder: fix conversion of double to OCaml (RHBZ#1270011).
Create the OCaml value for double using caml_copy_double, which is
the correct way, simplier, and works.
2015-10-12 16:38:50 +02:00
Richard W.M. Jones
0944acf90c mllib: Replace various ad hoc string_* functions with String.*
This is just a straight refactoring.  Various ad hoc string_*
functions that appeared in Common_utils have been renamed and placed
in the String.* namespace.  The old vs "new" functions are:

string_prefix  -> String.is_prefix
string_suffix  -> String.is_suffix
string_find    -> String.find
replace_str    -> String.replace
string_nsplit  -> String.nsplit
string_split   -> String.split
string_lines_split -> String.lines_split
string_random8 -> String.random8
2015-10-06 13:40:34 +01:00
Richard W.M. Jones
cab3d5d2f6 builder: Remove duplicate planner transition.
Seems to be a copy and paste bug in
commit 62cc7d3361.
2015-10-06 11:22:21 +01: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
Cédric Bosdonnat
d0aa7a032c Add opensuse.gpg to the dist tarball
Adding missing opensuse.gpg to EXTRA_DIST.
2015-09-30 16:04:12 +01:00
Cédric Bosdonnat
4bb4c0f4f7 builder: add opensuse images sources 2015-09-30 10:55:37 +02:00
Pino Toscano
1b8dd2150b builder: fix prototype virt_builder_yajl_tree_parse
Declare the prototype depending whether libyajl is available, and if it
isn't add also the noreturn attribute.

Fixes commit 87a42174f9.
2015-09-10 11:12:53 +02:00
Pino Toscano
27becc7e2f builder: handle output filenames with ':'
Use qemu_input_filename for the output file in the qemu-img convert
invocation.

See also commit 1709263613 for
virt-sparsify.
2015-09-09 13:19:57 +02:00
Pino Toscano
87a42174f9 builder: add noreturn for yajl functions without libyajl
caml_invalid_argument will not return, and GCC warns (or errors out with
-Werror) when the function is not marked as such.
2015-09-09 10:50:01 +02:00
Cédric Bosdonnat
fb9c17c8d4 Allow curl to follow redirects.
download.opensuse.org uses redirects to point to the relevant mirror.
Adding -L --max-redirs 5 to curl options will get us the requested
images.
2015-09-08 12:08:43 +02:00
Pino Toscano
268de62db6 builder: distribute simplestreams test files
Fixes commit b024aef6fb.
2015-09-08 11:51:49 +02:00
Pino Toscano
c8436df4a2 builder: replace colons in simplestreams test files
Colons won't be handled by make at all, so replace them with underscore
to be able to distribute them.
2015-09-08 11:51:49 +02:00
Pino Toscano
b024aef6fb builder: support Simple Streams v1.0 as index metadata
Add a new "simplestreams" repository type, and a simple parser for
fetching and reading the JSON indexes of the Simple Streams v1.0
format.

Read only datatype=image-downloads contents, and only the latest
versions of each content available as disk image (disk.img or
disk1.img).

Add a simple test, using the "released" images from the CirrOS project.
2015-09-08 09:51:49 +02:00
Pino Toscano
23d1719105 builder: add simple libyajl binding
Only yajl_val and yajl_tree_parse are exposed for now.
2015-09-08 09:51:49 +02:00
Pino Toscano
7dfbb1f11c builder: add non-int revisions
Add support for non-integer revisions of entries, comparing them as
integer when possible.
2015-09-08 09:51:48 +02:00
Pino Toscano
b360e99ff6 builder, dib, get-kernel: document new -q/--quiet options
Provided as common options for all the OCaml-based tools.
2015-09-02 00:25:55 +02:00
Pino Toscano
2ec0332e5e mllib: move -q/--quiet as common option
Most of the OCaml-based tools had it already, except from virt-dib and
virt-get-kernel.
2015-09-02 00:25:55 +02:00
Pino Toscano
2af6e48ba3 mllib: add and use set_standard_options
Introduce a new common helper to add the common options for libguestfs
tools (short/long options, version, verbose, trace), and sort them.
All the OCaml-based tools had these options already, so there are no
functional changes in the interface they provide.

The only difference is that now the options are always sorted, while
some tools didn't had them like that previously: because of this, a
couple of ditto markers (as descriptions) don't match what's above them
anymore, and thus their full description is put instead.
2015-08-31 18:25:48 +02:00
Richard W.M. Jones
08b57ae1f4 builder/website: Fix EXTRA_DIST.
This fixes commit 190a9f4534 and
commit 864ca489ac.
2015-08-13 16:45:30 +01:00
Pino Toscano
d78f685c0e builder: normalize architectures
Normalize the target architecture, and also each architecture when
checking for a compatible image.

This sort of reverts the effects of
commit 8864c47b94, but at least it is
possible to build e.g. Debian-based amd64 images on any x86_64 system
without being considered as foreign architecture.
2015-08-12 18:22:34 +02:00
Richard W.M. Jones
190a9f4534 builder: Add script for building RHEL for aarch64. 2015-08-12 14:00:24 +01:00
Richard W.M. Jones
864ca489ac builder: Add script for building Fedora i686 (32 bit) images. 2015-08-11 13:56:55 +01:00
Richard W.M. Jones
8cb82aec12 builder: fedora: Use os variant fedora22. 2015-08-11 13:34:27 +01:00