This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 823821 - Inspection fails when /etc/HOSTNAME is empty
Inspection fails when /etc/HOSTNAME is empty
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks: 830367 830369
  Show dependency treegraph
 
Reported: 2012-05-22 05:02 EDT by Richard W.M. Jones
Modified: 2012-06-09 02:23 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-24 11:12:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2012-05-22 05:02:11 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):

libguestfs 1.18.0

How reproducible:

100%

Steps to Reproduce:

See above.
Comment 1 Richard W.M. Jones 2012-05-24 11:12:13 EDT
Comprehensively fixed upstream in:
cffb7fefc88a317f957785f6448fb24183c8c629
f00066d22b11bf40d0272f68565a2a27fea15627

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