12180 Commits

Author SHA1 Message Date
Richard W.M. Jones
01322eea02 Version 2.7.4. v2.7.4 2024-12-09 17:38:27 +00:00
Richard W.M. Jones
2f0958e5ac in-place: Add new -O option to write inspector XML
When using virt-v2v-in-place there is no easy way to get the
post-conversion metadata, such as the operating system and firmware
that virt-v2v detected inside the guest.

This commit adds new, optional '-O output.xml' to write this
information out to a file.  The format is identical to
virt-v2v-inspector (and roughly a superset of virt-inspector).

Fixes: https://issues.redhat.com/browse/RHEL-58032
Thanks: Martin Necas
2024-12-07 18:39:36 +00:00
Richard W.M. Jones
7b43b226eb build: Define MLOBJECT (OCaml object file) as either cmo or cmx
This macro expands to either cmo or cmx depending on whether we are
compiling for bytecode or native code.

This is a natural extension of the existing MLARCHIVE macro.
2024-12-07 18:39:36 +00:00
Richard W.M. Jones
3d2d65a04a inspector: Move the code that creates XML output to a separate file
Simple code motion, so that we can reuse this code in
virt-v2v-in-place.
2024-12-07 18:39:36 +00:00
Richard W.M. Jones
755ce5dc08 v2v: Ensure --parallel >= 1
Fixes: commit fd1148f79581b148525eb12154aef7603ccf0baa
2024-12-07 18:39:36 +00:00
Richard W.M. Jones
8efb3ac064 inspector: Reorder -O option in alphabetical order
Updates: commit 0805ea93796b8b57e7c9f0bc04f83ea76a9820a5
2024-12-05 17:29:56 +00:00
Richard W.M. Jones
00bd17ceb1 in-place: Fix name of program in the --help output 2024-12-05 17:20:39 +00:00
Richard W.M. Jones
3b81441fdb docs: Embolden whole "-O -"
Since this is typed literally make sure the whole string is
emboldened, according to our usual style.
2024-12-05 15:25:12 +00:00
Richard W.M. Jones
d80c05a270 tests: Sort the tests into alphabetical order
The list of tests had grown organically over a very long time.

Also rename the "odd one out" rhbz* to test-rhbz*.
2024-12-05 15:25:12 +00:00
Richard W.M. Jones
67d6fd45f3 tests: Rename all test-v2v-* to test-*
When virt-v2v was part of libguestfs, before it was a separate
component, we prefixed all test names with 'test-v2v-*' in order to
distinguish them from tests for other components.  Since virt-v2v is
now separate, we no longer need to do this.  Thus we can remove the
'-v2v-' part of every test name, which reduces typing and makes the
names nicer.

Note that we cannot remove the 'test-' prefix.  This is because
automake reserves an unspecified list of words (eg. "compile") and
tests using those names will fail.  Keeping the 'test-' prefix avoids
this.
2024-12-05 14:53:34 +00:00
Richard W.M. Jones
c742149368 Version 2.7.3. v2.7.3 2024-12-02 17:47:55 +00:00
Richard W.M. Jones
fd1148f795 v2v: Implement --parallel=N for parallel disk copies
When set, run up to N copies of nbdcopy in parallel.  This only
applies for guests with multiple disks.

The default, as for all older versions of virt-v2v, is to copy disks
one at a time.
2024-12-02 17:18:27 +00:00
Richard W.M. Jones
5c866e7bb2 build: Use nbdcopy and nbdinfo from ./configure
Use the configured binaries, so that (eg) ./configure NBDCOPY=...
will do the right thing.
2024-12-02 13:43:39 +00:00
Richard W.M. Jones
0242329125 build: Depend on libnbd >= 1.14
Bump the required version of libnbd to 1.14 (released Aug 2022).  This
allows us to remove a check for older nbdcopy in the code.

RHEL 9 (our new minimum) has libnbd 1.20
2024-12-02 13:42:07 +00:00
Richard W.M. Jones
9e25b211a4 build: Remove --with-virt-v2v-nbdkit-python-plugin=...
In theory, ./configure --with-virt-v2v-nbdkit-python-plugin=<name>
allowed you to override the default nbdkit-python-plugin name (usually
"python").  However:

 (a) nbdkit no longer provides a Python version 2 plugin and hasn't
 since nbdkit 1.16 (2019),

 (b) we no longer support older RHEL where there were parallel Python
 2 & 3 plugins and this was an issue, and

 (c) the result wasn't actually used in the code (it used to be, but I
 think I replaced it with "python" and forgot about this ./configure
 parameter).
2024-12-02 13:30:11 +00:00
Richard W.M. Jones
4fe92410b7 build: Move baseline OCaml to 4.08
OCaml 4.08.0 was released on 2019-06-14, over 5 years ago.  By
requiring a slightly later OCaml version, we can drop more
compatibility code which was only used by older versions.

Update common submodule:

  Richard W.M. Jones (2):
      mlstdutils: Remove Option module
      Remove test for caml_alloc_initialized_string
2024-11-21 14:37:09 +00:00
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