inspect: windows: Fail hard if we cannot detect Windows architecture (RHBZ#1278371).

The user did not have the 'file' command installed, and when they
attempted to do a v2v conversion of a Windows guest, inspection
succeeded, but the Types.i_arch field was found to contain "unknown".
virt-v2v conversion failed to locate the correct virtio drivers as a
result.

The 'file' command is required, and there's no other reason we should
not be able to detect the architecture of any Windows guest, so fail
hard in this situation.
This commit is contained in:
Richard W.M. Jones
2015-11-06 12:12:53 +00:00
parent 32368f25f1
commit 7964e48b5e

View File

@@ -238,9 +238,10 @@ check_windows_arch (guestfs_h *g, struct inspect_fs *fs)
return -1;
char *arch = guestfs_file_architecture (g, cmd_exe_path);
if (!arch)
return -1;
if (arch)
fs->arch = arch; /* freed by guestfs_int_free_inspect_info */
fs->arch = arch; /* freed by guestfs_int_free_inspect_info */
return 0;
}