Commit Graph

6234 Commits

Author SHA1 Message Date
Richard W.M. Jones
53a3ff9c00 lib: Handle Ceph/rbd paths properly (RHBZ#1026688).
The path at the protocol level is:

  pool/disk

(with no leading '/' character).  This is now what you have to pass to
guestfs_add_drive_opts.

Also Ceph can be called with no explicit servers (it uses the contents
of /etc/ceph/ceph.conf instead).  So allow zero servers to be used.
2014-01-23 14:46:03 +00:00
Richard W.M. Jones
b93a1d50ad fish/uri: Tidy up error messages. 2014-01-23 14:46:03 +00:00
Pino Toscano
b7cd63fc1d builder: read all the available notes from the index
Switch the internal storage for the notes of each entry to a sorted list
with all the subkeys available (which should represent the translations
to various languages).
The current outputs are the same (i.e. still the untranslated notes), so
this is just internal refactoring/preparation.
2014-01-23 15:36:15 +01:00
Pino Toscano
958e84d699 builder: small code simplification
No actual behaviour changes, just remove extra match statements.
2014-01-23 10:19:16 +01:00
Richard W.M. Jones
2541563a18 Version 1.25.26. 1.25.26 2014-01-22 18:01:17 +00:00
Richard W.M. Jones
629cb87b6d tests/regressions: Don't include binaries in EXTRA_DIST.
Because EXTRA_DIST simply used $(TESTS), and because the list of tests
includes C binaries, these were included in the tarball (actually not
binaries, but libtool scripts, but it's still undesirable).
2014-01-22 17:13:00 +00:00
Richard W.M. Jones
7d8d065fee tests: Add a regression test for RHBZ#1054761. 2014-01-22 17:10:37 +00:00
Richard W.M. Jones
aa2ca8ba70 daemon: lvm2: Ignore "unknown device" output when a PV is missing (RHBZ#1054761). 2014-01-22 17:10:37 +00:00
Colin Walters
49c3d819c1 generator/set-uuid: Fix two typos in documentation 2014-01-22 15:47:34 +00:00
Pino Toscano
9e4357ca54 builder: fix small regression in subkey parsing
Introduced in 5cbdf35d65, it caused the
first character of the value to be skipped if the key has a subkey.
2014-01-22 15:34:22 +01:00
Richard W.M. Jones
13bca32e4e sparsify: Prevent overwriting block or char output devices (RHBZ#1056290).
virt-sparsify doesn't work if the output is a block device, and cannot
possibly work if the output is a char device.  Currently if you try
this it actually overwrites (deletes) the output device which is not
exactly desirable.  Therefore throw an error and exit.
2014-01-22 13:10:08 +00:00
Richard W.M. Jones
c6ec6cde27 builder: Add -monitor none to example command line. 2014-01-22 12:55:52 +00:00
Dan Lipsitt
873051e108 remove non-portable chmod
'chmod --reference' is not available on Mac OS X.

Keeping the original file and directing edits into it preserves permissions and removes the need to chmod.

(Tried 'sed -i' for inplace editing but unfortunately it isn't portable either.)
2014-01-21 20:26:32 +00:00
Richard W.M. Jones
ebb04b64a2 Version 1.25.25. 1.25.25 2014-01-21 18:37:26 +00:00
Pino Toscano
5cbdf35d65 builder: proper consider subkeys in index files
The index files already allowed the 'key[subkey]=...' syntax for keys,
but considering such string as whole key. Proper split the parsing and
the handling of the subkeys, so they can be searched a bit easier.

This causes no actual behaviour changes, it is just internal
micro-refactoring. (Thanks Rich for the hints, too.)
2014-01-21 19:19:22 +01:00
Richard W.M. Jones
20a4bfde96 builder: Add tip for how to relabel SELinux guest at build time.
Thanks: purpleidea/James.
2014-01-21 17:33:35 +00:00
Richard W.M. Jones
88094f3da4 builder: Clearer note in man page about SELinux and where /.autorelabel file comes from.
It's not added by virt-builder.  It is present in the templates (added
by virt-sysprep in fact).
2014-01-21 17:33:35 +00:00
Richard W.M. Jones
be5fd2fd34 builder: Add note about cloning to man page. 2014-01-21 17:33:35 +00:00
Richard W.M. Jones
3e3e7cf029 sysprep: Replace flags list with side_effects object.
Previously callbacks would return a list of flags, such as []
or [`Created_files].

In this commit we introduce two new objects, filesystem_side_effects
and device_side_effects (the latter is not used yet).

The callbacks that create files now need to call

  side_effects#created_file ()

instead of returning flags.

There is no functional change in this patch.
2014-01-21 17:33:35 +00:00
Richard W.M. Jones
11b4fc88fb sysprep: Update comments. 2014-01-21 17:33:35 +00:00
Pino Toscano
4505f61979 builder: allow more empty lines in index files
Improve the index grammar to allow more than one empty line between
sections, and to allow any number of empty lines at the end of the file
(after the last section).
2014-01-21 17:54:23 +01:00
Pino Toscano
e2cc8b6465 builder: add index-struct.h as dependency for index-parser-c.c
Just like with index-parse.h, also index-struct.h is a dependency of
index-parser-c.c which automake cannot generate correctly.
Thus, add it manually.
2014-01-21 13:47:29 +01:00
Richard W.M. Jones
10b20b7938 test-tool: Rearrange output into alphabetical order. 2014-01-21 11:07:03 +00:00
Pino Toscano
ffe1eaa11c Revert "Minimum libvirt version is >= 1.1.1."
0.10.2+ is still available on some recent-ish stable distros (like
Fedora 19, Ubuntu 13.04), and should work fine for guestfs.

This reverts commit 6b3e05e8da.
2014-01-20 16:10:43 +01:00
Richard W.M. Jones
a7b5be067e dist: Run 'git log' instead of custom script.
It's useful to see the complete SHA1's since that is how we refer to
fixes in Bugzilla.
2014-01-20 14:34:03 +00:00
Richard W.M. Jones
ee90a36521 tests: Add regression test for get-attach-method == "appliance".
This updates commit ecd31806a4.
2014-01-20 12:09:29 +00:00
Richard W.M. Jones
ecd31806a4 tests: Add a regression test for parsing LIBGUESTFS_BACKEND/LIBGUESTFS_ATTACH_METHOD (RHBZ#1055452). 2014-01-20 10:22:41 +00:00
Richard W.M. Jones
69267d8762 launch: Allow backend = "appliance" for backwards compatibility (RHBZ#1055452).
This fixes a regression which was introduced in
commit 0f26218905.
2014-01-20 10:22:41 +00:00
Richard W.M. Jones
d0c5450c45 daemon: Use wipefs_has_force_option to decide whether to add wipefs --force option. 2014-01-19 20:30:42 +00:00
Olaf Hering
d87cfefcdd daemon: add missing GUESTFSD_EXT_CMD usage
Signed-off-by: Olaf Hering <olaf@aepfle.de>
2014-01-19 20:30:42 +00:00
Richard W.M. Jones
badc4ffad5 Version 1.25.24. 1.25.24 2014-01-18 21:38:11 +00:00
Richard W.M. Jones
a1eacea572 init: Display clocksource (only when debugging is enabled). 2014-01-18 16:55:09 +00:00
Richard W.M. Jones
012b01a0fb launch: direct: Make sure we pass lpj= parameter when using TCG.
I have verified that 'refined-jiffies' is the clock source when using
TCG (ie. not kvm-clock which seems only to be used for KVM).
2014-01-18 16:52:58 +00:00
Richard W.M. Jones
26f7fb237b launch: libvirt: Add force_tcg backend setting.
By using:

  export LIBGUESTFS_BACKEND_SETTINGS=force_tcg

you can force the libvirt backend to use TCG (software emulation)
instead of KVM (hardware accelerated virtualization).
2014-01-18 16:36:14 +00:00
Richard W.M. Jones
11ac9f7024 launch: direct: Add force_tcg backend setting.
By using:

  export LIBGUESTFS_BACKEND=direct
  export LIBGUESTFS_BACKEND_SETTINGS=force_tcg

you can force the direct backend to use TCG (software emulation)
instead of KVM (hardware accelerated virtualization).

This is sometimes useful, especially if you are trying to use
nested KVM on Intel.
2014-01-18 16:32:03 +00:00
Richard W.M. Jones
1e4663858b New API: set-backend-settings, get-backend-settings.
Allow settings (an arbitrary list of strings) to be passed to the
current backend.  This will allow us to tweak how the backend works,
eg. by forcing TCG.
2014-01-18 16:32:03 +00:00
Richard W.M. Jones
815e739d12 utils: Add regression test for C utility functions. 2014-01-18 16:32:03 +00:00
Richard W.M. Jones
89a617c07d utils: Add utility function to split string into list of strings. 2014-01-18 16:32:03 +00:00
Richard W.M. Jones
693a21513b utils: Add utility function to copy string lists. 2014-01-18 16:32:03 +00:00
Richard W.M. Jones
20514fec25 test-tool: Use size_t instead of int for array index. 2014-01-18 16:32:03 +00:00
Richard W.M. Jones
3858eeb517 tests/nbd: Move wait for qemu-nbd to start up earlier.
tests/nbd/test-nbd.pl contains a hack (a call to sleep) to wait
for qemu-nbd to start up in another process.

This sleep was previously located before the call to $g->launch()
since that is where (previous to commit 4a0f5ed382) the backend would
have connected to the NBD server.

However in the new code, an initial NBD connection test is done when
the drive is added (ie. $g->add_drive (..., protocol=>"nbd")), which
duly failed intermittently because the qemu-nbd server had not opened
its socket yet.

Move the wait earlier -- just after the fork -- to avoid this.

This updates commit 4a0f5ed382.
2014-01-18 16:32:03 +00:00
Richard W.M. Jones
b6ff642168 Use recommended timer settings for KVM (RHBZ#1053847).
See: https://bugzilla.redhat.com/show_bug.cgi?id=1053847#c0

Thanks: Cole Robinson, and several QEMU developers.
2014-01-18 16:32:03 +00:00
Richard W.M. Jones
937c0313a0 launch: libvirt: Slightly simplify the XML generation code further.
This updates commit 96737fc5b7.
2014-01-18 11:40:30 +00:00
Richard W.M. Jones
e5190e0932 Version 1.25.23. 1.25.23 2014-01-17 19:32:05 +00:00
Richard W.M. Jones
c537b26f20 uml: Fix rule which disables relative-paths test on UML.
This fixes commit e22bd2dcd2.
2014-01-17 19:23:27 +00:00
Richard W.M. Jones
716f6e4275 Version 1.25.22. 1.25.22 2014-01-17 15:48:22 +00:00
Richard W.M. Jones
e22bd2dcd2 tests: Add a test of relative paths, to make sure we don't break them.
In some places we turn relative paths passed by the caller into
absolute paths: for example in the libvirt backend, all relative paths
to disk images have to be turned into absolute paths (by calling
realpath) because otherwise libvirt doesn't work.

This has the potential to break things, especially considering that
qemu uses the path passed to it in order to resolve the relative paths
of backing files.

For example consider the case where 'overlay' is a symbolic link to
/dev/dm-1, but /dev/dm-1 contains a qcow2 which references './backing'
as its backing file.  If we rewrote 'overlay' to '/dev/dm-1', then
qemu would try to look up '/dev/backing' for the backing file and
fail.

See also:

https://bugzilla.redhat.com/show_bug.cgi?id=1053684
https://www.redhat.com/archives/libguestfs/2014-January/thread.html#00087
2014-01-17 15:33:26 +00:00
Richard W.M. Jones
96737fc5b7 launch: libvirt: Use C macros to simplify XML generation.
This commit implements some hairy C macros to simplify
XML generation.

Given the target XML:

  <cpu mode="host-passthrough">
    <model fallback="allow"/>
  </cpu>

The old code would have looked like this:

   XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "cpu"));
   XMLERROR (-1,
            xmlTextWriterWriteAttribute (xo, BAD_CAST "mode",
                                         BAD_CAST "host-passthrough"));
   XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "model"));
   XMLERROR (-1,
            xmlTextWriterWriteAttribute (xo, BAD_CAST "fallback",
                                         BAD_CAST "allow"));
   XMLERROR (-1, xmlTextWriterEndElement (xo));
   XMLERROR (-1, xmlTextWriterEndElement (xo));

The new code looks like this:

   start_element ("cpu") {
     attribute ("mode", "host-passthrough");
     start_element ("model") {
       attribute ("fallback", "allow");
     } end_element ();
   } end_element ();
2014-01-17 12:16:31 +00:00
Richard W.M. Jones
f106b30c41 drives: Avoid double-free along error path.
This fixes commit 4a0f5ed382.

A simple test of this:

  guestfish <<EOF
  add-drive "" readonly:1 format:raw protocol:nbd server:localhost:10000
  EOF

which would core dump.
2014-01-17 12:15:40 +00:00
Richard W.M. Jones
6b3e05e8da Minimum libvirt version is >= 1.1.1.
Note this is the version in RHEL 7.
2014-01-16 20:00:03 +00:00