diff --git a/SOURCES/gnome-boxes-disable-3d-acceleration.patch b/SOURCES/gnome-boxes-disable-3d-acceleration.patch new file mode 100644 index 0000000..f9eee2e --- /dev/null +++ b/SOURCES/gnome-boxes-disable-3d-acceleration.patch @@ -0,0 +1,25 @@ +From 932e84eff38302ff7c6b89213a911589cbb06bfe Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Mon, 13 Jul 2020 10:54:41 +0200 +Subject: [PATCH] disable-3d-acceleration + +--- + src/libvirt-machine-properties.vala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala +index 5f5392e3..aa69fc85 100644 +--- a/src/libvirt-machine-properties.vala ++++ b/src/libvirt-machine-properties.vala +@@ -116,7 +116,7 @@ public string collect_logs () { + add_string_property (ref list, _("Display URL"), machine.display.uri); + } + +- add_3d_acceleration_property (ref list); ++ //add_3d_acceleration_property (ref list); + + break; + +-- +2.26.2 + diff --git a/SOURCES/gnome-boxes-dont-be-critical.patch b/SOURCES/gnome-boxes-dont-be-critical.patch new file mode 100644 index 0000000..04b3d6e --- /dev/null +++ b/SOURCES/gnome-boxes-dont-be-critical.patch @@ -0,0 +1,29 @@ +From 1de7984024732d18450cfba96b4975b98c885167 Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Tue, 30 Jun 2020 12:49:22 +0200 +Subject: [PATCH] WIP + +--- + src/wizard-source.vala | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/wizard-source.vala b/src/wizard-source.vala +index b596741e..ab2ea37c 100644 +--- a/src/wizard-source.vala ++++ b/src/wizard-source.vala +@@ -91,8 +91,10 @@ public WizardDownloadableEntry (Osinfo.Media media) { + + url = media.url; + +- var media_file = GLib.File.new_for_uri (media.url); +- set_tooltip_text (media_file.get_basename ()); ++ if (media.url != null) { ++ var media_file = GLib.File.new_for_uri (media.url); ++ set_tooltip_text (media_file.get_basename ()); ++ } + } + + public WizardDownloadableEntry.from_os (Osinfo.Os os) { +-- +2.26.2 + diff --git a/SOURCES/gnome-boxes-download-from-url.patch b/SOURCES/gnome-boxes-download-from-url.patch new file mode 100644 index 0000000..c1e4301 --- /dev/null +++ b/SOURCES/gnome-boxes-download-from-url.patch @@ -0,0 +1,116 @@ +From bb0e600c9931d053d85f684953ec4aa2c20b7584 Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Wed, 24 Jun 2020 15:35:00 +0200 +Subject: [PATCH] assistant, downloads-hub: Restore support to download from + URI + +Fixes #520 +--- + src/assistant/downloads-page.vala | 9 +++++++++ + src/assistant/index-page.vala | 1 + + src/downloads-hub.vala | 25 +++++++++++++++++++++---- + 3 files changed, 31 insertions(+), 4 deletions(-) + +diff --git a/src/assistant/downloads-page.vala b/src/assistant/downloads-page.vala +index 41b93581..98086cee 100644 +--- a/src/assistant/downloads-page.vala ++++ b/src/assistant/downloads-page.vala +@@ -20,6 +20,7 @@ + private GLib.ListStore recommended_model; + + public signal void media_selected (Gtk.ListBoxRow row); ++ public signal void url_entered (); + + private AssistantDownloadsPageView _page; + public AssistantDownloadsPageView page { +@@ -105,6 +106,14 @@ private void on_search_changed () { + if (text == null) + return; + ++ var uri = Xml.URI.parse (text); ++ if (uri.scheme.has_prefix ("http")) { ++ DownloadsHub.get_instance ().add_url (text); ++ ++ url_entered (); ++ return; ++ } ++ + search.text = text; + } + +diff --git a/src/assistant/index-page.vala b/src/assistant/index-page.vala +index 097220be..c7637407 100644 +--- a/src/assistant/index-page.vala ++++ b/src/assistant/index-page.vala +@@ -37,6 +37,7 @@ + + source_medias.set_header_func (use_list_box_separator); + featured_medias.set_header_func (use_list_box_separator); ++ recommended_downloads_page.url_entered.connect (() => { dialog.hide (); }); + } + + public void setup (VMAssistant dialog) { +diff --git a/src/downloads-hub.vala b/src/downloads-hub.vala +index 3b1bc8ef..61c1e53f 100644 +--- a/src/downloads-hub.vala ++++ b/src/downloads-hub.vala +@@ -33,10 +33,12 @@ public static DownloadsHub get_instance () { + } + + public void add_item (WizardDownloadableEntry entry) { +- n_items+=1; +- + var row = new DownloadsHubRow.from_entry (entry); ++ add_row (row); ++ } + ++ private void add_row (DownloadsHubRow row) { ++ n_items+=1; + if (!button.visible) + button.visible = true; + +@@ -62,6 +64,11 @@ public void add_item (WizardDownloadableEntry entry) { + popup (); + } + ++ public void add_url (string url) { ++ var row = new DownloadsHubRow.from_url (url); ++ add_row (row); ++ } ++ + private void on_row_deleted () { + n_items-= 1; + if (!ongoing_downloads) { +@@ -163,17 +170,27 @@ private bool draw_button_pie (Widget drawing_area, Cairo.Context context) { + + Downloader.fetch_os_logo.begin (image, entry.os, 64); + ++ setup (entry.url); ++ } ++ ++ public DownloadsHubRow.from_url (string url) { ++ label.label = url; ++ ++ setup (url); ++ } ++ ++ private void setup (string url) { + progress_notify_id = progress.notify["progress"].connect (() => { + progress_bar.fraction = progress.progress; + }); + progress_bar.fraction = progress.progress = 0; + +- var soup_download_uri = new Soup.URI (entry.url); ++ var soup_download_uri = new Soup.URI (url); + var download_path = soup_download_uri.get_path (); + + var filename = GLib.Path.get_basename (download_path); + +- download.begin (entry.url, filename); ++ download.begin (url, filename); + } + + private async void download (string url, string filename) { +-- +2.26.2 + diff --git a/SOURCES/gnome-boxes-download-on-activate-signal.patch b/SOURCES/gnome-boxes-download-on-activate-signal.patch new file mode 100644 index 0000000..4678364 --- /dev/null +++ b/SOURCES/gnome-boxes-download-on-activate-signal.patch @@ -0,0 +1,49 @@ +From 376baa1bdfe2dfbe9f4973b33465fa35c102c086 Mon Sep 17 00:00:00 2001 +From: Felipe Borges + +Date: Mon, 10 Aug 2020 14:42:22 +0200 +Subject: [PATCH] downloads-page: Start URL download on ENTER (activate) + +--- + src/assistant/downloads-page.vala | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/src/assistant/downloads-page.vala b/src/assistant/downloads-page.vala +index 98086cee..5be638a0 100644 +--- a/src/assistant/downloads-page.vala ++++ b/src/assistant/downloads-page.vala +@@ -50,6 +50,7 @@ + + // TODO: move this into a UI file + search_entry.search_changed.connect (on_search_changed); ++ search_entry.activate.connect (on_search_activated); + search_entry.width_chars = 50; + search_entry.can_focus = true; + search_entry.placeholder_text = _("Search for an OS or enter a download linkā€¦"); +@@ -103,6 +104,14 @@ private void on_show_more_button_clicked () { + private void on_search_changed () { + var text = search_entry.get_text (); + ++ if (text == null) ++ return; ++ ++ search.text = text; ++ } ++ ++ private void on_search_activated () { ++ var text = search_entry.get_text (); + if (text == null) + return; + +@@ -113,8 +122,6 @@ private void on_search_changed () { + url_entered (); + return; + } +- +- search.text = text; + } + + [GtkCallback] +-- +2.26.2 + diff --git a/SOURCES/gnome-boxes-fix-mixing-vm-widgets.patch b/SOURCES/gnome-boxes-fix-mixing-vm-widgets.patch new file mode 100644 index 0000000..e673fa1 --- /dev/null +++ b/SOURCES/gnome-boxes-fix-mixing-vm-widgets.patch @@ -0,0 +1,77 @@ +From a9e6da0a18db07b94af30ced5e8c8b56737c9408 Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Wed, 8 Jul 2020 16:56:02 +0200 +Subject: [PATCH] machine: Prevent displays from overlapping each other + +When a machine display get connected/disconnected, we need to account +for what's the current_item being shown and only perform the widget +replacement when the current_item is the one that received those +signals. + +This is not an ideal solution if we later decide to support multiple +monitors, but it fixes various issues users have now with managing +multiple machines at the same time. + +To reproduce the most common of these issues you need: +1. Run at least two VMs simultaneously +2. Restart one VM +3. Jump to another VM +4. See the restarting VM take over the display (replacing the +current one). +--- + src/machine.vala | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/src/machine.vala b/src/machine.vala +index 795058f2..7526bdd3 100644 +--- a/src/machine.vala ++++ b/src/machine.vala +@@ -161,6 +161,7 @@ protected void show_display () { + var widget = display.get_display (0); + widget_remove (widget); + window.display_page.show_display (display, widget); ++ window.topbar.status = this.name; + widget.grab_focus (); + + store_auth_credentials (); +@@ -203,10 +204,13 @@ protected void show_display () { + // Translators: The %s will be expanded with the name of the vm + window.topbar.status = _("Connecting to %s").printf (name); + +- show_id = _display.show.connect ((id) => { show_display (); }); ++ show_id = _display.show.connect ((id) => { ++ if (window != null && window.current_item == this) ++ show_display (); ++ }); + + hide_id = _display.hide.connect ((id) => { +- if (window != null) ++ if (window != null && window.current_item == this) + window.display_page.remove_display (); + }); + +@@ -235,8 +239,9 @@ protected void show_display () { + } + + load_screenshot (); +- +- disconnect_display (); ++ if (!stay_on_display) { ++ disconnect_display (); ++ } + }); + + need_password_id = _display.notify["need-password"].connect (handle_auth); +@@ -402,7 +407,8 @@ public virtual void disconnect_display () { + } + } + +- window.display_page.remove_display (); ++ if (window.current_item == this) ++ window.display_page.remove_display (); + if (!display.should_keep_alive ()) { + display.disconnect_it (); + display = null; +-- +2.28.0 + diff --git a/SOURCES/gnome-boxes-pass-discard-unmap-to-disk.patch b/SOURCES/gnome-boxes-pass-discard-unmap-to-disk.patch new file mode 100644 index 0000000..45b4fca --- /dev/null +++ b/SOURCES/gnome-boxes-pass-discard-unmap-to-disk.patch @@ -0,0 +1,51 @@ +From 780525f32851c0daaf4250dc734ba73d1571c1c1 Mon Sep 17 00:00:00 2001 +From: Felipe Borges +Date: Mon, 2 Nov 2020 15:35:36 +0100 +Subject: [PATCH] vm-configurator: Pass discard "unmap" to virtio-blk disks + +Ever since QEMU 4.0, virtio-blk disks have discard support[0]. For +this reason, we don't need to migrate to virtio-scsi[1] to benefit from +discard support. + +See also https://chrisirwin.ca/posts/discard-with-kvm-2020/ + +[0] https://bugzilla.redhat.com/1672680 +[1] https://bugzilla.redhat.com/1152037 + +Fixes #35 +--- + src/vm-configurator.vala | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/src/vm-configurator.vala b/src/vm-configurator.vala +index ee8cf133..f2a50bb8 100644 +--- a/src/vm-configurator.vala ++++ b/src/vm-configurator.vala +@@ -343,16 +343,21 @@ public static void set_target_media_config (Domain domain, + var disk = new DomainDisk (); + disk.set_type (DomainDiskType.FILE); + disk.set_guest_device_type (DomainDiskGuestDeviceType.DISK); +- disk.set_driver_name ("qemu"); +- disk.set_driver_format (DomainDiskFormat.QCOW2); + disk.set_source (target_path); +- disk.set_driver_cache (DomainDiskCacheType.WRITEBACK); ++ ++ var driver = new DomainDiskDriver (); ++ driver.set_name ("qemu"); ++ driver.set_format (DomainDiskFormat.QCOW2); ++ driver.set_cache (DomainDiskCacheType.WRITEBACK); ++ disk.set_driver (driver); + + var dev_letter_str = ((char) (dev_index + 97)).to_string (); + if (install_media.supports_virtio_disk || install_media.supports_virtio1_disk) { + debug ("Using virtio controller for the main disk"); + disk.set_target_bus (DomainDiskBus.VIRTIO); + disk.set_target_dev ("vd" + dev_letter_str); ++ ++ driver.set_discard (DomainDiskDriverDiscard.UNMAP); + } else { + if (install_media.prefers_q35) { + debug ("Using SATA controller for the main disk"); +-- +2.26.2 + diff --git a/SPECS/gnome-boxes.spec b/SPECS/gnome-boxes.spec index f3b277e..597ed9f 100644 --- a/SPECS/gnome-boxes.spec +++ b/SPECS/gnome-boxes.spec @@ -31,13 +31,25 @@ ExclusiveArch: x86_64 Name: gnome-boxes Version: 3.36.5 -Release: 2%{?dist} +Release: 8%{?dist} Summary: A simple GNOME 3 application to access remote or virtual systems License: LGPLv2+ URL: https://wiki.gnome.org/Apps/Boxes Source0: http://download.gnome.org/sources/%{name}/%{url_ver}/%{name}-%{version}.tar.xz +# https://bugzilla.redhat.com/1851089 +Patch0: gnome-boxes-download-from-url.patch +# https://bugzilla.redhat.com/1851043 +Patch1: gnome-boxes-dont-be-critical.patch +# https://bugzilla.redhat.com/1856717 +Patch2: gnome-boxes-disable-3d-acceleration.patch +Patch3: gnome-boxes-download-on-activate-signal.patch +# https://bugzilla.redhat.com/1639163 +Patch4: gnome-boxes-fix-mixing-vm-widgets.patch +# https://bugzilla.redhat.com/1152037 +Patch5: gnome-boxes-pass-discard-unmap-to-disk.patch + BuildRequires: gettext >= 0.19.8 BuildRequires: meson BuildRequires: vala >= 0.36.0 @@ -109,6 +121,12 @@ gnome-boxes lets you easily create, setup, access, and use: %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build %meson \ @@ -148,6 +166,30 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.gnome.Boxes.deskt %{_datadir}/metainfo/org.gnome.Boxes.appdata.xml %changelog +* Mon Nov 02 2020 Felipe Borges - 3.36.5-8 +- Pass discard "unmap" to supported disk drivers +- Related: #1152037 + +* Mon Nov 02 2020 Felipe Borges - 3.36.5-7 +- Fix mixing VM widgets +- Related: #1639163 + +* Mon Aug 10 2020 Felipe Borges - 3.36.5-6 +- Start downloads on the Assistant when pressing ENTER +- Related: #1851089 + +* Mon Jul 13 2020 Felipe Borges - 3.36.5-5 +- Disable 3D acceleration +- Related: #1856717 + +* Tue Jun 30 2020 Felipe Borges - 3.36.5-4 +- Don't create a tooltip if the URL for the OS is null +- Related: #1851043 + +* Wed Jun 24 2020 Felipe Borges - 3.36.5-3 +- Allow pasting URLs in the Assistant "Download an OS" search +- Related: #1851089 + * Mon Jun 22 2020 Felipe Borges - 3.36.5-2 - Recommend openssh-askpass - Related: #1052945