Todd Mummert
2012-May-22 03:00 UTC
[Libguestfs] failure to find hostname causing fatal error
Trying to inspect an old OpenSuSE image, which has an empty /etc/HOSTNAME file. This causes check_hostname_unix() in inspect_fs_unix() to return -1 -- causing inspection to fail. Somewhat interestingly, if no files of interest were found, the function would return 0.....which I think doesn't cause problems upstream. It's somewhat related to this closed bug where the fix was to set the return code to 0 and hostname could end up null. https://bugzilla.redhat.com/show_bug.cgi?id=726739 It may be correct, in fact, to try each of the hostname checks until 1 succeeds or they all fail, and then return 0 in all cases. --Todd
Richard W.M. Jones
2012-May-22 09:07 UTC
[Libguestfs] failure to find hostname causing fatal error
On Mon, May 21, 2012 at 11:00:12PM -0400, Todd Mummert wrote:> Trying to inspect an old OpenSuSE image, which has an empty > /etc/HOSTNAME file. This causes check_hostname_unix() in > inspect_fs_unix() to return -1 -- causing inspection to fail. > Somewhat interestingly, if no files of interest were found, the > function would return 0.....which I think doesn't cause problems > upstream. > > It's somewhat related to this closed bug where the fix was to set the > return code to 0 and hostname could end up null. > > https://bugzilla.redhat.com/show_bug.cgi?id=726739 > > It may be correct, in fact, to try each of the hostname checks until 1 > succeeds or they all fail, and then return 0 in all cases.I think this is sufficiently different that I have filed a new bug about it: https://bugzilla.redhat.com/show_bug.cgi?id=823821 Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
Maybe Matching Threads
- [PATCH] Don't abort inspection if mdadm.conf ARRAY doesn't have a uuid
- [PATCH] inspect: handle os-release "opensuse-tumbleweed" as opensuse
- [PATCH] inspect: use check_tests also for detecting Hurd
- [PATCH 0/5] Small inspection improvements
- [PATCH] NFC: Cleanup iteration over fstab entries in inspect_fs_unix.c