Commit Graph

8944 Commits

Author SHA1 Message Date
Richard W.M. Jones
f24753ebb0 tests/qemu: boot-analysis: (Don't) set LIBVIRT_LOG_FILTERS.
Setting LIBVIRT_LOG_FILTERS is supposed to be better than setting
LIBVIRT_DEBUG, but I couldn't get it to work.

This updates commit b332d91bc9.
2016-04-06 17:49:38 +01:00
Richard W.M. Jones
b332d91bc9 tests/qemu: boot-analysis: Add support for logging libvirt events. 2016-04-06 13:06:23 +01:00
Richard W.M. Jones
0008d794cf tests/qemu: Don't leak backend variable in boot-analysis/boot-benchmark programs. 2016-04-06 10:42:21 +01:00
Richard W.M. Jones
171c84788e v2v: DOM: Add documentation for the obscure 'e' function.
No functional change, just comment.
2016-04-05 21:32:08 +01:00
Richard W.M. Jones
1dd3da54f1 v2v: Add documentation to Convert_windows and Convert_linux modules.
No functional change, just add comments / documentation.
2016-04-05 21:20:26 +01:00
Richard W.M. Jones
c8cf4dc0a1 Version 1.33.18. 1.33.18 2016-04-05 15:15:21 +01:00
Richard W.M. Jones
b2c845333f launch: libvirt: Disable virtio-rng in libvirt backend until we can use /dev/urandom.
This updates commit 9423c16607.
2016-04-05 15:02:20 +01:00
Cédric Bosdonnat
dc94de5bee v2v: extract controller offset discovery as a function
This function is needed for other drivers, move the code in order to
help sharing it later.
2016-04-05 13:22:46 +01:00
Richard W.M. Jones
19dc728c48 Version 1.33.17. 1.33.17 2016-04-05 12:09:22 +01:00
Richard W.M. Jones
91c7273899 builder: Add ubuntu-ppc64le.sh to EXTRA_DIST.
Fixes commit f756002b54.
2016-04-05 12:07:13 +01:00
Richard W.M. Jones
1ecd0b0058 Add python/t/README to EXTRA_DIST.
Fixes commit aae74c9e4e.
2016-04-05 12:06:23 +01:00
Richard W.M. Jones
a04b04c5c1 Remove .x-sc (syntax check) files from EXTRA_DIST.
Fixes commit 821db657d1.
Updates commit 017f1c6729.
2016-04-05 11:58:35 +01:00
Richard W.M. Jones
c48e04d9d2 align/scan: Remove stray comment that confuses clang-format. 2016-04-04 17:57:38 +01:00
Richard W.M. Jones
821db657d1 Further remove mention of 'make syntax-check'.
Updates commit 017f1c6729.
2016-04-04 17:57:38 +01:00
Richard W.M. Jones
fdfedcb4ef Use 'error' function for fprintf followed by exit.
Like with the previous commit, this replaces instances of:

  if (something_bad) {
    fprintf (stderr, "%s: error message\n", guestfs_int_program_name);
    exit (EXIT_FAILURE);
  }

with:

  if (something_bad)
    error (EXIT_FAILURE, 0, "error message");

(except in a few cases were errno was incorrectly being ignored, in
which case I have fixed that).

It's slightly more complex than the previous commit because we must be
careful to:

 - Remove the program name (since error(3) prints it).

 - Remove any trailing \n character from the message.

Candidates for replacement were found using:

  pcregrep --buffer-size 10M -M '\bfprintf\b.*\n.*\bexit\b' `git ls-files`
2016-04-04 17:57:38 +01:00
Richard W.M. Jones
129e4938ba Use 'error' function consistently throughout.
Wherever we had code which did:

  if (something_bad) {
    perror (...);
    exit (EXIT_FAILURE);
  }

replace this with use of the error(3) function:

  if (something_bad)
    error (EXIT_FAILURE, errno, ...);

The error(3) function is supplied by glibc, or by gnulib on platforms
which don't have it, and is much more flexible than perror(3).  Since
we already use error(3), there seems to be no downside to mandating it
everywhere.

Note there is one nasty catch with error(3): error (EXIT_SUCCESS, ...)
does *not* exit!  This is also the reason why error(3) cannot be
marked as __attribute__((noreturn)).

Because the examples can't use gnulib, I did not change them.

To search for multiline patterns of the above form, pcregrep -M turns
out to be very useful:

  pcregrep --buffer-size 10M -M '\bperror\b.*\n.*\bexit\b' `git ls-files`
2016-04-04 13:14:26 +01:00
Richard W.M. Jones
03b68d436c tests/qemu: boot-analysis: Don't force backend direct.
Current libvirt overhead is 220ms.  That didn't matter when our launch
time was 4000ms.  Now we're launching in 900ms, it really does.
2016-04-02 11:59:39 +01:00
Richard W.M. Jones
014b7c0ced tests/qemu: Standardize test info printed by boot-* tests.
It now looks like:

test version: libguestfs 1.33.16
 test passes: 5
host version: Linux moo 4.4.4-301.fc23.x86_64 #1 SMP Fri Mar 4 17:42:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    host CPU: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
     backend: direct
        qemu: /home/rjones/d/qemu/x86_64-softmmu/qemu-system-x86_64
qemu version: QEMU emulator version 2.5.90, Copyright (c) 2003-2008 Fabrice Bellard
         smp: 1
     memsize: 500
      append: guestfs_boot_analysis=1 ignore_loglevel initcall_debug
2016-04-02 11:01:30 +01:00
Richard W.M. Jones
d470480b35 tests/qemu: boot-analysis: Display all times in ms.
It was confusing to have a mix of seconds and milliseconds.  For all
upstream testing (eg. with SeaBIOS) we are discussing everything in
milliseconds, so use those exclusively.
2016-04-02 10:42:12 +01:00
Richard W.M. Jones
96ce2f9afe tests/qemu: Add boot-benchmark.
Add a new test program called 'boot-benchmark'.  This is similar to
'boot-analysis' but it simply boots and shuts down the appliance
several times in a row and measures how long it takes, calculating
mean and standard deviation.
2016-04-01 19:22:56 +01:00
Richard W.M. Jones
2e04be377a docs: Link to boot-analysis program from guestfs-performance(1). 2016-04-01 17:47:19 +01:00
Matteo Cafasso
7ecec1ee55 python: Fix bug in code generator
When a struct containing FChar fields is defined
in generator/structs.ml, the Python code generator will generate
code referencing a dirent struct instead of the correct one
thus breaking at compile time.

This bug was left unnoticed because the dirent struct is the only
one using FChar fields. Yet it prevents any other struct
from using such fields.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-04-01 17:14:53 +01:00
Richard W.M. Jones
2cc8a4c1ff launch: Add a comment about why acpi=off (because it's slow). 2016-04-01 12:28:18 +01:00
Richard W.M. Jones
6c99a17dc5 launch: Only use sgabios when verbose is enabled.
The sgabios option ROM is slow.  Only use it when we're debugging.

Thanks: Paolo Bonzini.
2016-04-01 10:10:04 +01:00
Richard W.M. Jones
77e1ac5a97 launch: direct: Add a comment about use of -display none.
No functional change.
2016-04-01 10:09:42 +01:00
Richard W.M. Jones
68fc25e1d5 v2v: Document how to use 'cinder manage' for importing directly to Cinder.
Thanks: Tom Barron.
2016-03-31 14:03:56 +01:00
Richard W.M. Jones
b2f42a8dce builder: Update Fedora 23 (i686) image.
Contains a fix for RHBZ#1317843 and another dnf bug.
2016-03-31 13:43:55 +01:00
Pino Toscano
d2e81b42e7 inspect: use os-release for CoreOS
Look for /lib/os-release in the /usr partition and try to use it, if
present, before using lsb-release later on.  This should not change the
final result of the inspection, while using the os-release detection
method also for CoreOS.

Update the phony CoreOS image to use os-release instead, uploading the
version found in the current stable version.
2016-03-31 11:38:00 +02:00
Matteo Cafasso
5fd0819ebc Rename icat command in download_inode
The "icat" name comes from the employed command line tool which might be
replaced at any time with a different implementation.

The command name is a bit confusing because it's similar to "cat" but
act as "download".

download_inode is more clear and descriptive.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-03-31 10:50:42 +02:00
Pino Toscano
ca4516d94c inspect: os-release: fix single-number version parsing (RHBZ#1321620)
Use the proper length modifier for asprintf, instead of a padding
modifier.  This fixes the parsing of versions in VERSION_ID which are a
single number (i.e. "X" and not "X.Y", etc).

Bug introduced with commit 32d19e3289, but
uncovered recently with the switch away from VLAs, i.e.
commit 07c496c53c.
2016-03-30 15:49:16 +02:00
Matteo Cafasso
88d5186eb4 renamed daemon/tsk.c to daemon/sleuthkit.c
In order to support the new features I am renaming the file with a better name.

The file sleuthkit.c will contain the code depending on the sleuthkit package.

The original tsk.c file will contain the logic built using libtsk
which is the sleuthkit core library.

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2016-03-30 13:02:30 +02:00
Richard W.M. Jones
c67bab9c5d builder: Update Fedora 23 image.
Contains a fix for RHBZ#1317843 and another dnf bug.
2016-03-30 11:25:00 +01:00
Pino Toscano
807433bc23 appliance: init: generate /etc/machine-id
Some of the systemd-tmpfiles snippets need the machine ID of the running
system; the current lack of this file produces warning messages during
the appliance boot like:

[/usr/lib/tmpfiles.d/systemd.conf:26] Failed to replace specifiers: /run/log/journal/%m
[/usr/lib/tmpfiles.d/systemd.conf:28] Failed to replace specifiers: /run/log/journal/%m
[/usr/lib/tmpfiles.d/systemd.conf:29] Failed to replace specifiers: /run/log/journal/%m

Thus create a new randomly-generated /etc/machine-id on boot.
2016-03-30 10:15:49 +02:00
Richard W.M. Jones
da7e22b648 boot-analysis: Add --memsize, --smp and --append options.
These options allow you to control the appliance memory size, number
of vCPUs, and extra kernel options respectively.

Note that using --smp is not usually a good idea.  Not only does it
slow down the appliance, but it tends to break the boot analysis
program because it makes runs (more) non-deterministic.
2016-03-29 12:01:42 +01:00
Richard W.M. Jones
de66981917 v2v: Don't use List.sort_uniq, add util function for this instead (RHBZ#1321338).
List.sort_uniq was added in OCaml 4.02, so this breaks compilation on
earlier versions of OCaml.

Thanks: Jean-Christophe Manciot
2016-03-25 17:13:58 +00:00
Richard W.M. Jones
f756002b54 builder: Add ubuntu ppc64le script.
Thanks: Gustavo Romero
2016-03-24 20:19:19 +00:00
Lars Kellogg-Stedman
c6512ead45 document behavior of --selinux-relabel
the description of the --selinux-relabel option suggests that it
perform an immediate relabel, when in fact it may (and probably will)
instead simply touch /.autorelabel on the image, which schedules a
relabel operation for the next time the image boots.  This can be
surprising because it results both in an extended initial boot time
*and* results in an automatic reboot (on some distributions).
2016-03-24 20:19:09 +00:00
Richard W.M. Jones
6cdd20716c Version 1.33.16. 1.33.16 2016-03-24 18:51:36 +00:00
Richard W.M. Jones
c3fb5deab6 rescue: Fix test to deal with new --suggest output.
Fixed commit 72fd0531ab.
2016-03-24 18:51:36 +00:00
Richard W.M. Jones
aae74c9e4e python: Add README documenting how to run a single test. 2016-03-24 14:46:42 +00:00
Richard W.M. Jones
a5507a16c6 rescue: Print chroot suggestion for Linux guests. 2016-03-24 13:56:29 +00:00
Richard W.M. Jones
72fd0531ab rescue: Suggest using recursive bind mounts.
Since /dev and other directories contain sub-mounts, suggest using
--rbind instead of --bind.  This also allows us to remove the /dev/pts
line.
2016-03-24 13:56:29 +00:00
Richard W.M. Jones
0024e5a13e python: Misspelling in tests, libirt -> libvirt. 2016-03-24 13:56:29 +00:00
Roman Kagan
db982654d1 v2v: better explain --in-place
It seems that the documentation for --in-place mode of v2v wasn't clear
enough, so try to explain it better.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: "Richard W.M. Jones" <rjones@redhat.com>
2016-03-24 16:43:29 +03:00
Roman Kagan
fb73d8261d v2v: in-place: request caps based on source config
In in-place mode, the decisions on which interfaces to use are made and
the source VM configuration is created by the outside entity.  So in
that case v2v needs to look it up in the source configuraion, and try to
follow.

For that, the source VM configuration is used to populate requested caps
object which is then passed to the convert routine.

It's assumed that the configuration has exactly one type of storage
devices and no more than one type of network and video adapters;
anything else is rejected.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: "Richard W.M. Jones" <rjones@redhat.com>
2016-03-24 15:07:01 +03:00
Roman Kagan
ee02191483 v2v: take requested caps into account when converting
Give the caller certain control over what kind of interface to use for
virtual disks, network and video cards upon conversion.

For that, make convert functions accept additional rcaps parameter
containing an object with optional capabilities similar to the ones
produced on output, with None indicating that the decision is left to
the convert function itself.

To facilicate review, this patch unconditionally passes rcaps with no
preferences; populating it with more sensible values is done in a
followup patch.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: "Richard W.M. Jones" <rjones@redhat.com>
2016-03-24 15:07:01 +03:00
Roman Kagan
94c83c0165 v2v: introduce requested guestcaps type
Introduce a type to contain the guestcaps that are to be put in effect
in the converted VM: options of the block type, net type, and video.

It'll be populated by the caller and passed into convert function to
affect its choice of devices and drivers.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: "Richard W.M. Jones" <rjones@redhat.com>
2016-03-24 15:07:01 +03:00
Roman Kagan
ad5bb4f6bd v2v: collect source network and video adapter types
Those will be useful when making decisions about what configuration to
set on output.

The data is also included in --print-source so the tests are adjusted
accordingly.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: "Richard W.M. Jones" <rjones@redhat.com>
2016-03-24 15:07:01 +03:00
Richard W.M. Jones
0ba59db611 tests/qemu: Add program for tracing and analyzing boot times. 2016-03-23 13:25:46 +00:00
Richard W.M. Jones
cd57851019 conn: Pretend to be a serial terminal, so sgabios doesn't hang.
This tedious workaround avoids a 0.26 second pause when using sgabios
(the Serial Graphics Adapter).  It's basically a workaround for buggy
code in sgabios, but much easier than fixing the assembler.
2016-03-23 13:25:46 +00:00