qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

ui: install logo icons to $prefix/share/icons

QEMU currently installs logos to $prefix/share/qemu/ which means no GUI
toolkit or applications can find them by default.

The accepted standards for desktop applications declare that application
logos / icons should be installed under $prefix/share/icons, so use this
directory location.

Pre-rendered icons are provided at the standard sizes expected for GUI
applications, along with the scalable SVG, to ensure maximum portability.

The PNGs are rendered from the SVG using inkscape, however, this is not
wired up into the default make rules to avoid requiring inkscape as a
mandatory tool in build systems / developer workstations.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20190110120047.25369-2-berrange@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

authored by

Daniel P. Berrangé and committed by
Gerd Hoffmann
a8260d38 681d6136

+38 -23
+12 -1
Makefile
··· 667 667 efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \ 668 668 efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom \ 669 669 efi-e1000e.rom efi-vmxnet3.rom \ 670 - qemu-icon.bmp qemu_logo_no_text.svg \ 671 670 bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \ 672 671 multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin \ 673 672 s390-ccw.img s390-netboot.img \ ··· 720 719 endif 721 720 endif 722 721 722 + ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 723 723 724 724 install: all $(if $(BUILD_DOCS),install-doc) install-datadir install-localstatedir 725 725 ifneq ($(TOOLS),) ··· 741 741 $(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(qemu_datadir)"; \ 742 742 done 743 743 endif 744 + for s in $(ICON_SIZES); do \ 745 + mkdir -p "$(DESTDIR)/$(qemu_icondir)/hicolor/$${s}/apps"; \ 746 + $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \ 747 + "$(DESTDIR)/$(qemu_icondir)/hicolor/$${s}/apps/qemu.png"; \ 748 + done; \ 749 + mkdir -p "$(DESTDIR)/$(qemu_icondir)/hicolor/32x32/apps"; \ 750 + $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_32x32.bmp \ 751 + "$(DESTDIR)/$(qemu_icondir)/hicolor/32x32/apps/qemu.bmp"; \ 752 + mkdir -p "$(DESTDIR)/$(qemu_icondir)/hicolor/scalable/apps"; \ 753 + $(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu.svg \ 754 + "$(DESTDIR)/$(qemu_icondir)/hicolor/scalable/apps/qemu.svg" 744 755 ifdef CONFIG_GTK 745 756 $(MAKE) -C po $@ 746 757 endif
+2
configure
··· 5745 5745 qemu_moddir=$libdir$confsuffix 5746 5746 qemu_datadir=$datadir$confsuffix 5747 5747 qemu_localedir="$datadir/locale" 5748 + qemu_icondir="$datadir/icons" 5748 5749 5749 5750 # We can only support ivshmem if we have eventfd 5750 5751 if [ "$eventfd" = "yes" ]; then ··· 6210 6211 fi 6211 6212 echo "qemu_helperdir=$libexecdir" >> $config_host_mak 6212 6213 echo "qemu_localedir=$qemu_localedir" >> $config_host_mak 6214 + echo "qemu_icondir=$qemu_icondir" >> $config_host_mak 6213 6215 echo "libs_softmmu=$libs_softmmu" >> $config_host_mak 6214 6216 echo "GIT=$git" >> $config_host_mak 6215 6217 echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
pc-bios/qemu-icon.bmp

This is a binary file and will not be displayed.

pc-bios/qemu_logo_no_text.svg ui/icons/qemu.svg
+5 -12
ui/gtk.c
··· 2214 2214 VirtualConsole *vc; 2215 2215 2216 2216 GtkDisplayState *s = g_malloc0(sizeof(*s)); 2217 - char *filename; 2218 2217 GdkDisplay *window_display; 2218 + GtkIconTheme *theme; 2219 2219 2220 2220 if (!gtkinit) { 2221 2221 fprintf(stderr, "gtk initialization failed\n"); ··· 2223 2223 } 2224 2224 assert(opts->type == DISPLAY_TYPE_GTK); 2225 2225 s->opts = opts; 2226 + 2227 + theme = gtk_icon_theme_get_default(); 2228 + gtk_icon_theme_prepend_search_path(theme, CONFIG_QEMU_ICONDIR); 2226 2229 2227 2230 s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 2228 2231 s->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); ··· 2248 2251 qemu_add_mouse_mode_change_notifier(&s->mouse_mode_notifier); 2249 2252 qemu_add_vm_change_state_handler(gd_change_runstate, s); 2250 2253 2251 - filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, "qemu_logo_no_text.svg"); 2252 - if (filename) { 2253 - GError *error = NULL; 2254 - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename, &error); 2255 - if (pixbuf) { 2256 - gtk_window_set_icon(GTK_WINDOW(s->window), pixbuf); 2257 - } else { 2258 - g_error_free(error); 2259 - } 2260 - g_free(filename); 2261 - } 2254 + gtk_window_set_icon_name(GTK_WINDOW(s->window), "qemu"); 2262 2255 2263 2256 gd_create_menus(s); 2264 2257
+13
ui/icons/Makefile
··· 1 + 2 + # Regenerate bitmaps from the SVG using inkscape CLI export 3 + # and ImageMagick. Don't use ImageMagick for the initial 4 + # SVG conversion, since it merely calls inkscape, but uses 5 + # 96 DPI res resulting in poor quality output. 6 + 7 + regenerate: 8 + for s in 16 24 32 48 64 128 256 512; \ 9 + do \ 10 + inkscape --without-gui --export-png=qemu_$${s}x$${s}.png \ 11 + --export-width=$$s --export-height=$$s qemu.svg ; \ 12 + done 13 + convert qemu_32x32.png qemu_32x32.bmp
ui/icons/qemu_128x128.png

This is a binary file and will not be displayed.

ui/icons/qemu_16x16.png

This is a binary file and will not be displayed.

ui/icons/qemu_24x24.png

This is a binary file and will not be displayed.

ui/icons/qemu_256x256.png

This is a binary file and will not be displayed.

ui/icons/qemu_32x32.bmp

This is a binary file and will not be displayed.

ui/icons/qemu_32x32.png

This is a binary file and will not be displayed.

ui/icons/qemu_48x48.png

This is a binary file and will not be displayed.

ui/icons/qemu_512x512.png

This is a binary file and will not be displayed.

ui/icons/qemu_64x64.png

This is a binary file and will not be displayed.

+6 -10
ui/sdl2.c
··· 762 762 static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) 763 763 { 764 764 uint8_t data = 0; 765 - char *filename; 766 765 int i; 767 766 SDL_SysWMinfo info; 768 767 ··· 837 836 } 838 837 839 838 /* Load a 32x32x4 image. White pixels are transparent. */ 840 - filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, "qemu-icon.bmp"); 841 - if (filename) { 842 - SDL_Surface *image = SDL_LoadBMP(filename); 843 - if (image) { 844 - uint32_t colorkey = SDL_MapRGB(image->format, 255, 255, 255); 845 - SDL_SetColorKey(image, SDL_TRUE, colorkey); 846 - SDL_SetWindowIcon(sdl2_console[0].real_window, image); 847 - } 848 - g_free(filename); 839 + SDL_Surface *image = SDL_LoadBMP(CONFIG_QEMU_ICONDIR 840 + "/hicolor/32x32/apps/qemu.bmp"); 841 + if (image) { 842 + uint32_t colorkey = SDL_MapRGB(image->format, 255, 255, 255); 843 + SDL_SetColorKey(image, SDL_TRUE, colorkey); 844 + SDL_SetWindowIcon(sdl2_console[0].real_window, image); 849 845 } 850 846 851 847 gui_grab = 0;