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 665254 - New way to handle live and unknown media
New way to handle live and unknown media
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-12-01 00:03 UTC by Zeeshan Ali
Modified: 2016-03-31 13:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allocate storage to pure live media (2.14 KB, patch)
2011-12-01 00:03 UTC, Zeeshan Ali
accepted-commit_now Details | Review
Only apply post-install config when installation is done (8.76 KB, patch)
2011-12-01 00:03 UTC, Zeeshan Ali
reviewed Details | Review
Reboot should destroy (shutdown) VM on first boot (3.12 KB, patch)
2011-12-01 00:03 UTC, Zeeshan Ali
none Details | Review
wizard: Skip 'review' for pure live media (1.13 KB, patch)
2011-12-01 00:03 UTC, Zeeshan Ali
accepted-commit_now Details | Review
Handle non-pure live & unknown media like pure live (4.65 KB, patch)
2011-12-01 00:03 UTC, Zeeshan Ali
none Details | Review
Only apply post-install config when installation is done (8.94 KB, patch)
2011-12-02 14:44 UTC, Zeeshan Ali
none Details | Review
Only apply post-install config when installation is done (8.97 KB, patch)
2011-12-02 15:13 UTC, Zeeshan Ali
none Details | Review
Allocate storage to pure live media (2.14 KB, patch)
2011-12-03 00:45 UTC, Zeeshan Ali
committed Details | Review
Only apply post-install config when installation is done (8.99 KB, patch)
2011-12-03 00:45 UTC, Zeeshan Ali
none Details | Review
Reboot should destroy (shutdown) VM on first boot (2.40 KB, patch)
2011-12-03 00:45 UTC, Zeeshan Ali
committed Details | Review
wizard: Skip 'review' for pure live media (1.13 KB, patch)
2011-12-03 00:46 UTC, Zeeshan Ali
committed Details | Review
Handle non-pure live & unknown media like pure live (4.49 KB, patch)
2011-12-03 00:46 UTC, Zeeshan Ali
none Details | Review
Delete associated volume after transient domain is destroyed (1.23 KB, patch)
2011-12-03 00:46 UTC, Zeeshan Ali
committed Details | Review
Only apply post-install config when installation is done (4.77 KB, patch)
2011-12-07 11:21 UTC, Zeeshan Ali
committed Details | Review
Handle non-pure live & unknown media like pure live (4.47 KB, patch)
2011-12-07 11:22 UTC, Zeeshan Ali
committed Details | Review

Description Zeeshan Ali 2011-12-01 00:03:09 UTC
For live (pure or otherwise) and unknown media:

* Create a transient domain (but do allocate storage).
* On shutdown: if anything was installed on storage, create a parmanent
  domain for the media in question and set it to boot from hard-disk.
* Skip the 'review' page on wizard, not just 'setup'.

For known media without live-mode support:

* Create a parmanent domain with storage.
* On shutdown: if anything was installed on storage, modify the config to
  make it boot from hard-disk.
Comment 1 Zeeshan Ali 2011-12-01 00:03:12 UTC
Created attachment 202489 [details] [review]
Allocate storage to pure live media

We use qcow2 so it doesn't really matter if storage goes unused but we
should do this just in case our knowledge/assumption about inavailability
of installer is wrong.
Comment 2 Zeeshan Ali 2011-12-01 00:03:16 UTC
Created attachment 202490 [details] [review]
Only apply post-install config when installation is done

For domains we create ourselves, we now check for signs of OS
installation after (every) shutdown. If we find any, only then we apply
the post-install configuration (boot installed OS).

For pure live media, this additionally implies that its domain is
destroyed automatically on first shutdown, unless it installed an OS.
Comment 3 Zeeshan Ali 2011-12-01 00:03:18 UTC
Created attachment 202491 [details] [review]
Reboot should destroy (shutdown) VM on first boot

We manually start the domain after the shutdown but we need to have this
shutdown in between for our post-install setup to be able to kick-in.
Comment 4 Zeeshan Ali 2011-12-01 00:03:21 UTC
Created attachment 202492 [details] [review]
wizard: Skip 'review' for pure live media

Previously we only skipped 'setup' page for pure live media. The idea is
to launch an initially transient box as quickly as possible w/o asking
any questions when user inserts a transient box.
Comment 5 Zeeshan Ali 2011-12-01 00:03:23 UTC
Created attachment 202493 [details] [review]
Handle non-pure live & unknown media like pure live

Handle live+installer and unknown media just like pure live media.
Comment 6 Marc-Andre Lureau 2011-12-02 10:22:57 UTC
Review of attachment 202489 [details] [review]:

ack
Comment 7 Marc-Andre Lureau 2011-12-02 10:24:07 UTC
Review of attachment 202489 [details] [review]:

how/when is the image deleted if it's pure live-media? is that covered by following patches?
Comment 8 Marc-Andre Lureau 2011-12-02 11:23:42 UTC
Review of attachment 202490 [details] [review]:

::: src/os-database.vala
@@ +81,3 @@
     }
 
+    public Resources? get_minimum_resources_for_os (Os os) {

it could take string[] prefs as argument, just like get_prefered_resources()

@@ +83,3 @@
+    public Resources? get_minimum_resources_for_os (Os os) {
+        // Prefer x86_64 resources
+        string[] prefs = {"x86_64", "i686", "i386", ARCHITECTURE_ALL};

you could make that static private data?
Comment 9 Marc-Andre Lureau 2011-12-02 11:42:22 UTC
Review of attachment 202492 [details] [review]:

ack

(we need to be careful of steps/pages with side effects that we skip. I thought initially that the skip_page() would be done after step methods are called, but here you really jump over it, that's fine here)
Comment 10 Zeeshan Ali 2011-12-02 12:26:50 UTC
(In reply to comment #7)
> Review of attachment 202489 [details] [review]:
> 
> how/when is the image deleted if it's pure live-media? is that covered by
> following patches?

No, just like other domains we are *not* deleting the associated storage yet. Perhaps in case of live, we should do that since domains are automatically deleted w/o user's consent?
Comment 11 Marc-Andre Lureau 2011-12-02 12:27:50 UTC
(In reply to comment #10)
> (In reply to comment #7)
> > Review of attachment 202489 [details] [review] [details]:
> > 
> > how/when is the image deleted if it's pure live-media? is that covered by
> > following patches?
> 
> No, just like other domains we are *not* deleting the associated storage yet.
> Perhaps in case of live, we should do that since domains are automatically
> deleted w/o user's consent?

I think so too.
Comment 12 Zeeshan Ali 2011-12-02 12:31:09 UTC
(In reply to comment #8)
> Review of attachment 202490 [details] [review]:
> 
> ::: src/os-database.vala
> @@ +81,3 @@
>      }
> 
> +    public Resources? get_minimum_resources_for_os (Os os) {
> 
> it could take string[] prefs as argument, just like get_prefered_resources()

   prefs are private to OsDatabase class and I don't see any need to expose other classes to that detail. This function is more like get_resources_for_os() rather.

> @@ +83,3 @@
> +    public Resources? get_minimum_resources_for_os (Os os) {
> +        // Prefer x86_64 resources
> +        string[] prefs = {"x86_64", "i686", "i386", ARCHITECTURE_ALL};
> 
> you could make that static private data?

Yeah!
Comment 13 Zeeshan Ali 2011-12-02 14:44:17 UTC
Created attachment 202617 [details] [review]
Only apply post-install config when installation is done

For domains we create ourselves, we now check for signs of OS
installation after (every) shutdown. If we find any, only then we apply
the post-install configuration (boot installed OS).

For pure live media, this additionally implies that its domain is
destroyed automatically on first shutdown, unless it installed an OS.
Comment 14 Zeeshan Ali 2011-12-02 15:13:39 UTC
Created attachment 202623 [details] [review]
Only apply post-install config when installation is done

For domains we create ourselves, we now check for signs of OS
installation after (every) shutdown. If we find any, only then we apply
the post-install configuration (boot installed OS).

For pure live media, this additionally implies that its domain is
destroyed automatically on first shutdown, unless it installed an OS.
Comment 15 Zeeshan Ali 2011-12-03 00:45:32 UTC
Created attachment 202668 [details] [review]
Allocate storage to pure live media

We use qcow2 so it doesn't really matter if storage goes unused but we
should do this just in case our knowledge/assumption about inavailability
of installer is wrong.
Comment 16 Zeeshan Ali 2011-12-03 00:45:43 UTC
Created attachment 202669 [details] [review]
Only apply post-install config when installation is done

For domains we create ourselves, we now check for signs of OS
installation after (every) shutdown. If we find any, only then we apply
the post-install configuration (boot installed OS).

For pure live media, this additionally implies that its domain is
destroyed automatically on first shutdown, unless it installed an OS.
Comment 17 Zeeshan Ali 2011-12-03 00:45:52 UTC
Created attachment 202670 [details] [review]
Reboot should destroy (shutdown) VM on first boot

We manually start the domain after the shutdown but we need to have this
shutdown in between for our post-install setup to be able to kick-in.
Comment 18 Zeeshan Ali 2011-12-03 00:46:05 UTC
Created attachment 202671 [details] [review]
wizard: Skip 'review' for pure live media

Previously we only skipped 'setup' page for pure live media. The idea is
to launch an initially transient box as quickly as possible w/o asking
any questions when user inserts a transient box.
Comment 19 Zeeshan Ali 2011-12-03 00:46:14 UTC
Created attachment 202672 [details] [review]
Handle non-pure live & unknown media like pure live

Handle live+installer and unknown media just like pure live media.
Comment 20 Zeeshan Ali 2011-12-03 00:46:25 UTC
Created attachment 202673 [details] [review]
Delete associated volume after transient domain is destroyed
Comment 21 Zeeshan Ali 2011-12-03 00:56:56 UTC
(In reply to comment #20)
> Created an attachment (id=202673) [details] [review]
> Delete associated volume after transient domain is destroyed

This one requires a libvirt-glib patch from me that is pending-review.
Comment 22 Zeeshan Ali 2011-12-07 11:21:47 UTC
Created attachment 202977 [details] [review]
Only apply post-install config when installation is done

For domains we create ourselves, we now check for signs of OS
installation after (every) shutdown. If we find any, only then we apply
the post-install configuration (boot installed OS).

For pure live media, this additionally implies that its domain is
destroyed automatically on first shutdown, unless it installed an OS.
Comment 23 Zeeshan Ali 2011-12-07 11:22:18 UTC
Created attachment 202978 [details] [review]
Handle non-pure live & unknown media like pure live

Handle live+installer and unknown media just like pure live media.
Comment 24 Marc-Andre Lureau 2011-12-07 12:29:00 UTC
Review of attachment 202668 [details] [review]:

ack
Comment 25 Marc-Andre Lureau 2011-12-07 12:29:34 UTC
Review of attachment 202670 [details] [review]:

ack
Comment 26 Marc-Andre Lureau 2011-12-07 12:32:51 UTC
Review of attachment 202671 [details] [review]:

are you sure you can't remove the idle at the same time?
Comment 27 Marc-Andre Lureau 2011-12-07 12:33:40 UTC
Review of attachment 202673 [details] [review]:

ack
Comment 28 Marc-Andre Lureau 2011-12-07 12:36:32 UTC
Review of attachment 202977 [details] [review]:

ack
Comment 29 Marc-Andre Lureau 2011-12-07 12:39:21 UTC
Review of attachment 202978 [details] [review]:

ack
Comment 30 Zeeshan Ali 2011-12-07 13:09:48 UTC
Attachment 202668 [details] pushed as 94f45c8 - Allocate storage to pure live media
Attachment 202670 [details] pushed as b05bc13 - Reboot should destroy (shutdown) VM on first boot
Attachment 202671 [details] pushed as 8cd0a52 - wizard: Skip 'review' for pure live media
Attachment 202673 [details] pushed as 77ee7bf - Delete associated volume after transient domain is destroyed
Attachment 202977 [details] pushed as d6abb9b - Only apply post-install config when installation is done
Attachment 202978 [details] pushed as 6180358 - Handle non-pure live & unknown media like pure live