[Libguestfs] [PATCH] inspection: lift size limit for RHEL icons

Richard W.M. Jones rjones at redhat.com
Tue Jun 2 14:13:08 UTC 2015


On Fri, May 29, 2015 at 04:01:25PM +0200, Pino Toscano wrote:
> In RHEL-based distros, the provided icons have (obviously) different
> sizes than the RHEL ones, used in icon_rhel as reference.
> 
> Since 100K should be a reasonable threshold for avoid keeping a
> per-distro list of limits, just use it as only size limit.
> ---
>  src/inspect-icon.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/src/inspect-icon.c b/src/inspect-icon.c
> index fb998c2..c83ba13 100644
> --- a/src/inspect-icon.c
> +++ b/src/inspect-icon.c
> @@ -318,24 +318,21 @@ icon_fedora (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
>   *
>   * Conveniently the RHEL clones also have the same file with the
>   * same name, but containing their own logos.  Sense prevails!
> + *
> + * Use a generic 100K limit for all the images, as logos in the
> + * RHEL clones have different sizes.
>   */
>  static char *
>  icon_rhel (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
>  {
> -  size_t max_size = 0;
>    const char *shadowman;
>  
> -  if (fs->major_version >= 5 && fs->major_version <= 6)
> -    max_size = 17000;
> -  else
> -    max_size = 66000;
> -
>    if (fs->major_version <= 6)
>      shadowman = "/usr/share/pixmaps/redhat/shadowman-transparent.png";
>    else
>      shadowman = "/usr/share/pixmaps/fedora-logo-sprite.png";
>  
> -  return get_png (g, fs, shadowman, size_r, max_size);
> +  return get_png (g, fs, shadowman, size_r, 102400);
>  }
>  
>  #define DEBIAN_ICON "/usr/share/pixmaps/debian-logo.png"

ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list