Description of problem: After a power failure or os crash, there are cases appliancedir is half-built. The directory exists but required files can be missing. In that case, we 'd better tell supermin to create appliance from scratch. Version-Release number of selected component (if applicable): v1.42.0 How reproducible: rare Steps to Reproduce: 1. Kill supermin while it is creating files under appliancedir. Or simply rm appliancedir/initrd. 2. Run virt-v2v or guestfish 3. Actual results: virt-v2v or guestfish fails with "appliance closed connection". if run with verbose mode, it says: supermin: if-newer: output does not need rebuilding Expected results: supermin creates an applience from scratch. Additional info: Patch suggestion: diff --git a/lib/appliance.c b/lib/appliance.c index 6b4ee78..487d64f 100644 --- a/lib/appliance.c +++ b/lib/appliance.c @@ -323,7 +323,11 @@ run_supermin_build (guestfs_h *g, guestfs_int_cmd_add_arg (cmd, "--build"); if (g->verbose) guestfs_int_cmd_add_arg (cmd, "--verbose"); - guestfs_int_cmd_add_arg (cmd, "--if-newer"); + + /* Make sure these files exist when reusing appliancedir. */ + if (dir_contains_files(g, appliancedir, "kernel", "initrd", "root")) { + guestfs_int_cmd_add_arg (cmd, "--if-newer"); + } guestfs_int_cmd_add_arg (cmd, "--lock"); guestfs_int_cmd_add_arg (cmd, lockfile); #if 0
Yes, this is already known as a supermin bug: bug 1813809. I just created by cloning one the same bugs we had already reported for RHEL (bug 1796120, bug 1796120). The patch IMHO is not a good approach, as this is something supermin ought to check properly. *** This bug has been marked as a duplicate of bug 1813809 ***