Description of problem: I have a Windows 7 image that can be booted in Xen, but upon startup (in Xen) a "Registry Recovery... recovery was successful" message appears. After which the VM runs as expected. If I use libguestfs on this same image and call guestfs_inspect_os() to obtain the "roots", the hivex component fails because of the unexpected (and corrupted to some degree) registry. Subsequently guestfs_inspect_os cannot return "roots". How reproducible: Very - with the specific input image. I may be able to provide it. (about 20GB). Steps to Reproduce: 1. load specific image with guestfs and call guestfs_inspect_os() Additional info: This feature request was initially and incorrectly posted as a bug (reference:https://bugzilla.redhat.com/show_bug.cgi?id=888059 for more details) Richard Jones pointed out this debug info as indicative of the registry problem: "hivex: /sysroot/Windows/System32/config/SOFTWARE: trailing garbage at end of file (at 0x245b000, after 8557 pages)" He also mentioned that there might be empty trailing hbins at the end of the registry which caused problems for the hivex component. If there is a place available for me to upload my Windows 7 image (approx. 20GB) then I'd be willing to provide it for the purpose of addressing this feature request only.
I suggested some sort of looser checking flag, eg: HIVEX_OPEN_FIXUP. This means we wouldn't automatically "fix" things, but would let us deal with this problem.
Fixed upstream in: https://github.com/libguestfs/hivex/commit/507f9328c67c701c32894249437551395bd8072c https://github.com/libguestfs/hivex/commit/8d092a746dbd9e61ec85cf17449c201bc0719721 https://github.com/libguestfs/hivex/commit/5345ec8f1df304dc93a6b1e4cbb40e7c1cf6f88d https://github.com/libguestfs/hivex/commit/62c53cda651f34f18a2b55e91012c0448acb70f1 https://github.com/libguestfs/hivex/commit/2610b1e089fa84d294f9925342929e3d7408c35b In hivex >= 1.3.14.