Red Hat Bugzilla – Bug 823821
Inspection fails when /etc/HOSTNAME is empty
Last modified: 2012-06-09 02:23:27 EDT
Description of problem:
(Reported by Todd Mummert for an OpenSUSE guest)
Take an existing Linux guest of any type, and create an empty
/etc/HOSTNAME file. The following sequence of commands will
do this non-destructively:
$ qemu-img create -f qcow2 -b /dev/vg_pin/F16x64 no-hostname.img
Formatting 'no-hostname.img', fmt=qcow2 size=21474836480 backing_file='/dev/vg_pin/F16x64' encryption=off cluster_size=65536
$ guestfish -a no-hostname.img -i touch /etc/HOSTNAME
Then inspect the guest:
$ virt-inspector -a no-hostname.img
libguestfs: error: /etc/HOSTNAME: file is empty
virt-inspector: no operating system could be detected inside this disk image.
This may be because the file is not a disk image, or is not a virtual machine
image, or because the OS type is not understood by libguestfs.
NOTE for Red Hat Enterprise Linux 6 users: for Windows guest support you must
install the separate libguestfs-winsupport package.
If you feel this is an error, please file a bug report including as much
information about the disk image as possible.
Clearly inspection should not completely fail if this
file is empty.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Comprehensively fixed upstream in: