Hide Forgot
Created attachment 1516476 [details] debug log Description of problem: Icon created by libguestfs-tools cannot been displayed on virt-manager Version-Release number of selected component (if applicable): virt-manager-virt-manager-2.0.0-1.el8.noarch qemu-kvm-2.12.0-45.module+el8+2313+d65431a0.x86_64 libvirt-4.5.0-15.module+el8+2285+e990ac42.x86_64 python3-libvirt-4.5.0-1.module+el8+2173+537e5cb5.x86_64 kernel-4.18.0-48.el8.x86_64 libguestfs-tools-c-1.38.4-8.module+el8+2564+79985af8.x86_64 libguestfs-tools-1.38.4-8.module+el8+2564+79985af8.noarch python3-libguestfs-1.38.4-8.module+el8+2564+79985af8.x86_64 How reproducible: 100% Steps to Reproduce 1. Make sure you installed the followign packages libvirt virt-manager libguestfs-tools-c libguestfs-tools python-libguestfs ( in RHEL8.0, I can only use python3-libguestfs) 2.Make sure you have at least one rhel guest and one windows guest installed on you host. 3.Launch virt-manager . Actual results: Redhat icon and windows icon are not displayed on virt-manager Expected results: Wait for a few minutes, check redhat icon and windows icon are displayed on virt-manager for guests. Additional info: [Mon, 24 Dec 2018 14:40:46 virt-manager 17340] ERROR (inspection:185) qemu:///system:rhel7.6: exception while processing Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/inspection.py", line 182, in _process_vm data = self._inspect_vm(conn, vm) File "/usr/share/virt-manager/virtManager/inspection.py", line 270, in _inspect_vm icon = g.inspect_get_icon(root, favicon=0, highquality=1) File "/usr/lib64/python3.6/site-packages/guestfs.py", line 4650, in inspect_get_icon r = libguestfsmod.inspect_get_icon(self._o, root, favicon, highquality) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
This is part of the general problem with libguestfs bindings and Python strings, but yes it's a bug.
This was fixed upstream with https://github.com/libguestfs/libguestfs/commit/0ee02e0117527b86a31b2a88a14994ce7f15571f which is in libguestfs >= 1.41.1. This was a Python 3 issue (str vs bytes) of the Python bindings, so retitling accordingly.
(In reply to Red Hat Bugzilla Rules Engine from comment #2) > * What is the risk with putting this into the release vs. doingit in the > next release? (For example, is this a regression?) Yes: virt-manager (even though it is deprecated) will not show the icons of any guest (like it does on RHEL 7, for example) In general, this is a problem that affects part of the Python bindings when built with Python 3: some of the APIs (9 directly, and 5 indirectly) will basically not work at all. One of them affects the icon extraction from the guest. Unfortunately it is hard to say what may use the others. > * Is this related to an MVP or Layered Product request, if so what? Not to my knowledge. > * Do you have signoff from your Dev/QE/PM leads on the status of this as an > exception for the team? Rich? Ming? Martin?
granted exception+ per review of RHEL Team
Verified with package: libguestfs-1.38.4-10.module+el8+2709+40ed2f2c.x86_64 libvirt-4.5.0-18.module+el8+2691+dc742e5d.x86_64 kernel-4.18.0-60.el8.x86_64 qemu-kvm-2.12.0-57.module+el8+2683+02b3b955.x86_64 python3-libguestfs-1.38.4-10.module+el8+2709+40ed2f2c.x86_64 Steps: 1. Install related packages: libguestfs,virt-manager,python3-libguestfs,... 2. Install rhel8 and windows 7 guests on rhel8 host. 3. # virt-manager --debug ... [Mon, 28 Jan 2019 14:53:04 virt-manager 21508] DEBUG (inspection:286) qemu:///system:rhel8: detected operating system: linux rhel 8.0 (Red Hat Enterprise Linux 8.0 Beta (Ootpa)) [Mon, 28 Jan 2019 14:53:04 virt-manager 21508] DEBUG (inspection:287) hostname: localhost.localdomain [Mon, 28 Jan 2019 14:53:04 virt-manager 21508] DEBUG (inspection:289) icon: 7046 bytes [Mon, 28 Jan 2019 14:53:04 virt-manager 21508] DEBUG (inspection:291) # apps: 1238 ... [Mon, 28 Jan 2019 14:53:06 virt-manager 21508] DEBUG (inspection:286) qemu:///system:win7: detected operating system: windows windows 6.1 (Windows 7 Starter) [Mon, 28 Jan 2019 14:53:06 virt-manager 21508] DEBUG (inspection:287) hostname: REDHATQ-OOMI6GN [Mon, 28 Jan 2019 14:53:06 virt-manager 21508] ERROR (manager:74) Error loading inspection icon data Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/manager.py", line 71, in _get_inspection_icon_pixbuf pb.close() GLib.GError: gdk-pixbuf-error-quark: Unrecognized image file format (3) The rhel8 icon can be displayed on virt-manager, but failed to inspect the windows icon. The gdk-pixbuf2 package is installed on rhel8 host.
Created attachment 1524153 [details] virt-manager_debug.log
(In reply to YongkuiGuo from comment #7) > The rhel8 icon can be displayed on virt-manager, but failed to inspect the > windows icon. > The gdk-pixbuf2 package is installed on rhel8 host. Is libguestfs-inspect-icons installed too?
(In reply to Pino Toscano from comment #9) > (In reply to YongkuiGuo from comment #7) > > The rhel8 icon can be displayed on virt-manager, but failed to inspect the > > windows icon. > > The gdk-pixbuf2 package is installed on rhel8 host. > > Is libguestfs-inspect-icons installed too? Yes. libguestfs-inspect-icons-1.38.4-10.module+el8+2709+40ed2f2c.noarch.
Created attachment 1524170 [details] icon extract script Simple icon extraction script. Run it like `python3 icon.py windows-image`, and it will save the icon of the guest as icon.png in the current directory.
YongkuiGuo, can you please try the attached icon extraction script on the disk of the Windows guest? It should not fail, and save the icon as "icon.png".
It failed and I tried to debug the error line. # python3 -m pdb icon.py Win7-32-hvm.raw ... (Pdb) > /home/icon.py(23)<module>() -> g.mount_ro(mps[device], device) (Pdb) pp mps[device] '/dev/sda1' (Pdb) pp device '/' (Pdb) n RuntimeError: mount: unsupported filesystem type The following steps can be run successfully. # guestfish -a Win7-32-hvm.raw ><fs> set-program virt-trickery ><fs> run ><fs> inspect-os /dev/sda1 ><fs> mount /dev/sda1 / ><fs> list-filesystems /dev/sda1: ntfs ><fs>
Created attachment 1524181 [details] icon extract script v2 v2 of the script, working with libguestfs-winsupport in RHEL.
# python3 icon.py Win7-32-hvm.raw # ll | grep icon.png -rw-r--r--. 1 root root 0 Jan 28 18:30 icon.png The size of icon.png is zero byte.
(In reply to YongkuiGuo from comment #15) > # python3 icon.py Win7-32-hvm.raw > # ll | grep icon.png > -rw-r--r--. 1 root root 0 Jan 28 18:30 icon.png > > The size of icon.png is zero byte. Hmm... 1) can you please run the script with LIBGUESTFS_TRACE=1 LIBGUESTFS_DEBUG=1, and attach its output? 2) if you copy/migrate the same guest on a RHEL 7 installation, is virt-manager able to show the icon?
Created attachment 1524190 [details] extract script v2 output
> 2) if you copy/migrate the same guest on a RHEL 7 installation, is > virt-manager able to show the icon? Yes, virt-manager can be able to show the icon of Win7-32-hvm.raw on rhel7.6 host.
(In reply to YongkuiGuo from comment #18) > > 2) if you copy/migrate the same guest on a RHEL 7 installation, is > > virt-manager able to show the icon? > Yes, virt-manager can be able to show the icon of Win7-32-hvm.raw on rhel7.6 > host. Hmm interesting: - there are no "high quality" icons that libguestfs extracts from Windows guests (so highquality=True gives no results for any Windows guest) - virt-manager already falls back on the low quality icon if no high quality icon is available; this logic has been in place for years - the icon extraction logic in libguestfs has been the same for years Can you please run virt-manager with LIBGUESTFS_TRACE=1 LIBGUESTFS_DEBUG=1, and attach the (long) resulting output? Also, I will update the icon.py script with a logic closer to what virt-manager does.
Created attachment 1524693 [details] icon extract script v3 v3 of the script, falling back to low quality icons.
Created attachment 1524826 [details] entire virt-manager debug log
Created attachment 1524827 [details] icon extract script v3 output
> > Can you please run virt-manager with LIBGUESTFS_TRACE=1 LIBGUESTFS_DEBUG=1, > and attach the (long) resulting output? Done. > Also, I will update the icon.py script with a logic closer to what > virt-manager does. The v3 script also cannot extract the icon. I have attached the output.
Created attachment 1525036 [details] icon extract script v4 v4 of the script, actually falling back to low quality icons...
The missing Windows icon most probably is a bug in virt-manager; I just sent a patch upstream to fix this: https://www.redhat.com/archives/virt-tools-list/2019-January/msg00084.html Can you please try this patch? It should be possible to directly edit (as root) the Python script of the virt-manager installation (see `rpm -ql virt-manager`).
(In reply to Pino Toscano from comment #25) > The missing Windows icon most probably is a bug in virt-manager; I just sent > a patch upstream to fix this: > https://www.redhat.com/archives/virt-tools-list/2019-January/msg00084.html > > Can you please try this patch? It should be possible to directly edit (as > root) the Python script of the virt-manager installation (see `rpm -ql > virt-manager`). Good news. I have tried this patch and it works well. I modified the v4 script according to this patch, and it also works. ... [Thu, 31 Jan 2019 10:12:23 virt-manager 6020] DEBUG (inspection:288) qemu:///system:win7: detected operating system: windows windows 6.1 (Windows 7 Starter) [Thu, 31 Jan 2019 10:12:23 virt-manager 6020] DEBUG (inspection:289) hostname: REDHATQ-OOMI6GN [Thu, 31 Jan 2019 10:12:23 virt-manager 6020] DEBUG (inspection:291) icon: 3292 bytes ...
(In reply to YongkuiGuo from comment #26) > (In reply to Pino Toscano from comment #25) > > The missing Windows icon most probably is a bug in virt-manager; I just sent > > a patch upstream to fix this: > > https://www.redhat.com/archives/virt-tools-list/2019-January/msg00084.html > > > > Can you please try this patch? It should be possible to directly edit (as > > root) the Python script of the virt-manager installation (see `rpm -ql > > virt-manager`). > > Good news. I have tried this patch and it works well. I modified the v4 > script according to this patch, and it also works. > ... > [Thu, 31 Jan 2019 10:12:23 virt-manager 6020] DEBUG (inspection:288) > qemu:///system:win7: detected operating system: windows windows 6.1 (Windows > 7 Starter) > [Thu, 31 Jan 2019 10:12:23 virt-manager 6020] DEBUG (inspection:289) > hostname: REDHATQ-OOMI6GN > [Thu, 31 Jan 2019 10:12:23 virt-manager 6020] DEBUG (inspection:291) icon: > 3292 bytes > ... Thanks for testing! I just filed bug 1671278 for virt-manager. Should this bug considered VERIFIED, then?
Verified this bug according to c#7 and c#26.
(In reply to Pino Toscano from comment #27) > (In reply to YongkuiGuo from comment #26) > > (In reply to Pino Toscano from comment #25) > > > The missing Windows icon most probably is a bug in virt-manager; I just sent > > > a patch upstream to fix this: > > > https://www.redhat.com/archives/virt-tools-list/2019-January/msg00084.html > > > > > > Can you please try this patch? It should be possible to directly edit (as > > > root) the Python script of the virt-manager installation (see `rpm -ql > > > virt-manager`). > > > > Good news. I have tried this patch and it works well. I modified the v4 > > script according to this patch, and it also works. > > ... > > [Thu, 31 Jan 2019 10:12:23 virt-manager 6020] DEBUG (inspection:288) > > qemu:///system:win7: detected operating system: windows windows 6.1 (Windows > > 7 Starter) > > [Thu, 31 Jan 2019 10:12:23 virt-manager 6020] DEBUG (inspection:289) > > hostname: REDHATQ-OOMI6GN > > [Thu, 31 Jan 2019 10:12:23 virt-manager 6020] DEBUG (inspection:291) icon: > > 3292 bytes > > ... > > Thanks for testing! I just filed bug 1671278 for virt-manager. > > Should this bug considered VERIFIED, then? np, done.
Hi Pino, I also tested this bug with your new patch in Comment 25 with package virt-manager-2.0.0-2.el8.noarch 1. Modifying /usr/share/virt-manager/virtManager/inspection.py to if filesystems_mounted: # string containing PNG data icon = g.inspect_get_icon(root, favicon=0, highquality=1) if icon is None or len(icon) == 0: # no high quality icon, try a low quality one icon = g.inspect_get_icon(root, favicon=0, highquality=0) if icon is None or len(icon) == 0: icon = None 2. Prepare 1 windows guest and rhel guest. 3. Launch virt-manager, then finding that icons shows correctly for rhel7.6 and win7 guest, thanks.
(In reply to zhoujunqin from comment #30) > I also tested this bug with your new patch in Comment 25 with package > virt-manager-2.0.0-2.el8.noarch > 1. Modifying /usr/share/virt-manager/virtManager/inspection.py to > > if filesystems_mounted: > # string containing PNG data > icon = g.inspect_get_icon(root, favicon=0, highquality=1) > if icon is None or len(icon) == 0: > # no high quality icon, try a low quality one > icon = g.inspect_get_icon(root, favicon=0, highquality=0) > if icon is None or len(icon) == 0: > icon = None > 2. Prepare 1 windows guest and rhel guest. > 3. Launch virt-manager, then finding that icons shows correctly for rhel7.6 > and win7 guest, thanks. Yes, the above is correct.