Bug 1813807 - Should not add --if-newer to supermin arg when initrd is missing.
Summary: Should not add --if-newer to supermin arg when initrd is missing.
Keywords:
Status: CLOSED DUPLICATE of bug 1813809
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-16 07:11 UTC by kanda.motohiro
Modified: 2020-03-16 07:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-16 07:38:09 UTC
Embargoed:


Attachments (Terms of Use)

Description kanda.motohiro 2020-03-16 07:11:17 UTC
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

Comment 1 Pino Toscano 2020-03-16 07:38:09 UTC
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 ***


Note You need to log in before you can comment on or make changes to this bug.