Bug 979979
Summary: | Icons created by virt inspector interface not used by anyone | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | hyao <hyao> | ||||||||
Component: | virt-manager | Assignee: | Martin Kletzander <mkletzan> | ||||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 7.0 | CC: | berrange, crobinso, dyuan, hbrock, horsley1953, jforbes, lcui, mkletzan, mzhan, rjones, tzheng, virt-maint | ||||||||
Target Milestone: | rc | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | virt-manager-0.10.0-2.el7 | Doc Type: | Bug Fix | ||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | 905238 | Environment: | |||||||||
Last Closed: | 2014-06-13 11:14:37 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: | 905238 | ||||||||||
Bug Blocks: | |||||||||||
Attachments: |
|
Description
hyao@redhat.com
2013-07-01 09:08:44 UTC
The upstream fix is: https://git.fedorahosted.org/cgit/virt-manager.git/commit/?id=9d5c1cdb1c03a8c045ae94ab5324aa7dda68e695 Moving to POST with commit v0.10.0-14-g9d5c1cd: commit 9d5c1cdb1c03a8c045ae94ab5324aa7dda68e695 Author: Richard W.M. Jones <rjones> Date: Fri Jun 28 18:45:53 2013 +0100 inspection: Check can_set_row_none before setting icon to None. it seems the bug is partially fixed, only the rhel guest icon could be shown in virt-manager. Icon for the windows guest could not be displayed. Version: # rpm -qa libvirt virt-manager python-libguestfs libguestfs-tools* libguestfs-winsupport libguestfs-winsupport-7.0-2.el7.x86_64 libvirt-1.1.1-2.el7.x86_64 python-libguestfs-1.22.5-3.el7.x86_64 libguestfs-tools-c-1.22.5-3.el7.x86_64 virt-manager-0.10.0-2.el7.noarch libguestfs-tools-1.22.5-3.el7.x86_64 Steps: 1. Prepare guests two rhel and one windows xp. Open virt-manager wait for about a few minute, then check the icon for the guest. Actual Result: Icons for the rhel guest are displayed but not for the windows xp. Expected result: Icon for all guests are displayed. Additional info: Use virt-inspector to extract the xml of guest XP and check if the icon element is availabel: .... <icon>iVBORw0KGgoAAAANSUhEUgAAABkAAAAUCAIAAAD3FQHqAAAD/klEQVQ4jbXUW0yTZxgH8C4c Bo+ddMwEUQPBSUsppUcqUA4tFCoN0pYzCFjoutiFjiFgCbTQWhmxFsEDW2SCskghKCxDo7i5 sJGRILIlw02RRcPF1pGMDZk64zw8e63xxn1btov9L97LX97n/3zfS6P9T0FXCu4XYpcET2Th qSJsYv78DtukTpZKpf8NWu3fja0stGxCx3oc0uBQySMDfU65ZkK5Sfo8/9a635mLNiaag9C1 BT+uwqOyO6XwZSLYs/mpleKdfTHmbgXhwsLCXBfkx2Yy/onGtji0s7CJge+J8JwRW5keLVyQ 0EsqZElvBOq7/PZNhLpmQ7sXNnzgWffuFbpEIqGGlj5sQns0tm5G2zrsz8SRSjQFzythIC08 oVCoMNJqTwXapqBzAXpXoGcZat1r+Xw+tXXvgAL3srExGJ0b8KMC7FM82AmXk8CZJ9lazlLX +zSehbZZOLIIfavQdQsMdjaHw6G2POaw7w30qzm0YX1kr0l5Xh06xaP1B9Pe3CFNf+s13X5/ y6fgnIP3PdD3GzhmILdcGh0d/bd96Ros2VUt2vqBHLNbUtioVcgL5JzUYomymlZ7MtA2CQfn 4fgv0LsKe0YYSSmS2NhYCsV8eGWbdTGzdkVjRecg9o5hmeWhOHcprsgsKGZr6+mmQbBNQ8dN 6F6G9muv6Jq5bDabuq+6Q/crHKg2Y3UHui/hkVHcYX4iUvwglu/V7359V0OM3hirN3Nq2nh1 9hiHnavZnsBisXg8HoVlaPtDtw/zmrHpGI5Ooq0XNcbfY6U3E/LV/Y6XZgfXzg5FnD65ZXyI OX8p/MFlRllhfGRkJIVVYDhdZH1caMUyO7oGcXgCazpQUXqbn/hFWoV42On79RB4LsKTrwCv Ad6AG+fWi4QxTCaTwqqqmy2xoroRjR048BmeuIiVrRivWhKkHny7IeL80YDro/Dr54DfAF5/ yrkPi6KiosgHQdFXcd1Ppc2P8/Y82mVdthzw1Dju5lffE8gWxdkVPW1+k31w6yzcnQL81mvN gaUujcvlkiVSWFJDfqm+PEOTkVWQlaRMSt2WmZA9wU4ZVekUZ1x+V9zw4zg8nPEOuAB3ptcU 58uEQqFYLI6Li3vREivEQa8GBUDAxrCNfv5+/i/7M3lMVZEqz8QdORT03Rm4TQa8+hQil/qk P0YqTdjqjUgketEKCQlJlCeq8lTaci2DwfDx8fH19ZXlyMK14SqjxNHIG+8JmXYHuzs3V1fx 5LJ48kvHe0PxTrS3txu8aelqIadSqWTz2PJsOTeRS54XUvOzdkjI4sh0ZDQCEZHCGhsbMzxP eno6OZOTk8nKdTpdREQE2Rch+N4IBAJSE5nu2aX+av0JMGKmahyMK+oAAAAASUVORK5CYII=</icon> </operatingsystem> </operatingsystems> # base64 -i -d icon.data>icon.png # file icon.png icon.png: PNG image data, 25 x 20, 8-bit/color RGB, non-interlaced I can view the icon by gimp. Created attachment 786862 [details]
virt-manager.log
libguestfs is definitely performing inspection and finding icons: 2013-08-15 16:05:07,859 (inspection:244): qemu:///system:T2: detected operating system: linux rhel 6.4 (Red Hat Enterprise Linux Server release 6.4 (Santiago)) 2013-08-15 16:05:07,860 (inspection:245): hostname: localhost.localdomain 2013-08-15 16:05:07,860 (inspection:247): icon: 16322 bytes 2013-08-15 16:05:07,860 (inspection:249): # apps: 996 2013-08-15 16:05:12,219 (inspection:244): qemu:///system:XP: detected operating system: windows windows 5.1 (Microsoft Windows XP) 2013-08-15 16:05:12,219 (inspection:245): hostname: redhat-03d93115 2013-08-15 16:05:12,220 (inspection:249): # apps: 1 2013-08-15 16:05:23,830 (inspection:244): qemu:///system:N: detected operating system: linux rhel 6.3 (Red Hat Enterprise Linux Server release 6.3 (Santiago)) 2013-08-15 16:05:23,831 (inspection:245): hostname: localhost.localdomain 2013-08-15 16:05:23,831 (inspection:247): icon: 16322 bytes 2013-08-15 16:05:23,831 (inspection:249): # apps: 605 Those icons should appear in the interface. I can see that the patch has been applied to the source of virt-manager-0.10.0-2.el7. So something is going wrong here, but I'm not clear what. Correct me if I'm wrong, but for the windows guest there is no: (inspection:247): icon: X bytes message, but for the others there is, I'm guessing the inspection doesn't work. Can you confirm/disprove my "hypothesis"? OK, now I understand what's going on here. virt-manager specifies that it wants a high quality icon: virt-manager/virtManager/inspection.py: # string containing PNG data icon = g.inspect_get_icon(root, favicon=0, highquality=1) if icon == "": icon = None However libguestfs doesn't know how to get high quality icons from Windows guests, it can only get low-res ones: libguestfs/src/inspect-icon.c: #if CAN_DO_WINDOWS /* We don't know how to get high quality icons from a Windows guest, * so disable this if high quality was specified. */ if (!highquality) r = icon_windows (g, fs, &size); #endif So this is in fact working as intended now. We might consider modifying virt-manager so it doesn't set the highquality flag, but I suspect I added that because elsewhere in the virt-manager UI we want to display the high resolution icon. In any case, as long as icons for some guests are being displayed, you can set this bug to VERIFIED. Thank you for checking that out, I am highly unfamiliar with this. Is the code preferring high quality icons even when highquality=0? I'm asking to check whether doing something similar to this makes sense: icon = g.inspect_get_icon(root, favicon=0, highquality=1) if icon == "": icon = g.inspect_get_icon(root, favicon=0, highquality=1) if icon == "": icon = None In the meantime, I'm moving this back to QE (according to comment #11). (In reply to Martin Kletzander from comment #12) > Thank you for checking that out, I am highly unfamiliar with this. Is the > code preferring high quality icons even when highquality=0? I'm asking to > check whether doing something similar to this makes sense: > > icon = g.inspect_get_icon(root, favicon=0, highquality=1) > if icon == "": > icon = g.inspect_get_icon(root, favicon=0, highquality=1) I'm assuming you mean ^^ highquality=0 > if icon == "": > icon = None The answer is that libguestfs will prefer the highest quality icon if you specify highquality=0, but may return a low quality icon. The "fallback" code above would NOT be necessary. All you would need to do is remove the highquality=1 flag. http://libguestfs.org/guestfs.3.html#guestfs_inspect_get_icon However: the low quality icons are sometimes really small, eg. 12x12 px. I thought that virt-manager was displaying a larger icon on the "Details" tab, but I can't find that in the code now, so maybe I was imagining it. Perhaps it would be fine to remove the highquality=1 flag, but I guess someone will need to test it. Rechecked on the following packages: # rpm -qa libvirt virt-manager python-libguestfs libguestfs-tools* libguestfs-winsupport libvirt-1.1.1-2.el7.x86_64 libguestfs-tools-c-1.22.5-3.el7.x86_64 virt-manager-0.10.0-2.el7.noarch libguestfs-tools-1.22.5-3.el7.x86_64 libguestfs-winsupport-7.0-2.el7.x86_64 python-libguestfs-1.22.5-3.el7.x86_64 Steps: Get 3 windows guest, win8 ,windows2008, and winxp. change highquality=0 /usr/share/virt-manager/virtManager/inspection.py. Get the guest info by virt-inspector. For winxp guest, icon item is availale, and the icon is displayed but ugly when highquality=0. Get the screenshot form attachment hightquality_0.png. For win8 guest, icon item is available in the xml, as below. And the icon is displayed when highquality=0. # virt-inspector -d win8 <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/sda2</root> <name>windows</name> <arch>x86_64</arch> <distro>windows</distro> <product_name>Windows 8 Enterprise</product_name> ...... <applications/> <icon>iVBORw0KGgoAA.....[many lines ]Ro0bHD+Ine9k55UqlGGlp4rxa6N1/9MzUiDHAxd92/OBR5a/c rBvLr4Edl3IivjFjG/47gh/vydJwN0Lz4psN1fqdnyuLn//PHj8H8NP9/Z8AAwApzyYXNiDe XgAAAABJRU5ErkJggg==</icon> </operatingsystem> </operatingsystems> And in comments 11 "However libguestfs doesn't know how to get high quality iconsfrom Windows guests, it can only get low-res ones:", so when highquality=1 flag is set, the icon is not displayed. These are expected result. For windows2008, icon item is not available, so no matter highquality=1 is set or not, no icon item available for this guest. This is expected result too. # virt-inspector -d re <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/sdb</root> <name>windows</name> <arch>i686</arch> <distro>windows</distro> <product_name>Microsoft Windows Server 2008</product_name> <major_version>6</major_version> <minor_version>0</minor_version> <format>installer</format> <mountpoints> <mountpoint dev="/dev/sdb">/</mountpoint> </mountpoints> <filesystems> <filesystem dev="/dev/sdb"> <type>udf</type> <label>KRTMSVOL_EN_DVD</label> <uuid>2009-04-11-12-00-00-00</uuid> </filesystem> </filesystems> <applications/> </operatingsystem> </operatingsystems> Based on the mentioned test reuslts, verify the bug. Created attachment 792026 [details]
screenshot when highquality=0
Created attachment 792027 [details]
screenshot when highquality=1
(In reply to hyao from comment #14) > Rechecked on the following packages: > # rpm -qa libvirt virt-manager python-libguestfs libguestfs-tools* > libguestfs-winsupport > libvirt-1.1.1-2.el7.x86_64 > libguestfs-tools-c-1.22.5-3.el7.x86_64 > virt-manager-0.10.0-2.el7.noarch > libguestfs-tools-1.22.5-3.el7.x86_64 > libguestfs-winsupport-7.0-2.el7.x86_64 > python-libguestfs-1.22.5-3.el7.x86_64 > > Steps: > Get 3 windows guest, win8 ,windows2008, and winxp. change highquality=0 > /usr/share/virt-manager/virtManager/inspection.py. > Get the guest info by virt-inspector. > > For winxp guest, icon item is availale, and the icon is displayed but ugly > when highquality=0. Get the screenshot form attachment hightquality_0.png. > > For win8 guest, icon item is available in the xml, as below. And the icon is > displayed when highquality=0. > # virt-inspector -d win8 > <?xml version="1.0"?> > <operatingsystems> > <operatingsystem> > <root>/dev/sda2</root> > <name>windows</name> > <arch>x86_64</arch> > <distro>windows</distro> > <product_name>Windows 8 Enterprise</product_name> > ...... > <applications/> > <icon>iVBORw0KGgoAA.....[many lines > ]Ro0bHD+Ine9k55UqlGGlp4rxa6N1/9MzUiDHAxd92/OBR5a/c > rBvLr4Edl3IivjFjG/47gh/vydJwN0Lz4psN1fqdnyuLn//PHj8H8NP9/Z8AAwApzyYXNiDe > XgAAAABJRU5ErkJggg==</icon> > </operatingsystem> > </operatingsystems> > > And in comments 11 "However libguestfs doesn't know how to get high quality > iconsfrom Windows guests, it can only get low-res ones:", so when > highquality=1 flag is set, the icon is not displayed. These are expected > result. > > For windows2008, icon item is not available, so no matter highquality=1 is > set or not, no icon item available for this guest. This is expected result > too. > # virt-inspector -d re > <?xml version="1.0"?> > <operatingsystems> > <operatingsystem> > <root>/dev/sdb</root> > <name>windows</name> > <arch>i686</arch> > <distro>windows</distro> > <product_name>Microsoft Windows Server 2008</product_name> > <major_version>6</major_version> > <minor_version>0</minor_version> > <format>installer</format> > <mountpoints> > <mountpoint dev="/dev/sdb">/</mountpoint> > </mountpoints> > <filesystems> > <filesystem dev="/dev/sdb"> > <type>udf</type> > <label>KRTMSVOL_EN_DVD</label> > <uuid>2009-04-11-12-00-00-00</uuid> > </filesystem> > </filesystems> > <applications/> > </operatingsystem> > </operatingsystems> > > > Based on the mentioned test reuslts, verify the bug. Since I changed the highquality flag to 0 manaully, it's expected to change to 0 in next patch. so I change the status to assigned. And pleases notice that the icon for windows 2008 is not displayed even highquality=0. Although the picture is not that good, and I think it's better to get one tiny icon than none. libguestfs doesn't know how to get icons for any Windows guest *except* Windows XP, Windows 7, Windows 8 (including the server variants of those). So not seeing an icon for Windows 2008 is normal. I think the low-quality Windows icons look terrible, and we should *not* change the highquality setting. Looks like it's there fore a good reason. Before anyone suggests including the icons in virt-manager, we've explored that route and it's not legal because OS icons are trademarked, non-free and subject to field of use restrictions. Could users maybe define their own icons? That would allow something more meaningful to the user than a generic OS icon might be. You can set favicon=1 (virt-manager sets it to 0). This will pull an icon from a known location in the guest which the user can override easily. See: http://libguestfs.org/guestfs.3.html#guestfs_inspect_get_icon Moving back to ON_QA according to comment #18 mentioning highquality=0 is *not* what we want. Please move to VERIFIED if there is nothing else to do so we can properly prioritize other BZs. Thank you. This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |