OVA is not a particularly well-specified format. The specification
allows a directory to be an OVA, so enable that. The spec doesn't
mention that ZIP can be used in place of tar, but since we have seen
these in the wild, allow that too.
The way to fix these bugs -- for future reference -- is as follows:
(1) Install the corresponnding Windows version with virtio enabled.
See:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/chap-KVM_Para_virtualized_virtio_Drivers.html
(the ".vfd" method)
(2) Download the SYSTEM and SOFTWARE registries from the
virtio-enabled guest.
(3) Examine each registry using 'hivexsh', especially the keys which
we modify during virt-v2v (see v2v/convert_windows.ml). Remember to
use both the 'ls' and 'lsval' commands in hivexsh.
(4) Download the SYSTEM and SOFTWARE registries from the guest that
fails to boot.
(5) Examine the same registry keys from each registry using 'hivexsh'.
(6) Work out what the differences are, paying particular attention to
quoting and the type of each key (eg. str(1), str(2), etc).
Thanks: Matthew Booth.
There were two large bugs before: (1) It only found one manifest file
(meaning that multi-volume OVAs would be broken). (2) The regular
expression didn't work so it wouldn't check the hash. Bugs (1) + (2)
combined so that the check just didn't do anything at all, which is
why we didn't notice the multi-volume problem.
Actually I suspect we shouldn't be doing this check at all, since I
bet there are OVAs out there with broken SHA-1's.
Ignore an environment variable:
- if an environment variable is an empty string, AND
- if an empty string would have no meaning for that environment
variable (eg. LIBGUESTFS_BACKEND can only take on certain values,
and an empty string is not one of them).
Note that LIBGUESTFS_BACKEND_SETTINGS is meaningful as an empty
string, and for this case I have removed the STRNEQ (str, "") test.
Previously:
$ LIBGUESTFS_BACKEND="" guestfish -a /dev/null run
libguestfs: error: invalid backend:
After this commit:
$ LIBGUESTFS_BACKEND="" guestfish -a /dev/null run
(no error message is printed)
Remove the common 'add_resource' function.
Duplicate that function into code for adding disks, and separate code
for adding removables (floppies & CDROMs).
The removables code should look for all removable devices
(ResourceType 14, 15, 16) in a single query, so that the order doesn't
depend on the order in which we do the queries.
If the user does ^C then this leaves temporary overlay files around
(possibly a bug?). Offer an 'exit' choice to the user which exits
cleanly.
The new message looks like this:
Dual- or multi-boot operating system detected. Choose the root filesystem
that contains the main operating system from the list below:
[1] /dev/sda3 (Fedora release 20 (Heisenbug))
[2] /dev/sdb3
Enter a number between 1 and 2, or 'exit': exit
Improve the homebrew JSON writer:
- add more types (including also nested dictionaries and lists)
- format in a compact way (single line), or indented (multilines)
When copying from file to file, don't leave the destination file
around if the copy fails.
However in the same code don't try unlinking the destination device on
failure.
We never updated the no_trim variable in the case where this option
was supplied, so it never did anything, proving once again that unless
you have a test case, the feature won't work.