diff --git a/SOURCES/don-t-hang-on-failure-to-handle-a-URL.patch b/SOURCES/don-t-hang-on-failure-to-handle-a-URL.patch new file mode 100644 index 0000000..dbcbb99 --- /dev/null +++ b/SOURCES/don-t-hang-on-failure-to-handle-a-URL.patch @@ -0,0 +1,37 @@ +From e0d4d2c2d2082f272f0492934a598d12280986bd Mon Sep 17 00:00:00 2001 +From: "Zeeshan Ali (Khattak)" +Date: Wed, 21 Aug 2013 23:03:41 +0300 +Subject: [PATCH] wizard: Don't hang on failure to handle a URL + +Boxes would just hang in wizard's preparation stage if you pass a path +to a file on a locally mounted remote share (e.g SMB). Although the real +solution is to be able to handle those, we should have this in place +just in case this codepath is walked for some other reason. + +https://bugzilla.gnome.org/show_bug.cgi?id=688798 +--- + src/wizard.vala | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/wizard.vala b/src/wizard.vala +index 14729f2..d007302 100644 +--- a/src/wizard.vala ++++ b/src/wizard.vala +@@ -240,8 +240,12 @@ private void prepare_for_location (string location, bool probing = false) throws + + if (uncertain) + prepare_for_uri (uri); +- else +- debug ("FIXME: %s".printf (mimetype)); ++ else { ++ debug ("Can't handle remote location '%s' (mime type: '%s')", ++ uri, ++ ContentType.get_mime_type (mimetype)); ++ throw new Boxes.Error.INVALID (_("Invalid URI")); ++ } + } + } + +-- +2.1.0 + diff --git a/SOURCES/handle-local-paths-to-remote-files.patch b/SOURCES/handle-local-paths-to-remote-files.patch new file mode 100644 index 0000000..6f1d0c2 --- /dev/null +++ b/SOURCES/handle-local-paths-to-remote-files.patch @@ -0,0 +1,68 @@ +From 157128e8fe95c4cd3e27118b57e091c6552d3d3d Mon Sep 17 00:00:00 2001 +From: "Zeeshan Ali (Khattak)" +Date: Wed, 21 Aug 2013 23:38:43 +0300 +Subject: [PATCH] wizard: Handle local paths to remote files + +There are two issues this patch fixes: + +* g_file_native() thinks of paths to locally mounted remote locations, as + non-native so Boxes errors out if given such paths. This patch fixes + the issue by replacing g_file_native() usage with a mannual check. + +* g_file_get_uri() gives us the remote URI even if you created the GFile + argument using the local path of the remote file. This patch fixes the + issue by using the original commandline argument if the argument is + not a path rathan than URI. + +Also we restrict the path/URI to filesystems that we know libvirt/qemu +can handle: local and mounted SMB shares. + +https://bugzilla.gnome.org/show_bug.cgi?id=688798 +--- + src/app.vala | 10 ++++++++-- + src/wizard.vala | 5 +++-- + 2 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/src/app.vala b/src/app.vala +index aae9222..a4e0e4b 100644 +--- a/src/app.vala ++++ b/src/app.vala +@@ -292,8 +292,14 @@ public int command_line (GLib.ApplicationCommandLine cmdline) { + + call_when_ready (() => { + var file = File.new_for_commandline_arg (arg); +- +- if (file.query_exists () || Uri.parse_scheme (arg) != null) ++ var is_uri = (Uri.parse_scheme (arg) != null); ++ ++ if (file.query_exists ()) { ++ if (is_uri) ++ wizard.open_with_uri (file.get_uri ()); ++ else ++ wizard.open_with_uri (arg); ++ } else if (is_uri) + wizard.open_with_uri (file.get_uri ()); + else + open (arg); +diff --git a/src/wizard.vala b/src/wizard.vala +index 9ff99f5..c99e0af 100644 +--- a/src/wizard.vala ++++ b/src/wizard.vala +@@ -227,11 +227,12 @@ private void prepare_for_location (string location, bool probing = false) throws + throw new Boxes.Error.INVALID ("empty location"); + + var file = location.contains ("://")? File.new_for_uri (location) : File.new_for_path (location); ++ var path = file.get_path (); + +- if (file.is_native ()) { ++ if (path != null && (file.has_uri_scheme ("file") || file.has_uri_scheme ("smb"))) { + // FIXME: We should able to handle non-local URIs here too + if (!probing) +- prepare_for_installer (file.get_path ()); ++ prepare_for_installer (path); + } else { + bool uncertain; + var uri = file.get_uri (); +-- +2.1.0 + diff --git a/SOURCES/handle-paths-as-well.patch b/SOURCES/handle-paths-as-well.patch new file mode 100644 index 0000000..8cb0fb7 --- /dev/null +++ b/SOURCES/handle-paths-as-well.patch @@ -0,0 +1,29 @@ +From e0207f301ae78983d5004bc93943cf2fffdc0b5e Mon Sep 17 00:00:00 2001 +From: "Zeeshan Ali (Khattak)" +Date: Wed, 21 Aug 2013 23:36:46 +0300 +Subject: [PATCH] wizard: Handle paths as well + +In commit 3c1b44c, we lost the ability to handle local paths in wizard. +This patch brings back that ability. + +https://bugzilla.gnome.org/show_bug.cgi?id=688798 +--- + src/wizard.vala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/wizard.vala b/src/wizard.vala +index d007302..9ff99f5 100644 +--- a/src/wizard.vala ++++ b/src/wizard.vala +@@ -226,7 +226,7 @@ private void prepare_for_location (string location, bool probing = false) throws + if (location == "") + throw new Boxes.Error.INVALID ("empty location"); + +- var file = File.new_for_uri (location); ++ var file = location.contains ("://")? File.new_for_uri (location) : File.new_for_path (location); + + if (file.is_native ()) { + // FIXME: We should able to handle non-local URIs here too +-- +2.1.0 + diff --git a/SOURCES/minor-simplification-of-code.patch b/SOURCES/minor-simplification-of-code.patch new file mode 100644 index 0000000..a34fd69 --- /dev/null +++ b/SOURCES/minor-simplification-of-code.patch @@ -0,0 +1,41 @@ +From f8757108221427d828bdc362438737a566e5a42d Mon Sep 17 00:00:00 2001 +From: "Zeeshan Ali (Khattak)" +Date: Thu, 22 Aug 2013 03:29:07 +0300 +Subject: [PATCH] app: Minor simplification of code + +https://bugzilla.gnome.org/show_bug.cgi?id=688798 +--- + src/app.vala | 14 ++++++-------- + 1 file changed, 6 insertions(+), 8 deletions(-) + +diff --git a/src/app.vala b/src/app.vala +index f7b6c34..aae9222 100644 +--- a/src/app.vala ++++ b/src/app.vala +@@ -289,17 +289,15 @@ public int command_line (GLib.ApplicationCommandLine cmdline) { + }); + } else if (opt_uris != null) { + var arg = opt_uris[0]; +- var file = File.new_for_commandline_arg (arg); + +- if (file.query_exists () || Uri.parse_scheme (arg) != null) { +- call_when_ready (() => { ++ call_when_ready (() => { ++ var file = File.new_for_commandline_arg (arg); ++ ++ if (file.query_exists () || Uri.parse_scheme (arg) != null) + wizard.open_with_uri (file.get_uri ()); +- }); +- } else { +- call_when_ready (() => { ++ else + open (arg); +- }); +- } ++ }); + } + + if (opt_search != null) { +-- +2.1.0 + diff --git a/SOURCES/refresh-volume-info-after-resi.patch b/SOURCES/refresh-volume-info-after-resi.patch new file mode 100644 index 0000000..af64d4a --- /dev/null +++ b/SOURCES/refresh-volume-info-after-resi.patch @@ -0,0 +1,58 @@ +From 7bb256eb1ec8549b0902bfa921b8984c9a0bf50d Mon Sep 17 00:00:00 2001 +From: "Zeeshan Ali (Khattak)" +Date: Thu, 13 Mar 2014 15:56:32 +0000 +Subject: [PATCH 2/2] libvirt-machine-props: Refresh volume info after resize + +For running machines, we make use of special libvirt API that operates +on GVir.DomainDisk rather than GVir.StorageVol and its the latter Boxes +reads current capacity info from (actually there is no way to read +capacity from GVir.DomainDisk) so what happens is that when you change the +capacity of a running machine, get out of properties and back again, +you find the capacity to remain unchanged even though the actual +capacity was changed. + +This patch fixes the issue by refreshing the storage pool and refetching +the volume info after changing the capacity through GVir.DomainDisk.resize. + +Conflicts: + src/libvirt-machine-properties.vala +--- + src/libvirt-machine-properties.vala | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala +index 97dcd85..458fed3 100644 +--- a/src/libvirt-machine-properties.vala ++++ b/src/libvirt-machine-properties.vala +@@ -569,11 +569,26 @@ private void on_storage_changed (Boxes.Property property, uint64 value) { + if (disk != null) { + var size = (value + Osinfo.KIBIBYTES - 1) / Osinfo.KIBIBYTES; + disk.resize (size, 0); ++ ++ var pool = get_storage_pool (machine.connection); ++ pool.refresh_async.begin (null, (obj, res) => { ++ try { ++ pool.refresh_async.end (res); ++ machine.update_domain_config (); ++ debug ("Storage changed to %llu KiB", size); ++ } catch (GLib.Error error) { ++ warning ("Failed to change storage capacity of volume '%s' to %llu KiB: %s", ++ machine.storage_volume.get_name (), ++ size, ++ error.message); ++ } ++ }); + } +- } else ++ } else { + // Currently this never happens as properties page cant be reached without starting the machine + machine.storage_volume.resize (value, StorageVolResizeFlags.NONE); +- debug ("Storage changed to %llu", value); ++ debug ("Storage changed to %llu", value); ++ } + } catch (GLib.Error error) { + warning ("Failed to change storage capacity of volume '%s' to %llu: %s", + machine.storage_volume.get_name (), +-- +2.1.0 + diff --git a/SOURCES/volume-size-is-correct-units.patch b/SOURCES/volume-size-is-correct-units.patch new file mode 100644 index 0000000..28db517 --- /dev/null +++ b/SOURCES/volume-size-is-correct-units.patch @@ -0,0 +1,36 @@ +From 57e4fdbc608b96ee261cf64e14aa267338b213f4 Mon Sep 17 00:00:00 2001 +From: "Zeeshan Ali (Khattak)" +Date: Wed, 12 Mar 2014 22:41:04 +0000 +Subject: [PATCH 1/2] libvirt-machine-props: Volume size is correct units + +GVir.DomainDisk.resize expects values in KiB. + +I'm not entirely sure if it helps with the following bug but my guess is +that it does as the disk capacity really must have been set to that +insane value because of the issue this bug fixes. + +https://bugzilla.gnome.org/show_bug.cgi?id=725384 +--- + src/libvirt-machine-properties.vala | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala +index 82d0a87..97dcd85 100644 +--- a/src/libvirt-machine-properties.vala ++++ b/src/libvirt-machine-properties.vala +@@ -566,8 +566,10 @@ private void on_storage_changed (Boxes.Property property, uint64 value) { + try { + if (machine.is_running ()) { + var disk = machine.get_domain_disk (); +- if (disk != null) +- disk.resize (value, 0); ++ if (disk != null) { ++ var size = (value + Osinfo.KIBIBYTES - 1) / Osinfo.KIBIBYTES; ++ disk.resize (size, 0); ++ } + } else + // Currently this never happens as properties page cant be reached without starting the machine + machine.storage_volume.resize (value, StorageVolResizeFlags.NONE); +-- +2.1.0 + diff --git a/SPECS/gnome-boxes.spec b/SPECS/gnome-boxes.spec index 6fc5bbe..64648e1 100644 --- a/SPECS/gnome-boxes.spec +++ b/SPECS/gnome-boxes.spec @@ -31,7 +31,7 @@ ExclusiveArch: x86_64 Name: gnome-boxes Version: 3.8.3 -Release: 8%{?dist} +Release: 11%{?dist} Summary: A simple GNOME 3 application to access remote or virtual systems Group: Applications/Emulators @@ -39,7 +39,7 @@ License: LGPLv2+ URL: https://live.gnome.org/Boxes Source0: http://download.gnome.org/sources/%{name}/%{url_ver}/%{name}-%{version}.tar.xz -BuildRequires: libgovirt-devel +BuildRequires: libgovirt-devel >= 0.3.0 BuildRequires: intltool BuildRequires: vala-devel >= 0.17.3 BuildRequires: vala-tools >= 0.17.3 @@ -106,6 +106,18 @@ Patch6: ignore-CDROM-devices.patch # Boxes can't handle ISO9660 USB devices Patch7: ignore-non-readable-devices.patch +# https://bugzilla.gnome.org/show_bug.cgi?id=1049316 +# Disk size changes sets capacity to huge values +Patch8: volume-size-is-correct-units.patch +Patch9: refresh-volume-info-after-resi.patch + +# https://bugzilla.gnome.org/show_bug.cgi?id=1046251 +# Attempt to boot installer from Internet does not error out +Patch10: don-t-hang-on-failure-to-handle-a-URL.patch +Patch11: handle-paths-as-well.patch +Patch12: minor-simplification-of-code.patch +Patch13: handle-local-paths-to-remote-files.patch + %description gnome-boxes lets you easily create, setup, access, and use: * remote machines @@ -125,6 +137,12 @@ gnome-boxes lets you easily create, setup, access, and use: %patch5 -p1 -b .don-t-register-for-x-content-bootable-media %patch6 -p1 -b .ignore-CDROM-devices %patch7 -p1 -b .ignore-non-readable-devices +%patch8 -p1 -b .volume-size-is-correct-units +%patch9 -p1 -b .refresh-volume-info-after-resi +%patch10 -p1 -b .don-t-hang-on-failure-to-handle-a-URL +%patch11 -p1 -b .handle-paths-as-well +%patch12 -p1 -b .minor-simplification-of-code +%patch13 -p1 -b .handle-local-paths-to-remote-files %build #fedora-legal and the fedora board permit logos to be enabled @@ -172,6 +190,19 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_datadir}/gnome-shell/search-providers/gnome-boxes-search-provider.ini %changelog +* Mon Oct 13 2014 Zeeshan Ali - 3.8.3-11 +- Don't hang on failure to handle a URL (related: #1046251). +- Handle paths as well (related: #1046251). +- Handle local paths to remote files (related: #1046251). + +* Thu Oct 9 2014 Zeeshan Ali - 3.8.3-10 +- Set volume capacity in correct units (related: #1049316). +- Refresh volume info after resize (related: #1049316). + +* Thu Jul 24 2014 Marc-Andre Lureau - 3.8.3-9 +- Rebuild to pick new libgovirt + Resolves: #1117928 + * Mon Mar 17 2014 Zeeshan Ali - 3.8.3-8 - Don't register for 'x-content/bootable-media' (related: #1072611). - Ignore CDROM devices (related: #1072611).