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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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>
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).
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.
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.
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.
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.
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.
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.