Bug 1164619

Summary: Inspect-get-icon failed on RHEL7 guest
Product: Red Hat Enterprise Linux 7 Reporter: yuliu <yuliu>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: leiwang, lkong, mbooth, ptoscano, wshi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.28.1-1.11.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 13:47:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1216298    

Description yuliu 2014-11-17 02:23:10 UTC
Description of problem:
Execute inspect-get-icon failed on RHEL7 guest. Others okay.

How reproducible:
100%

Steps to Reproduce:
><fs> list-filesystems
/dev/sda1: xfs
/dev/rhel_dhcp-11-144/root: xfs
/dev/rhel_dhcp-11-144/swap: swap
><fs> inspect-os
/dev/rhel_dhcp-11-144/root
><fs> mount /dev/rhel_dhcp-11-144/root /
><fs> df
Filesystem                          1K-blocks    Used Available Use% Mounted on
tmpfs                                   97876     120     97756   1% /run
/dev                                   242296       0    242296   0% /dev
/dev/mapper/rhel_dhcp--11--144-root   7022592 3996264   3026328  57% /sysroot
><fs> trace 1
><fs> inspect-get-icon /dev/rhel_dhcp-11-144/root
libguestfs: trace: inspect_get_icon "/dev/rhel_dhcp-11-144/root"
libguestfs: trace: is_file "/etc/favicon.png" "followsymlinks:true"
libguestfs: trace: is_file = 1
libguestfs: trace: file "/etc/favicon.png"
libguestfs: trace: file = "symbolic link"
libguestfs: trace: is_file "/usr/share/pixmaps/redhat/shadowman-transparent.png" "followsymlinks:true"
libguestfs: trace: is_file = 0
libguestfs: trace: inspect_get_icon = ""


Actual results:
Failed.

Expected results:
Should pass.

Additional info:
inspect-get-icon get file /etc/favicon.png and /usr/share/pixmaps/redhat/shadowman-transparent.png from the guest as the icon of the guest operating system, but in rhel7 there is no /usr/share/pixmaps/redhat/shadowman-transparent.png, so from the trace you can see:
libguestfs: trace: is_file "/usr/share/pixmaps/redhat/shadowman-transparent.png" "followsymlinks:true"
libguestfs: trace: is_file = 0

due to this guestfish failed to get the icon. But when ' /usr/share/pixmaps/redhat/shadowman-transparent.png' is not available it should choose /etc/favicon.png as the icon. (See 'help inspect-get-icon')

Also you can display the icon by this way:
# yum install -y ImageMagick

In guestfish:
><fs> inspect-get-icon /dev/VolGroup/lv_root | display -

Comment 2 Richard W.M. Jones 2014-11-17 09:43:38 UTC
There are two bugs here:

(1) For RHEL 7 we've assumed there will be a shadowman icon
in /sysroot/usr/share/pixmaps/redhat/shadowman-transparent.png
but this is not present in RHEL 7 (or possibly requires extra
packages -- still investigating).

(2) When we request a favicon, /etc/favicon.png isn't being read,
even though it's a valid symlink pointing to a png file.

Comment 5 yuliu 2014-11-18 06:27:55 UTC
><fs> inspect-get-icon /dev/rhel_dhcp-11-144/root 
�PNG

�����9��:�Ӣ���{�s�s9We��@3�/m3��d��TG�!3p�+m^L��)�j�@ڤ��"p�u.C�w�)k�MJ��V���UԢ �MQ-CqԅJ
                                                                                   p������MD;0������v�A�Cx��x�X�
                                                                                                                   |O��:d��c@v8q*�Q���AHk��������h�zX9����y��f�e�t�
>�:�����<\u�l&JE��,�u�J�z�M�$����                                                                                                                                    ��^���cνH#0Rtp89骧��b��2��p�Zc<kU�g
                                       ���z�}ڑ�7��n�[�vn����o��V�C����������si��EJT�$i�<ʦy�S��LY[��L׃#-������X,&
                                                                                                                     �K'��|�B��ŕ��P��)4�J�z�@"��h��d��EDZD�(5d۶�����ƆLOM-�A�T��}�˓8\��o"� ���I����Ȉgc}}*>;�-_BD�����BDd6�8t����vBD���F�ʀ2䮈X��l����|D�����
                     m�~`	x,���k�K�!K��G�>IEND�B`�><fs>

Verified as above.

Comment 7 errata-xmlrpc 2015-03-05 13:47:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0303.html