12164 Commits

Author SHA1 Message Date
Richard W.M. Jones
69002dccc2 Version 2.7.2. v2.7.2 2024-11-18 14:37:20 +00:00
Richard W.M. Jones
902cf78966 -i libvirt: Parse UEFI secureboot flag from libvirt XML
Link: https://libvirt.org/kbase/secureboot.html
Related: https://issues.redhat.com/browse/RHEL-67836
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2024-11-18 14:26:50 +00:00
Richard W.M. Jones
edbbf51200 -o libvirt: Remove incorrect comment about secure boot
Fixes: commit 095bf10035914a75aac574185afb54de1e68c895
2024-11-15 15:04:11 +00:00
Richard W.M. Jones
3f66551de0 -o libvirt: Add full <firmware/> section
https://libvirt.org/kbase/secureboot.html

Thanks: Daniel Berrange, Andrea Bolognani
Reported-by: Ming Xie
Fixes: https://issues.redhat.com/browse/RHEL-67007
2024-11-15 15:01:07 +00:00
Richard W.M. Jones
35f96251fd -i vmx: Parse uefi.secureBoot.enabled from vmx file
Fixes: https://issues.redhat.com/browse/RHEL-67007
Reported-by: Ming Xie
2024-11-15 14:50:25 +00:00
Richard W.M. Jones
d46ceba1bd lib, input: Model UEFI secureboot property in metadata
This models a UEFI NVRAM variable which controls whether or not EFI
binary signatures are verified, which is an initial step in the long
chain of operations commonly known as "secure boot".  I added plenty
of documentation explaining what this really means as it is
non-obvious.

Thanks: Daniel Berrange, Andrea Bolognani
2024-11-15 14:50:25 +00:00
Richard W.M. Jones
d4c2e91958 -o qemu: Remove confusing comment about smm
SMM is only a small part of enabling secure boot, so remove this
comment.  Probably we don't need to use smm=on at all since it may be
enabled implicitly by other SB features.
2024-11-15 14:39:34 +00:00
Richard W.M. Jones
e09aaad7e7 -o qemu: Add set -e, -x at the top of the output script
This adds:

  set -e
  #set -x

The second command is commented so that users can enable it if they
want to see the output.
2024-11-15 14:16:05 +00:00
Richard W.M. Jones
69b4e83935 -o qemu: Replace hard-coded UEFI paths
Update the qemu shell script to simply find the UEFI paths as
required.

Remove lib/uefi.ml:find_uefi_firmware as this function is no longer
needed.

Remove common/mlv2v/ everywhere.  This contained a list of UEFI code
and NVRAM files which is no longer used.

Update common submodule.  This pulls in:

  Richard W.M. Jones (5):
      mlcustomize/customize_run.ml: Move 'in' to new line
      mlstdutils/guestfs_config: Define host_os
      mlcustomize, mltools: Check guest OS is compatible before allowing --run
      Remove mlv2v/ subdirectory
      qemuopts: Add ability to add raw, unquoted output to qemu scripts
      qemuopts: Fix missing break statement
2024-11-15 14:15:57 +00:00
Richard W.M. Jones
9cb7606904 -i libvirt: Trim whitespace around name
In -i libvirt / -i libvirtxml we didn't trim whitespace
around the name, so:

  <name> foo </name>

would set the input name to the literal string " foo ".
2024-11-15 14:01:03 +00:00
Richard W.M. Jones
de88b16622 v2v: Allow printing the checksum
Use <disk> ... <checksum method="sha256" fail="print" />

This doesn't check the checksum, it just computes and prints it.
2024-11-09 17:18:27 +00:00
Richard W.M. Jones
14f35e84f2 -i libvirtxml: Implement disk checksumming
It is not possible to specify an optional <checksum> field for each
disk.  This gives the expected checksum (to be supplied by some higher
level management tool), and virt-v2v will verify that the checksum of
the actual disk presented matches the expected checksum.

 <domain type='kvm'>
   ...
   <devices>
     <disk type='file' device='disk'>
       <driver name='qemu' type='raw'/>
       <source file='/path/to/disk/image'/>
       <target dev='hda' bus='ide'/>
       <checksum method='md5' fail='warn'>
         a07aeb7de93e9b60d9155294cf332508
       </checksum>
     </disk>

 $ virt-v2v-in-place -i libvirtxml file.xml
 ...
 [   0.0] Checking md5 checksum of disk 1/2
 warning: bad checksum for disk 1/2
 Expected checksum: a07aeb7de93e9b60d9155294cf332508
 Actual checksum: e83009eb529a958875008103bb248017
2024-11-09 15:40:41 +00:00
Richard W.M. Jones
8b768fd9b1 in-place: Add a warning about checking the exit code 2024-10-30 15:40:40 +00:00
Richard W.M. Jones
8dd5577174 lib: OVF: Add preliminary support for Windows Server 2025
Unfortunately support has not yet been added to oVirt.  However I have
inferred the correct ostype value based on existing entries.

Also pull in the following commit from the common submodule:

  Richard W.M. Jones (1):
      mlcustomize: Add heuristic support for Windows Server 2025

Related: https://issues.redhat.com/browse/RHEL-65009
Related: https://issues.redhat.com/browse/RHEL-65010
Reported-by: Ming Xie
2024-10-30 10:18:02 +00:00
Richard W.M. Jones
0e4cdd164d Version 2.7.1. v2.7.1 2024-10-22 17:53:03 +01:00
Richard W.M. Jones
61e7fda980 build: Remove Jansson dependency
After previous changes, this library is no longer used.  We have
switched to json-c, for better compatibility with libvirt.

(cherry picked from
guestfs-tools commit e6dcf7e3a7e9170978e57ce6df1b34f92fac5ae3)
2024-10-22 15:26:52 +01:00
Richard W.M. Jones
325f5a2f20 v2v: Replace Jansson with json-c
We don't use Jansson explicitly, but used it implicitly wherever the
OCaml JSON_parser module is used.  This module was switched over to
using json-c.  Update the build dependencies accordingly.

Pulls in the following commit from the common submodule:

  Richard W.M. Jones (1):
      mltools: Replace jansson with json-c
2024-10-22 15:26:10 +01:00
Richard W.M. Jones
108eaf53a6 build: Add new dependency on json-c
This will eventually replace Jansson for all JSON parsing.  However
this commit simply introduces the new dependency in the configure
script and documents it.

I chose json-c 0.14 as the baseline since that is the version in RHEL 9.
Probably earlier versions would work.

(cherry picked from libguestfs commit 53872a0a1a267040677572c30b68bd1e8b62ebe3)
2024-10-22 11:03:52 +01:00
Richard W.M. Jones
97ad5c1054 build: Assume __attribute__((cleanup)) always works
All recent compilers support this (except MS compilers which we don't
care about).  Assume it is supported.  We test it in ./configure and
hard fail if it doesn't work.

We still define HAVE_ATTRIBUTE_CLEANUP but you can now assume it is
always defined and don't have to check it.

(cherry picked from libguestfs commit e37768d8892d6f467c7834f8b142b89f8f0af7dc)
2024-10-18 21:57:35 +01:00
Richard W.M. Jones
b4e3f7ce66 docs: Update upstream support page 2024-10-18 21:07:38 +01:00
Richard W.M. Jones
65be0c9050 Version 2.6.0. v2.6.0 2024-10-08 14:30:12 +01:00
Richard W.M. Jones
c7040978cb docs: Finalize release notes for virt-v2v 2.6 2024-10-08 13:41:00 +01:00
Richard W.M. Jones
574fe8b312 Version 2.5.11. v2.5.11 2024-10-03 13:02:29 +01:00
Richard W.M. Jones
f653b3d849 docs: Add outline release notes for virt-v2v 2.6 2024-10-03 12:31:20 +01:00
Richard W.M. Jones
83f4d06ae4 bugs-in-changelog.sh: Fix github issue tracker URL
Fixes: commit c992fcfdece6d8d7d2e333fd21a0dc31bfa1c623
2024-10-03 12:08:21 +01:00
Richard W.M. Jones
c992fcfdec bugs-in-changelog.sh: List Jira IDs and github issues in output
(cherry picked from libguestfs commit e97c6f59336f4bf2d710135710d41915052e0a53)
2024-10-02 18:08:27 +01:00
Richard W.M. Jones
28eca74579 Version 2.5.10. v2.5.10 2024-09-10 10:42:52 +01:00
Richard W.M. Jones
fa18f8ac16 output: -o kubevirt: Fix firmware section to match specification
The previous firmware section in Kubevirt YAML didn't match the
current specification.  Unclear if it matched a previous spec or if we
just guessed at the format.

After this change, for BIOS:

..
spec:
  template:
    spec:
      domain:
        firmware:
          bootloader:
            bios: {}
..

For UEFI:

..
spec:
  template:
    spec:
      domain:
        firmware:
          bootloader:
            efi:
              persistent: true
..

Link: https://kubevirt.io/api-reference/v1.3.1/definitions.html#_v1_firmware
Reported-by: Martin Necas
Fixes: https://issues.redhat.com/browse/RHEL-58065
2024-09-10 10:25:18 +01:00
Richard W.M. Jones
6b57c16140 lib: YAML: Fix empty dictionaries and lists
Another weird corner case in YAML is that empty dictionaries have a
special representation.  Empty lists also have a special
representation, that we got wrong.

Link: https://stackoverflow.com/a/33510095
2024-09-10 10:25:18 +01:00
Richard W.M. Jones
89ec5f9079 output/create_kubevirt_yaml.ml: Replace List [] with Assoc []
Previously several empty Kubevirt YAML nodes were represented as empty
lists (List []).  Our YAML generator incorrectly generated "{}" for
this, but this is the YAML for empty dictionary, not list.  However as
a consequence of two bugs cancelling out, this actually generated the
expected YAML.

Since we're going to fix the bug in our YAML generator, replace
List [] with Assoc [] so the output will remain the same.
2024-09-10 10:25:18 +01:00
Richard W.M. Jones
321c980348 output: -o kubevirt: Update comments with reference to latest spec
I looked through the latest specification
(https://kubevirt.io/api-reference/v1.3.1/definitions.html#_v1_acpi)
and updated comments as appropriate.  No actual change to the output.
2024-09-09 16:04:13 +01:00
Richard W.M. Jones
8df0d58903 inspector: Add <firmware type="bios|uefi"> to the output 2024-09-09 12:29:11 +01:00
Weblate Translation Memory
33717800c6 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (552 of 552 strings)

Translation: libguestfs/virt-v2v-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/uk/
2024-09-04 17:17:10 +01:00
Yuri Chornoivan
5b6fd11668 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (552 of 552 strings)

Translation: libguestfs/virt-v2v-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/uk/
2024-09-04 17:17:10 +01:00
Weblate Translation Memory
e618c18bf4 Translated using Weblate (Ukrainian)
Currently translated at 95.4% (527 of 552 strings)

Translation: libguestfs/virt-v2v-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/uk/
2024-09-03 15:54:38 +01:00
Yuri Chornoivan
e34f5c7e44 Translated using Weblate (Ukrainian)
Currently translated at 95.4% (527 of 552 strings)

Translation: libguestfs/virt-v2v-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/uk/
2024-09-03 15:54:38 +01:00
Weblate
a8587202db Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: libguestfs/virt-v2v-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-master/
2024-09-02 15:00:23 +01:00
Andi Chandler
00692c57b0 Translated using Weblate (English (United Kingdom))
Currently translated at 4.9% (65 of 1305 strings)

Translation: libguestfs/virt-v2v-docs-master
Translate-URL: https://translate.fedoraproject.org/projects/libguestfs/virt-v2v-docs-master/en_GB/
2024-09-02 15:00:23 +01:00
Richard W.M. Jones
4b39b7bd0f convert: Display osinfo in "Converting ..." message
eg:

[ 9.3] Converting Windows Server 2022 Phony Edition (win2k22) to run on KVM

Reported-by: Ming Xie
Fixes: https://issues.redhat.com/browse/RHEL-56784
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2024-08-31 09:40:21 +01:00
Richard W.M. Jones
413f5ccabf Version 2.5.9. v2.5.9 2024-08-29 15:29:06 +01:00
Richard W.M. Jones
950e82dfb7 convert: windows: Ignore sriov drivers on virtio-win disk
Update common submodule to get:

  Richard W.M. Jones (1):
      mlcustomize: Ignore sriov drivers on virtio-win disk
2024-08-29 15:09:41 +01:00
Richard W.M. Jones
67dd3de654 test-data/phony-guests: "Update" phony Windows to 2022 Server
For the phony Windows guest we used the registry information from a
32 bit Windows 7 instance.  This version of Windows is EOL.  Newer
Windows changed the versioning scheme so we now use the build ID to
distinguish between versions, but we have not tested this in virt-v2v
upstream before.

I grabbed HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
from a real 64 bit Windows 2022 Server instance, minus identifying strings.

Various tests had to be updated because they contained references to
Windows 7, or because virtio-win contains more drivers for Windows
2022.
2024-08-29 15:09:10 +01:00
Richard W.M. Jones
2e78fb4d10 output/create_libvirt_xml.ml: Hard-code libosinfo URL for W2K22
Also add a comment that we ought to get this from the libosinfo
information provided by libguestfs.  I'm not sure why we aren't doing
that already.
2024-08-29 15:09:10 +01:00
Richard W.M. Jones
9b69cde051 po-docs: Update podfiles
Adds the two v2v-customize-*.pod snippets.

Also update the common submodule to get:

  Richard W.M. Jones (1):
      mlcustomize: Include v2v-customize-*.pod in EXTRA_DIST

Updates: commit f720aff7d690ead787b2ec9d4dabdff2b2923efd
2024-08-29 15:08:42 +01:00
Richard W.M. Jones
cb56f6f94d convert: windows: Online all virtio disks at first boot
Windows 2022 (and possibly earlier versions back to around 2019) will
force offline any non-boot disks which change bus, apparently as a
security mitigation.  The effect of this is that although the system
drive (C:) is present after conversion, other drives may seem to
disappear.

Running a Powershell script to bring all disks online seems risky.
The compromise is to bring online only virtio disks at first boot.

To further reduce risk, we only do this if there are non-system disks
(ie. > 1 disks in total), and only if we installed virtio drivers.

Fixes: https://issues.redhat.com/browse/RHEL-55763
Fixes: https://issues.redhat.com/browse/RHEL-55837
Related: https://issues.redhat.com/browse/MTV-1299
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1662286
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Thanks: Martin Necas
Acked-by: Martin Necas
2024-08-27 13:19:36 +01:00
Richard W.M. Jones
aa91135688 tests: Add a test of customizing a VM during conversion
Updates: commit ade62ebdb50e32a05c336ffcf4c08c6996a3af36
2024-08-20 21:32:54 +01:00
Richard W.M. Jones
f720aff7d6 v2v: Don't include virt-customize --inject* options
Commit ade62ebdb5 ("v2v: Add support for virt-customize options")
included --inject* options that covered facilities for injecting QEMU
guest agent etc which are already part of virt-v2v.  We shouldn't add
the options for that.

The generator in libguestfs was changed so we can now exclude those
options from virt-v2v.

Update common submodule to include:

Richard W.M. Jones (1):
      mlcustomize: Update generated options for virt-v2v

Fixes: commit ade62ebdb50e32a05c336ffcf4c08c6996a3af36
2024-08-20 21:24:00 +01:00
Richard W.M. Jones
170d6ba42e Version 2.5.8. v2.5.8 2024-08-20 12:07:40 +01:00
Richard W.M. Jones
ade62ebdb5 v2v: Add support for virt-customize options
For higher level tools making further arbitrary changes to the guest
post-conversion, especially adding more firstboot scripts, it's useful
if we have various features from virt-customize.  Particularly the
ability to upload and run scripts.  Since we have the virt-customize
code in the common/ submodule, the easiest thing to do is to add the
virt-customize options, the same way it is done in virt-builder and
virt-sysprep.

Also updates the common submodule to get:

Richard W.M. Jones (1):
      mlcustomize: Move virt-customize modules to mlcustomize/
2024-08-20 11:46:31 +01:00
Richard W.M. Jones
373ee61ab5 convert: Move SELinux relabelling step to common conversion code
Simple code motion.  SELinux relabelling is a no-op for
non-Linux/non-SELinux guests.
2024-08-20 10:14:06 +01:00