Commit Graph

10855 Commits

Author SHA1 Message Date
Pino Toscano
4d51045721 RHEL 8: use platform-python
Use the stable platform-python provided in BaseOS, instead of relying on
some arbitrary version installed by the user.
2020-03-17 10:35:02 +01:00
Pino Toscano
3215d62796 RHEL 8: use "python3" as nbdkit plugin
RHEL uses "python3" as name for the nbdkit Python plugin.
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
d4d45f4a8a RHEL 8: v2v: rhv-upload: Remove restriction on -oa sparse.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1565681
and the v2v-devel private thread "Do we already support migration using FC?"
2020-03-17 10:35:02 +01:00
Pino Toscano
845411f894 RHEL 8: v2v: disable unconfig of manually installed VMware tools (RHBZ#1477905)
It looks like they may require connection to the VMware servers, which
is not always available during conversion.
2020-03-17 10:35:02 +01:00
Pino Toscano
cc23a548b3 RHEL 8: v2v: do not mention SUSE Xen hosts (RHBZ#1430203)
They are not supported in RHEL 8.
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
c3cfa86f7d RHEL 8: v2v: -i disk: force VNC as display (RHBZ#1372671)
The SDL output mode is not supported in RHEL 8's qemu-kvm.
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
a5c71228ad RHEL 8: v2v: Disable the virt-v2v --in-place option.
This disables the virt-v2v --in-place option which we do not
wish to support in RHEL.
(See commit d0069559a9).
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
6d2111990e RHEL 8: tests: Disable daemon tests that require the 'unix' backend. 2020-03-17 10:35:02 +01:00
Richard W.M. Jones
c7b66cf226 RHEL 8: Revert "v2v: Add a support matrix to the manual page."
This reverts commit a03bffa15a.
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
341b3d7f32 RHEL 8: Fix tests for libguestfs-winsupport.
It doesn't let us use guestfish for arbitrary Windows edits.
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
483521478f RHEL 8: Reject use of libguestfs-winsupport features except for virt-* tools (RHBZ#1240276). 2020-03-17 10:35:02 +01:00
Richard W.M. Jones
c35eb71d36 RHEL 8: Fix list of supported sound cards to match RHEL qemu (RHBZ#1176493). 2020-03-17 10:35:02 +01:00
Pino Toscano
78fcc7f7e2 RHEL 8: Disable alternate Augeas lenses.
These are included in the RHEL augeas package, and therefore not
required.

See:
https://www.redhat.com/archives/libguestfs/2014-October/msg00220.html
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
ccae901c09 RHEL 8: v2v: Disable the --qemu-boot option (RHBZ#1147313).
This cannot work because there is no Gtk or SDL output mode
in RHEL 8's qemu-kvm.

In addition you will have to edit the -display option in the
qemu script.
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
9958049459 RHEL 8: v2v: Select correct qemu binary for -o qemu mode (RHBZ#1147313).
RHEL 8 does not have qemu-system-x86_64 (etc), and in addition the
qemu binary is located in /usr/libexec.  Encode the path to this
binary directly in the script.

Note that we don't support people running qemu directly like this.
It's just for quick testing of converted VMs, and to help us with
support cases.
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
e1fc009aa1 RHEL 8: Remove User-Mode Linux (RHBZ#1144197).
This isn't supported in RHEL 8.
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
7dd52c8769 RHEL 8: Disable unsupported remote drive protocols (RHBZ#962113).
This disables support for unsupported remote drive protocols:

 * ftp
 * ftps
 * http
 * https
 * tftp
 * gluster
 * iscsi
 * sheepdog
 * ssh

Note 'nbd' is not disabled, and of course 'file' works.

We hope to gradually add some of these back over the lifetime of RHEL 8.
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
17b31e1fad RHEL 8: Remove 9p APIs from RHEL (RHBZ#921710). 2020-03-17 10:35:02 +01:00
Richard W.M. Jones
c2336f8c9e RHEL 8: Remove libguestfs live (RHBZ#798980).
This isn't supported in RHEL 8.
2020-03-17 10:35:02 +01:00
Richard W.M. Jones
4591419929 lib: Use qemu-img info -U option to avoid locking error.
https://bugs.launchpad.net/qemu/+bug/1740364
(cherry picked from commit f00f920ad3)
2020-03-17 10:34:52 +01:00
Richard W.M. Jones
06e5cfb90b v2v: -i vmx: Use scp -T option if available to unbreak scp (RHBZ#1733168).
Tested using:

cd v2v
LIBGUESTFS_BACKEND=direct ../run virt-v2v -i vmx -it ssh "ssh://localhost/$PWD/test-v2v-i-vmx-1.vmx" -o null -v -x

and manually examining the debug output.

Thanks: Ming Xie, Jakub Jelen.
(cherry picked from commit 7692c31494)
2019-08-08 14:58:56 +02:00
Martin Kletzander
c7942097bf Use proper label for nbdkit sockets
While svirt_t can be used for sockets it does not always guarantee that it will
be accessible from a virtual machine.  The VM might be running under svirt_tcg_t
context which will need a svirt_tcg_t label on the socket in order to access it.

There is, however, another label, svirt_socket_t, which is accessible from
virt_domain:

  # sesearch -A -s svirt_t -c unix_stream_socket -p connectto
  ...
  allow virt_domain svirt_socket_t:unix_stream_socket { ... connectto ... };
  ...

And virt_domain is a type attribute of both svirt_t and svirt_tcg_t:

  # seinfo -x -a virt_domain
  Type Attributes: 1
     attribute virt_domain;
          svirt_t
          svirt_tcg_t

Resolves: https://bugzilla.redhat.com/1698437

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
(cherry picked from commit c2918b8b74)
2019-06-05 08:12:55 +02:00
Pino Toscano
6ea20c9a03 v2v: update documentation on nbdkit (RHBZ#1605242)
nbdkit >= 1.6 ships a VDDK plugin always built, so recommend that
version instead of recommending to build nbdkit from sources.

(cherry picked from commit 0704d8eb0b)
2019-06-05 08:08:50 +02:00
Pino Toscano
751afe91e0 inspect: fix inspection of partition-less devices (RHBZ#1661038)
When parsing "xdev"-kind devices, do not assume that the partition
number can be converted to integer: re_xdev accepts an empty part of the
partition number, so just handle as it is, as string.

This fixes a regression due to the conversion of the inspection code to
OCaml, as the old C version did not have this issue.

(cherry picked from commit cf6b527824)
2019-04-11 16:39:57 +02:00
Pino Toscano
31af609ecc inspect: fix icon of RHEL
Use a better icon for RHEL guests, still provided by redhat-logos (or
equivalent in downstream distributions), and which fits a better
definition of logo for the distribution.

Thanks to Ray Strode for the hints.

(cherry picked from commit c648052690)
2019-04-11 16:23:02 +02:00
Richard W.M. Jones
66a40516a2 Revert "launch: libvirt: Use qemu-bridge-helper to implement a full network (RHBZ#1148012)."
We've been carrying this exact patch in RHEL 7 for several years.  It
reverts the change made in 2014 where we switched to using the virbr0
bridge for libguestfs networking instead of SLIRP.  We thought SLIRP
was going to become unsupported in qemu, but recently there have been
more encouraging signs since it looks like SLIRP will be spun off as a
separate project, running as a modular process and properly secured
and supported.

This reverts commit 224de20b9a.

(cherry picked from commit 492a945791)
2019-01-23 17:11:30 +01:00
Pino Toscano
f4c25f88b1 python: change types for RBufferOut/FBuffer with Python 3 (RHBZ#1661871)
So far RBufferOut return values, and FBuffer struct fields are 'str' on
all the versions of Python.  Python 3 distinguishes between 'str'
(unicode strings), and 'bytes', with 'str' no more able to hold
arbitrary data.

For this reason, switch the return value of RBufferOut functions, and
FBuffer struct fields to bytes on Python 3: while this is a potentially
incompatibile change, this is the only way to handle safely sequences
of arbitrary bytes.

(cherry picked from commit 0ee02e0117)
2019-01-23 17:11:25 +01:00
Pino Toscano
da45c7c305 python: fix call of Python handlers of events
Make sure to reference the arguments, to make sure they are kept alive
during the function call; this is visible when setting an event handler
for the CLOSE event, and testing it with Python 3.

This does not seem to create a memory leak e.g. with Python 2.

Also, switch away from the quasi-internal PyEval_CallObject to the
public PyObject_CallObject, which takes care of doing safety checks.

(cherry picked from commit 85235aec83)
2019-01-23 17:11:16 +01:00
Pino Toscano
c5460f73b8 v2v: further doc update for VMware roles
Remove "Allow virtual machine download", added with
commit 37955f14aa, because it does not
seem to be actually needed.

Related: RHBZ#1530967
(cherry picked from commit 5e5896752e)
2019-01-10 14:23:47 +01:00
Pino Toscano
6e71dcc1c9 v2v: -o rhv-upload: decouple name of nbdkit python plugin
Do not assume that the Python plugin of nbdkit has the same name of the
Python interpreter.

Use the default upstream name of nbdkit to identify it; downstream
distributions must adjust this variable, in case they rename the Python
plugin of nbdkit.

(cherry picked from commit 6b80c5fb51)
2018-12-16 16:29:29 +01:00
Pino Toscano
10bff3240c v2v: update docs for VMware roles (RHBZ#1530967)
Update the list of permissions needed for VMware vCenter 6.5.

(cherry picked from commit 37955f14aa)
2018-12-16 16:23:06 +01:00
Pino Toscano
c9b55904a0 inspect: handle os-release "opensuse-tumbleweed" as opensuse
Followup of commit 70407cd622 for openSUSE
Thumbleweed.

(cherry picked from commit 28bd06227b)
2018-12-12 11:39:12 +01:00
Richard W.M. Jones
1e72a13be2 inspection: Parse os-release "opensuse-leap" as opensuse (RHBZ#1634248).
(cherry picked from commit 70407cd622)
2018-12-12 11:39:01 +01:00
Pino Toscano
e003f5b8e7 v2v: linux: improve regex for resume= entries (RHBZ#1651987)
Add few more characters for the devices of resume= entries in the
command line of grub: this way it is possible to match also /dev/mapper
devices.

This should require no further processing, since the names of the
/dev/mapper devices do not change after the conversion.

(cherry picked from commit 50b08fd84b)
2018-12-12 11:38:33 +01:00
Richard W.M. Jones
e4ba4ed8bb v2v: docs: Remove sentence about supporting qemu-kvm-rhev in RHEL (RHBZ#1651977).
The previous support documentation said that for UEFI guests, when
using RHEL ≥ 7.3 host, you must use qemu-kvm-rhev.  For RHEL 8 this is
inaccurate since qemu-kvm-rhev no longer exists.

To fix this I've dropped the whole sentence.  It only applies to the
downstream product (RHEL) and so RHEL can add the right documentation
if it needs to.

Thanks: Ming Xie, Pino Toscano.
(cherry picked from commit 0e6bbcee7e)
2018-12-04 12:12:55 +01:00
Richard W.M. Jones
4d78c436b1 v2v: docs: Describe support for SHA-2 certs for Windows 7 / 2008 R2 (RHBZ#1624878).
Thanks: Yan Vugenfirer.
(cherry picked from commit 741ef228cd)
2018-12-04 12:08:52 +01:00
Richard W.M. Jones
8a4072c4b1 v2v: windows: Fix rhev-apt command line (RHBZ#1624902).
See:
https://bugzilla.redhat.com/show_bug.cgi?id=1584678#c15

Fixes commit bcdbe6405c.  However this
bug was copied directly from old virt-v2v which did the same thing
(from lib/Sys/VirtConvert/Converter/Windows.pm):

  echo installing rhev-apt >>log.txt
  "rhev-apt.exe" /S /v /qn >>log.txt

Thanks: Lev Veyde
(cherry picked from commit e12c56176a)
2018-12-04 12:06:37 +01:00
Richard W.M. Jones
81f35e441d v2v: Model machine type explicitly.
QEMU for x86 supports two machine types, "pc" (emulating the ancient
Intel i440FX chipset originally used by the Pentium Pro), and "q35"
(https://wiki.qemu.org/Features/Q35).

Currently virt-v2v does not set any machine type, so libvirt or the
target hypervisor will choose some default, probably i440fx.  The
latest advice from the QEMU and libvirt communities is not to rely on
the default machine type but to specify what we need explicitly, but
it may also be that the libvirt configuration file has been changed to
set the default machine type to Q35 (either by the distro or the end
user).

None of this matters for reasonably new guests since they can boot
with either chipset.  However there are some very old guests (notably
Windows XP) which cannot handle Q35.

This commit changes virt-v2v so it always tries to specify the machine
type explicitly (assuming the target supports that, and not all of
them do).  For x86_64 guests this patch always selects i440fx (pc).
In future we hope to get the correct machine type for the guest from
libosinfo but this is not available yet.

For non-x86 architectures we select the "virt" model which will
probably only work for AArch64.  More work is needed for POWER.

For secure boot we still have to force the machine type to Q35.  In a
future version this forcing can be removed since any guest which is
using secure boot will be new enough that it'll be using Q35 anyway
(on x86).

(cherry picked from commit 55879b2f2c)
2018-10-05 10:59:35 +02:00
Pino Toscano
57ed1fc428 ocaml: make sure to pass LDFLAGS to ocamlmklibs linker (RHBZ#1624130)
Pass the LDFLAGS properly as arguments for the C linker when using
ocamlmklibs via the -ldopt option.

Followup of commit 34c23403c5.

(cherry picked from commit 4ff573c352)
2018-09-27 16:09:58 +02:00
Richard W.M. Jones
7423e43ec2 tools: Ensure CFLAGS and LDFLAGS are passed to all OCaml binaries (RHBZ#1624130).
After this commit, all annocheck errors are fixed except for:

  Hardened: virt-get-kernel: MAYB: Gaps were detected in the annobin coverage.  Run with -v to list.

After discussion with the annocheck maintainers this gap in coverage
(which corresponds to the OCaml runtime) seems to be caused either by
the runtime not being linked with the right flags, or might be a bug
in annocheck itself.  In any case it's not something that can be
resolved within the scope of libguestfs.

(cherry picked from commit 34c23403c5)
2018-09-27 10:06:56 +02:00
Richard W.M. Jones
81a9e4f428 tools: Link OCaml programs with -runtime-variant _pic if available.
OCaml has a small runtime which is statically linked into the virt
tools (providing things like GC and primitives).  Since OCaml 4.03 it
has been possible to select variants of this runtime, one of which is
compiled with -fPIC, using ‘ocamlopt -runtime-variant _pic’.

This has performance implications on i686, but is relatively free on
other architectures.  Since it (in theory) adds to the security of the
final binary this commit enables it whenever it is available.

(cherry picked from commit 09abb9c990)
2018-09-27 10:06:43 +02:00
Richard W.M. Jones
8be6817e95 ppc64le: Don't use -cpu parameter under any circumstances (RHBZ#1605071).
(cherry picked from commit 56318f0b5f)
2018-09-05 13:57:29 +02:00
Richard W.M. Jones
739ac1bc0f v2v: -o rhv-upload: Properly replace SD_UUID in OVF (RHBZ#1612653).
The @SD_UUID@ pattern was not being replaced correctly.

Thanks: Daniel Erez.
(cherry picked from commit 389e165519)
2018-08-22 12:10:06 +02:00
Richard W.M. Jones
6f116349a2 v2v: -o rhv-upload: Fix error message disk numbering (RHBZ#1615885).
The output method used the s_disk_id field assuming it was a unique,
monotonically increasing number counting from 0.  However this is not
the case, the input method simply has to set s_disk_id to be unique
for each disk.

Fixes commit cc04573927.

Thanks: Xiaodai Wang
(cherry picked from commit 90c9c12258)
2018-08-22 12:09:40 +02:00
Pino Toscano
bb804081e9 v2v: parse_libvirt_xml: handle srN CDROM devices (RHBZ#1612785)
This device naming is mostly written by virt-p2v, so get the slot from
it directly without using the drive_index "decoding" function.

(cherry picked from commit c9abaa3e96)
2018-08-22 12:09:20 +02:00
Pino Toscano
21cf4aaafb uefi: remove last references to kraxel's old edk2 builds
Commit 889386f8c6 removed most of them
already, so remove the last ones, and the supporting code.
2018-08-09 16:27:48 +02:00
Daniel Erez
bc2ba2f47b v2v: rhv plugin - case-sensitive search queries
Changed both search queries to case-sensitive (to ensure an exact match).
2018-08-09 16:26:58 +02:00
Daniel Erez
c0f9ab6665 v2v: rhv plugin - fix DC search string
Search for DC by 'storage.name=' to make it explicit.
I.e. "storage=" uses regex, so similar names can be
found in the search query. For example, searching for
a domain named FCSD, will find FCSD1 as well.
2018-08-09 16:26:58 +02:00
Pino Toscano
bb6b81861e v2v: -o rhv-upload: check for ovirtsdk4 (RHBZ#1601943)
Check earlier whether the ovirtsdk4 Python can be imported correctly,
to avoid errors later on during the migration.
2018-08-09 16:26:58 +02:00
Pino Toscano
77604b91ec v2v: change QXL ResourceType in OVirt flavour (RHBZ#1598715)
Due to a conflict with the IDs of the OVF standard, and the existing
implementation in ovirt-engine, the ID of QXL devices changed to a
different value.

As a consequence, change the ResourceType of QXL devices, but only in
OVirt flavour to avoid breaking vdsm mode.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1598715#c5
(cherry picked from commit aa9e18f6d1)
2018-08-09 16:26:58 +02:00