After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694428 - wizard: Don't reuse the same installer media
wizard: Don't reuse the same installer media
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: installer
unspecified
Other All
: Normal normal
: 3.22
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-02-22 10:16 UTC by Zeeshan Ali
Modified: 2016-03-31 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wizard: Don't reuse the same installer media (1.76 KB, patch)
2013-02-22 10:16 UTC, Zeeshan Ali
committed Details | Review

Description Zeeshan Ali 2013-02-22 10:16:55 UTC
See patch
Comment 1 Zeeshan Ali 2013-02-22 10:16:59 UTC
Created attachment 237159 [details] [review]
wizard: Don't reuse the same installer media

Currently it't not possible to launch multiple installations off the
same installer media (if chosen from media menu). This patch fixes the
issue by treating the original media user selected as template and
creating new media for each installation.
Comment 2 Alexander Larsson 2013-02-26 10:17:15 UTC
Review of attachment 237159 [details] [review]:

::: src/wizard-source.vala
@@ +327,3 @@
+    private async void on_media_selected (InstallerMedia media) {
+        try {
+            install_media = yield media_manager.create_installer_media_from_media (media);

This seems a bit weird. MediaManager already ran create_installer_media_from_media() on object returned from  create_for_path() or create_from_iso_info(). 

Do we really need to run all that code again, and is that safe?
What exactly is causing the parallel installs to not work?
Comment 3 Zeeshan Ali 2013-02-26 13:04:44 UTC
Review of attachment 237159 [details] [review]:

::: src/wizard-source.vala
@@ +327,3 @@
+    private async void on_media_selected (InstallerMedia media) {
+        try {
+            install_media = yield media_manager.create_installer_media_from_media (media);

Yes to first part. I can look into optimizing that part.

It should be as safe as when this code is first run. :) 

The problem is mainly that we have state in this object and if we use the same instance for multiple parallel installs, we are bound to have issues.
Comment 4 Alexander Larsson 2013-02-26 13:57:49 UTC
Review of attachment 237159 [details] [review]:

::: src/wizard-source.vala
@@ +327,3 @@
+    private async void on_media_selected (InstallerMedia media) {
+        try {
+            install_media = yield media_manager.create_installer_media_from_media (media);

It seems like we could avoid doing tthe create_installer_media_from_media the first time then?

Anyway, i guess this can go in for now, but it seems it can be made a bit less complex/inefficient in the future.
Comment 5 Zeeshan Ali 2013-02-26 14:14:56 UTC
Attachment 237159 [details] pushed as b496891 - wizard: Don't reuse the same installer media

I had forgotten to include the part about making MediaManager.create_installer_media_from_media, public but since it was implied in this patch and a minor change, I took the liberty to include that change.