Commit Graph

8706 Commits

Author SHA1 Message Date
Pino Toscano
fa262e2540 btrfs: fix wrapping in message in btrfs_minimum_size 2016-01-27 13:29:16 +01:00
Richard W.M. Jones
3aaa4c9419 p2v: virt-p2v-make-disk: Make os-version parameter optional.
Having to choose the os-version of the virt-p2v disk was confusing.
Users thought it had something to do with the physical machine being
converted.

In some cases, virt-p2v-make-disk can now choose a suitable os-version
for the user.  Usually it's the latest numeric version of Fedora or
Debian, depending on the host distro.  If we don't recognize the host
distro, we bail and ask the user to choose, but this is still an
improvement.
2016-01-27 11:54:09 +00:00
Richard W.M. Jones
42f8c6e3bd p2v: Use $program consistently in virt-p2v-make-disk script. 2016-01-27 11:48:17 +00:00
Richard W.M. Jones
c3ad944555 p2v: Fix typo in virt-p2v-make-disk manual page. 2016-01-27 11:38:09 +00:00
Richard W.M. Jones
683dd5cbab docs: Refresh the guestfs-testing(1) man page.
Require libguestfs >= 1.22.  Testing ancient versions isn't useful.

Add a virt-builder test section.
2016-01-26 22:18:42 +00:00
Richard W.M. Jones
09e29a70e7 docs: Fix headings in guestfs-security(1). 2016-01-26 21:49:04 +00:00
Richard W.M. Jones
e96df6e776 docs: Add security contact information. 2016-01-26 21:45:17 +00:00
Richard W.M. Jones
1b4de75cb0 docs: Refactor list of manual pages in guestfs(3). 2016-01-26 21:38:12 +00:00
Richard W.M. Jones
1b3d3a3589 customize: Remove "useless" sprintf.
Actually the OCaml compiler rewrites all printf functions at compile
time to a series of primitive string operations, so the use of sprintf
here doesn't really matter.  Still, it's a bit tidier not to use
sprintf where it's not needed.

Also this commit contains some code reformatting.

This is just refactoring.
2016-01-26 21:26:23 +00:00
Richard W.M. Jones
81ff8c5d23 p2v: User can click on an interface name to identify the physical interface.
When the user clicks on the second column of the list of network
interfaces, run 'ethtool --identify <if_name> 10', which (on supported
cards) flashes a light on the physical interface for 10 seconds,
allowing it to be identified by the operator.
2016-01-26 17:54:20 +00:00
Richard W.M. Jones
4470f0483b customize: Add support for the APK (Alpine Linux) package manager. 2016-01-26 17:54:20 +00:00
Pino Toscano
7adb8ffa61 inspect: resolve symlinks when detecting architecture
Resolve the paths of the binaries we are looking in the guest to
identify the architecture. This way we can identify also busybox-based
guests such as Alpine Linux, where all the "base" binaries in /bin are
symlinks to busybox.
2016-01-26 17:54:20 +00:00
Richard W.M. Jones
302bba4f3f Version 1.33.5. 1.33.5 2016-01-26 14:04:38 +00:00
Pino Toscano
5aa26e76ea daemon: fold xfs_admin stdout to stderr
Apparent newer versions of that report everything on stdout, including
error messages; since we only print something on failure, fold stdout to
stderr so we can see everything on failure.
2016-01-26 11:25:54 +01:00
Pino Toscano
1d0bd79c08 xfs_admin: do not set lazycounter in tests not checking that
This flag cannot be disabled (yet) in V5 xfs filesystems; since 2 out
of the current 3 tests of xfs_admin check other results than that flag,
avoid setting it when not needed.
2016-01-26 11:23:25 +01:00
Pino Toscano
d2a36f8cbe daemon: improve debugging for "stdout on stderr" flag
When the COMMAND_FLAG_FOLD_STDOUT_ON_STDERR flag is passed to
command*(), indicate that as stdout=e in debugging message.
2016-01-26 11:21:46 +01:00
Pino Toscano
c22dea9871 btrfs_subvolume_show: fix root/toplevel check w/ btrfs-progs >= 4.4
In trfs-progs 4.4 the error message has been changed, and our check did
not work anymore.  Yes, parsing user messages really sucks...
2016-01-25 19:53:42 +01:00
Pino Toscano
08bf961d68 actions: expand partitions for btrfs_image test
Apparently with newer btrfs-progs (seen with 4.4) 100M are not enough
for a btrfs filesystem; hence double the size of the partitions
created in the test of btrfs_image, so now 200M are enough for btrfs.
2016-01-25 19:08:14 +01:00
Richard W.M. Jones
f2e201033a p2v: Use new miniexpect methods to access the handle fields. 2016-01-24 17:01:17 +00:00
Richard W.M. Jones
38edddb8e8 p2v: Resynch miniexpect with upstream.
Upstream miniexpect commit 3df4c0d3e4192cb6bb8e9ed7126346ab6aa98043.
2016-01-24 17:01:17 +00:00
Richard W.M. Jones
86ec266f22 p2v: Handle mexp_close returning -1 correctly.
If a system call fails, this function returns -1 and sets errno.  This
case was not handled correctly.
2016-01-24 17:01:16 +00:00
Richard W.M. Jones
b564e3682b arm: Remove all DTB (device tree) code.
In commit af762e4342 (2015-03-05)
I stopped libguestfs from using the supermin -dtb parameter when
building appliances.

It has not been necessary for quite a long time to specify a DTB,
since qemu itself creates a device tree structure in the guest
(appliance) memory from the devices presented to the guest.  Qemu does
this on the fly each time the guest starts.

As I promised in the commit mentioned above I would remove this code,
and this commit does that (for libguestfs only).
2016-01-22 22:23:25 +00:00
Richard W.M. Jones
1477c95da4 launch: libvirt: Reword an SELinux debug message. 2016-01-22 21:51:18 +00:00
Richard W.M. Jones
bf469bca13 launch: libvirt: Refactor destroy_domain function.
Small rewrite of commit 7e2f2b0b24.  No
functional change.
2016-01-22 21:48:16 +00:00
Richard W.M. Jones
2b9fda2f92 docs: Tested clang, and userspace probes now work. 2016-01-22 15:44:21 +00:00
Richard W.M. Jones
e3ff6507e9 Version 1.33.4. 1.33.4 2016-01-22 13:16:03 +00:00
Richard W.M. Jones
e23b44e2de daemon: Link with cleanups.c.
And remove the cleanup_* functions from guestfsd.c.

This fixes commit d94860d7e8.
2016-01-22 13:08:24 +00:00
Richard W.M. Jones
2cb8e5ddb8 Minor fixes to "daemon: Split out command* functions and CLEANUP_* macros."
This updates commit d94860d7e8.

Thanks: Pino Toscano.
2016-01-22 12:52:33 +00:00
Richard W.M. Jones
ac5fe225a9 Version 1.33.3. 1.33.3 2016-01-22 12:42:57 +00:00
Richard W.M. Jones
d94860d7e8 daemon: Split out command* functions and CLEANUP_* macros.
This allows the command* functions and CLEANUP_* macros to be used
independently from the daemon.
2016-01-22 09:12:17 +00:00
Richard W.M. Jones
b5066c67e0 daemon: Rename daemon/command.c -> daemon/sh.c.
Simply a file rename, no other change.
2016-01-21 14:25:44 +00:00
Richard W.M. Jones
550fdefc3c p2v: Display architecture in the About dialog. 2016-01-21 13:56:13 +00:00
Richard W.M. Jones
6d25ad48e5 p2v: virt-p2v-make-disk: Allow --arch parameter to be supplied.
This allows you to build a 32 bit virt-p2v USB key, even on a 64 bit
host.

Because of problems with the Fedora build system it's unfortunately
not easy to build a 32 bit virt-p2v binary, so this patch punts on
this issue and assumes that the user can supply the binary themselves.
2016-01-21 13:55:16 +00:00
Richard W.M. Jones
d5222a3ab9 p2v: Fix paths to data files in documentation. 2016-01-21 12:39:47 +00:00
Maxim Perevedentsev
e834b7413a New API: part_expand_gpt.
This action moves second(backup) GPT header to the end of the disk.
It is usable in in-place image expanding, since free space after
second GPT header is unusable. To use additional space, we have
to move second header. This is what sgdisk -e does.

However, sgdisk -e may perform additional actions if the partition
table has unexpected params (e.g. if we call sgdisk -e /dev/sda1,
it may fix partition table thus destroying the filesystem).
To prevent such cases, we do a dry-run at first and fail if
additional actions are scheduled.
2016-01-20 17:41:13 +00:00
Roman Kagan
390c68441a convert_windows: uninstall Parallels Tools on first boot
If present, Parallels Tools may stand in the way of proper running the
windows guests in non-Parallels hypervisors, so we're better off
uninstalling them on the first boot into the new environment.

With this patch, the uninstall records for Parallels Tools are looked up
in the registry and, if found, corresponding firstboot actions are
registered, taking special care that those actions are run fully
unattended.

Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
2016-01-20 17:33:24 +00:00
Richard W.M. Jones
e40acef864 Version 1.33.2. 1.33.2 2016-01-20 17:25:09 +00:00
Richard W.M. Jones
4a0905ac36 tests: regressions: Allow test-big-heap to work on machines with less memory.
This test would fail on machines with around 4 GB of free memory.
Adjust the test so it would now work on such machines (it will however
still fail on a machine with around 2 GB of free memory).
2016-01-20 17:05:53 +00:00
Richard W.M. Jones
ce5607895f docs: Add requirement on ncurses.
Previously missing from the requirements list.
2016-01-20 16:34:34 +00:00
Richard W.M. Jones
9310fabd26 docs: Add guestfs-building(1) man page.
This contains instructions for building libguestfs from source.
2016-01-20 13:42:38 +00:00
Richard W.M. Jones
50f838de31 p2v, v2v: Move HACKING documentation to guestfs-hacking(1) manual page. 2016-01-20 12:05:22 +00:00
Maxim Perevedentsev
dce3b4649d resize: preserve GPT disk GUID.
Changed disk GUID makes some OSes fail to boot.
To enable virt-resize to support such OSes we
have to preserve disk GUID.
2016-01-19 17:59:58 +00:00
Maxim Perevedentsev
1af51b9b02 New API: part_set_disk_guid_random.
Provides a way to set a new randomly-generated GUID to disk.
2016-01-19 17:59:58 +00:00
Maxim Perevedentsev
035936a038 New API: part_get_disk_guid and part_set_disk_guid.
Some OSes (e.g. Windows Server 2012 R2) fail to boot if the disk
GPT GUID has changed. To preserve disk guid e.g. during virt-resize,
we need a way to get/set disk GUIDs.
2016-01-19 17:59:58 +00:00
Richard W.M. Jones
7e2f2b0b24 lib: Handle slow USB devices more gracefully.
Libvirt has a fixed 15 second timeout for qemu to exit.  If qemu is
writing to a slow USB key, it can hang (in D state) for much longer
than this - many minutes usually.

The solution is to check specifically for the libvirt EBUSY error when
this happens, and retry the virDomainDestroyFlags operation
(indefinitely).

See also the description here:
https://www.redhat.com/archives/libvir-list/2016-January/msg00767.html

Similar to the following OpenStack Nova commit:
http://git.openstack.org/cgit/openstack/nova/commit/?id=3907867

Thanks: Kashyap Chamarthy and Daniel Berrange.
2016-01-19 17:59:58 +00:00
Richard W.M. Jones
c3ebc0a837 launch: libvirt: In error messages, display err->int1, don't display domain.
The err->domain field is essentially random from the point of view
of libguestfs.

The err->int1 field has some useful information in some circumstances:
it has the errno value from the failed system call.
2016-01-19 16:04:02 +00:00
Richard W.M. Jones
d029fa0507 Revert "p2v: virt-p2v-make-disk: Allow --arch parameter to be supplied."
This won't work unless we also build a 32 bit virt-p2v binary.

This reverts commit d723b352f8.
2016-01-19 16:04:02 +00:00
Pino Toscano
40b5698388 daemon: resolve paths for ll and llz
Resolve in the guest the given path, so absolute symlinks can be listed
using appliance tools without resolution errors.
Also remove the note about the possibility to escape the sysroot using
ll and llz, since realpath won't return paths outside sysroot.

Fixes part of RHBZ#1293276.
2016-01-19 09:46:20 +01:00
Richard W.M. Jones
3f376fa513 p2v: virt-p2v-make-disk: Use a more robust way to get the latest kernel version.
Fedora/i686 does not have a package called 'kernel', so the command
'rpm -q kernel' fails.  In any case the method used wasn't exactly
very robust.

The new method is based on how febootstrap used to do this.

This updates commit d723b352f8.
2016-01-18 17:44:12 +00:00
Maxim Perevedentsev
4a7b32a7e2 Add -f option to resize2fs -P in vfs_minimum_size.
Sometimes the user wants to know minimum size
for dirty (e.g. mounted) filesystems. In this case,
resize2fs -P will require calling e2fsck -f, while
"in general, it is not safe to run e2fsck on mounted filesystems".

Since resize2fs -P does not modify filesystem, we force it
to display (probably approximate) minimum size.
2016-01-18 16:49:18 +00:00