Commit Graph

6316 Commits

Author SHA1 Message Date
Richard W.M. Jones
2954541fdd java: Avoid warnings in the tests and examples.
Avoid warnings about missing serial version, and fix a warning about
raw types.
2014-02-13 17:48:23 +00:00
Pino Toscano
ab2df2e659 mllib: hostname: on Debian replace it also in /etc/hosts (RHBZ#953907).
In Debian/Ubuntu systems, read the previous hostname from /etc/hostname
before replacing it, and replace it in /etc/hosts with the new hostname.
2014-02-13 14:52:50 +01:00
Pino Toscano
4ca4eef0cc sysprep: remove RH subscription manager files
Add a new operation for it, which should do what
`subscription-manager clean` does.

Part of RHBZ#1063374.
2014-02-13 10:57:31 +01:00
Pino Toscano
f78877c77e sysprep: remove RH subscription manager log files
Part of RHBZ#1063374.
2014-02-13 10:50:15 +01:00
Richard W.M. Jones
dcd5edd5d4 Version 1.25.34. 1.25.34 2014-02-12 22:52:53 +00:00
Pino Toscano
3d4cc3cf57 mllib: hostname: add a newline in /etc/hostname
/etc/hostname usually has an ending newline, so add it when changing it.
2014-02-12 18:48:08 +01: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
d70ceb4cbe list-filesystems: Do not segfault if guestfs_btrfs_subvolume_list returns an error (RHBZ#1064008).
If calling guestfs_list_filesystems with a disk image containing a
corrupt btrfs volume, the library would segfault.  There was a missing
check for a NULL return from guestfs_btrfs_subvolume_list.

This adds a check, returning the real error up through the stack and
out of guestfs_list_filesystems.

This is potentially a denial of service if processing disk images from
untrusted sources, but is not exploitable.

Thanks: Jeff Bastian for reporting the bug.
2014-02-11 20:14:01 +00:00
Pino Toscano
76e3e15d03 builder: do a copy when downloading local files
Instead of spawning curl even to "download" file:// URIs, just copy
them.
2014-02-11 12:52:10 +01:00
Pino Toscano
ba3569704c builder: prepare for different per-protocol download actions
Small refactor of Downloader.download_to to allow different download
actions depending on the protocol of the URI (which is now parsed).

No actual behaviour changes, just mostly code motion.
2014-02-11 12:39:56 +01:00
Pino Toscano
c66cec6ffa builder: isolate C libraries in an own OCAMLCLIBS
Just moving stuff within Makefile.am, no functional changes.
2014-02-11 10:40:31 +01:00
Pino Toscano
a948389ce9 actions/part_set_gpt_type: set type of "guid" parameter as "GUID" (RHBZ#1008417).
Switch the type of the "guid" parameter from "String" to "GUID"; this
adds the validation of the GUID as such, rejecting straight away invalid
GUIDs which otherwise could be handled badly by low-level tools (such as
sgdisk).

Add a couple of easy tests (taken from RHBZ#1008417) to
part_set_gpt_type about this.
2014-02-10 11:00:09 +01:00
Pino Toscano
775cad63a3 generator: generate code for parameter validation
Implemented only in the C output, since every binding uses it anyway,
and just for the "GUID" type (since its format is well-known).
2014-02-06 20:02:51 +01:00
Pino Toscano
b10dd601fb generator: add a GUID parameter type
At the moment it is basically the change as String, and it is mapped as
if it was such.
2014-02-06 17:43:04 +01:00
Pino Toscano
beef77403c utils: add a function to validate a GUID string 2014-02-06 15:57:09 +01:00
Richard W.M. Jones
ed912a54d6 libguestfs-make-fixed-appliance: All supported versions of libguestfs should work.
We're not supporting anything < 1.20 now.
2014-02-05 19:39:28 +00:00
Richard W.M. Jones
758d021b41 Version 1.25.33. 1.25.33 2014-02-05 15:18:49 +00:00
Pino Toscano
798b539a1f appliance/init: provide a symlink /var/lock
Provide /var/lock as symlink to /run/lock, as it might be used by
applications.
2014-02-05 11:42:17 +01:00
Pino Toscano
59eb9bff87 resize: preserve GPT partition names (RHBZ#1060404).
Save the partition names/labels of the source partitions, and restore
them after the partition copy.
2014-02-04 15:54:44 +01:00
Pino Toscano
820b870167 New API: part-get-name (RHBZ#593511).
Counterpart of part-set-name, it uses sgdisk (hence needs the "gdisk"
feature) to query for the label/name of a partition in a GPT layout.
2014-02-04 15:54:44 +01:00
Pino Toscano
78c21ce912 daemon: parted: refactor sgdisk info parsing code
Isolate in an own function the code that runs sgdisk and parse a field
of it (using an extraction function passed as parameter), using it for
the GUID type.

This is just code motion, no actual behaviour changes.
2014-02-04 15:54:44 +01:00
Richard W.M. Jones
170b64337d resize: Try to remove a few more _ -> .. cases.
This allows the compiler to catch missing cases more effectively,
especially if we update the types with more cases in future.
2014-02-04 13:27:34 +00:00
Pino Toscano
ef7ac043a6 resize: properly restore GPT partition types
If there is a GPT partition layout, then what should be read and
restored for each partition is the GPT type and not the MBR ID.

Related to RHBZ#1060404.
2014-02-04 13:32:28 +01:00
Richard W.M. Jones
eab810f778 Version 1.25.32. 1.25.32 2014-02-04 08:50:43 +00:00
Richard W.M. Jones
d5b540153f Remove bogus license file from daemon subdirectory.
It was left over from when the daemon was a separate autoconf
directory, and in any case the daemon has never been GPLv3 (it is
GPLv2+).
2014-02-03 13:57:33 +00:00
Richard W.M. Jones
d93e3c50eb fish: Additional GUESTFISH_* environment variables to control the prompt.
This adds:

 - GUESTFISH_INIT
 - GUESTFISH_OUTPUT
 - GUESTFISH_RESTORE

which along with existing GUESTFISH_PS1 allow you to fine control the
colour of the output.
2014-02-03 13:57:33 +00:00
Pino Toscano
bed8a168c0 builder: remove unused variables
Leftovers of the list_entries_short+list_entries_long split done in
commit 91aae893c7.
2014-01-30 17:06:42 +01:00
Pino Toscano
07ef60c63f builder: output translated notes
Output all the translations available for the notes in the "verbose"
output and the JSON output, while trying to match the system langauge in
the "show notes" output.

The JSON output is slightly changed to handle translations, with the
"untranslated" notes being matched as "C". The version is not bumped
though, since there have been no stable releases with the former output
yet.
2014-01-30 17:05:34 +01:00
Richard W.M. Jones
49014f81f3 sysprep: Deprecate --selinux-relabel in favour of --autorelabel.
virt-builder added a --selinux-relabel option with a slightly
different meaning.

This commit keeps the old --selinux-relabel / --no-selinux-relabel
options in virt-sysprep, but deprecates them and replaces them with
--autorelabel and --no-autorelabel.
2014-01-30 09:03:46 +00:00
Richard W.M. Jones
fc6d3e6a9a sysprep: Add a reference to virt-builder from the manual page.
The whole "COPYING AND CLONING" section really needs to be overhauled
too, but first we need to make virt-builder work properly for
customizing templates.
2014-01-30 09:03:46 +00:00
Richard W.M. Jones
5db1a28461 sysprep: Add --scrub option.
This works like the option in virt-builder with the same name.
2014-01-30 09:03:46 +00:00
Richard W.M. Jones
2595fa5069 builder: Move Perl_edit module into common code.
There is no functional change.
2014-01-29 14:04:40 +00:00
Richard W.M. Jones
c841d08d70 appliance: Create checksum file with mode 0644 instead of 0755.
Initial commit 4beb284409 used mode 0755
for no reason.  It seems to have been a mistake.
2014-01-29 09:31:24 +00:00
Richard W.M. Jones
f0f95bd038 perl: Data::Dumper and String::ShellQuote modules are no longer required.
They used to be used by old Perl virt-make-fs.  Nothing else uses
them.

This updates commit d3512deb67.
2014-01-29 08:45:19 +00:00
Richard W.M. Jones
32cbd7ca0d make-fs: Remove warning from man page about lone --partition argument.
C's getopt_long has no problem with this.
2014-01-29 08:20:38 +00:00
Richard W.M. Jones
a8a655a859 make-fs: Ensure --partition (on its own) creates an MBR partition.
This fixes commit d3512deb67.
2014-01-29 08:20:38 +00:00
Richard W.M. Jones
90d3378778 make-fs: Refactor debug stats code.
Code motion, no functional change.
2014-01-29 08:20:38 +00:00
Richard W.M. Jones
5bf8c81d7d make-fs: Use an anonymous pipe instead of a named pipe.
The previous translation from Perl slavishly followed the Perl code a
bit too much and used a named pipe to communicate between the
uncompressing subprocess and libguestfs tar-in.  From C we can use an
anonymous pipe instead.

This updates commit d3512deb67.
2014-01-29 08:20:18 +00:00
Richard W.M. Jones
c86fcc0fd4 make-fs: Make check-valgrind do something. 2014-01-29 08:00:55 +00:00
Richard W.M. Jones
f5bc913434 make-fs: Run virt-make-fs in test from builddir, not srcdir. 2014-01-29 08:00:30 +00:00
Richard W.M. Jones
59fce974e2 pod: Remove stray +x (executable) mode on various POD files.
find -name '*.pod' -perm /0111 -exec chmod -x {} \;
2014-01-28 22:17:12 +00:00
Richard W.M. Jones
1771e1f2b2 Version 1.25.31. 1.25.31 2014-01-28 22:10:25 +00:00
Richard W.M. Jones
233d5410e5 sysprep: Add script4.sh (test script) to EXTRA_DIST.
This fixes commit ce9d4d335b.
2014-01-28 21:56:18 +00:00
Richard W.M. Jones
dc91bf7231 Version 1.25.30. 1.25.30 2014-01-28 21:02:13 +00:00
Richard W.M. Jones
642cf4c5dc tests: Test --label and other options in virt-make-fs. 2014-01-28 21:02:11 +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
40512c66af daemon: Always pass -F option to mkfs.ntfs.
Otherwise it moans about:

  mkfs: ntfs: /dev/sda: /dev/sda is entire device, not just one partition.
  Refusing to make a filesystem here!

This has been happening for a while, so I don't know why we didn't
notice it before.  It even happens on RHEL 6.

A simple reproducer is:

  virt-make-fs -t ntfs any-tarball.tar.gz test.img
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
a594b7f90a sparsify: Use new disk-create API instead of calling qemu-img.
disk-create doesn't support the lazy_refcounts option.
2014-01-28 21:02:11 +00:00