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 673856 - Missing ISO source should not be treated as a fatal error
Missing ISO source should not be treated as a fatal error
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
3.4.x (unsupported)
Other Linux
: Normal major
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-04-10 19:23 UTC by Cosimo Cecchi
Modified: 2016-03-31 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Mark CD-ROM device as optional (1.36 KB, patch)
2012-04-12 02:58 UTC, Zeeshan Ali
none Details | Review
Mark CD-ROM device as optional after installation (2.22 KB, patch)
2012-04-12 21:11 UTC, Zeeshan Ali
committed Details | Review

Description Cosimo Cecchi 2012-04-10 19:23:23 UTC
To reproduce:
- download an ISO image, e.g. an Ubuntu ISO
- create a VM for it in Boxes and install it
- once the whole installation process finishes, shut down the VM
- delete the original ISO file
- the VM doesn't start anymore; no error is displayed, but on the command line there's an error mentioning qemu-kvm is not able to find the original ISO file

Editing the qemu configuration file with virsh and removing the drive device makes the VM boot again. Boxes should take care of automatically updating the configuration file instead, if the missing drive is not required for booting the machine.
Comment 1 Zeeshan Ali 2012-04-12 02:58:15 UTC
Created attachment 211892 [details] [review]
Mark CD-ROM device as optional

This is done to tell libvirt/qemu to not panic if ISO file/device is
unavailable.
Comment 2 Zeeshan Ali 2012-04-12 02:59:51 UTC
(In reply to comment #1)
> Created an attachment (id=211892) [details] [review]
> Mark CD-ROM device as optional
> 
> This is done to tell libvirt/qemu to not panic if ISO file/device is
> unavailable.

Requires my 'Getter/setter for disk source's startupPolicy attribute' libvirt-glib patch that is pending review on libvir list.
Comment 3 Christophe Fergeau 2012-04-12 08:15:40 UTC
If the install is done, we don't need to keep the iso around. If the install is not done, the VM will be non-functional without the iso. In this case, it would probably be nicer to explain the user what's going on with some kind of error message/notification.
I don't know if we need to be careful about livecds too here where my understanding is that the iso is mandatory?
Comment 4 Marc-Andre Lureau 2012-04-12 11:36:22 UTC
(In reply to comment #3)
> If the install is done, we don't need to keep the iso around. If the install is
> not done, the VM will be non-functional without the iso. In this case, it would
> probably be nicer to explain the user what's going on with some kind of error
> message/notification.

virt-manager unmounts automatically, which sometime works and sometime doesn't, depending on how you performed the installation. I guess unattended install have more chance to do this right.

btw, something I think we miss in the VM settings, is a way to mount/unmount isos.


> I don't know if we need to be careful about livecds too here where my
> understanding is that the iso is mandatory?

yes
Comment 5 Zeeshan Ali 2012-04-12 21:11:15 UTC
Created attachment 211959 [details] [review]
Mark CD-ROM device as optional after installation

This is done to tell libvirt/qemu to not panic if ISO file/device is
unavailable after OS installation.
Comment 6 Christophe Fergeau 2012-04-13 15:33:28 UTC
Why not remove (eject) them?
Comment 7 Zeeshan Ali 2012-04-13 15:46:52 UTC
(In reply to comment #6)
> Why not remove (eject) them?

Sometimes you (as user) need the installation media after installation (especially in case of windows) and we currently dont have any way to add cdrom devices to existing domains.
Comment 8 Christophe Fergeau 2012-04-13 15:53:21 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Why not remove (eject) them?
> 
> Sometimes you (as user) need the installation media after installation
> (especially in case of windows) 

I don't think I've ever had that need in a long time... Aren't you told to remove the CD most of the time at the end of installers?
Comment 9 Zeeshan Ali 2012-04-13 15:56:45 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > Why not remove (eject) them?
> > 
> > Sometimes you (as user) need the installation media after installation
> > (especially in case of windows) 
> 
> I don't think I've ever had that need in a long time... Aren't you told to
> remove the CD most of the time at the end of installers?

Yes but there is the assumption that user can easily insert the CD back in whenever needed.
Comment 10 Christophe Fergeau 2012-04-13 16:19:52 UTC
(In reply to comment #9)

> Yes but there is the assumption that user can easily insert the CD back in
> whenever needed.

Which would be the thing to fix rather than workarounding it, no?
Comment 11 Zeeshan Ali 2012-04-13 16:32:12 UTC
(In reply to comment #10)
> (In reply to comment #9)
> 
> > Yes but there is the assumption that user can easily insert the CD back in
> > whenever needed.
> 
> Which would be the thing to fix rather than workarounding it, no?

Unless there is a good reason to remove the cdrom after installation (keep in mind that our detection for "installation complete" is hardly reliable), I don't see this is a work-around.
Comment 12 Christophe Fergeau 2012-04-13 16:36:09 UTC
To me that just makes our installation code look unpolished...
Comment 13 Zeeshan Ali 2012-04-13 16:53:20 UTC
(In reply to comment #12)
> To me that just makes our installation code look unpolished...

Or that there is no (not so extremely difficult to implement) way to do this. Suggestions on better logic are more than welcomed here.
Comment 14 Christophe Fergeau 2012-04-13 16:57:05 UTC
"this"? detect the end of the install? Or something else?
Comment 15 Zeeshan Ali 2012-04-13 17:01:08 UTC
(In reply to comment #14)
> "this"? detect the end of the install?

Yes.
Comment 16 Zeeshan Ali 2012-04-17 02:48:09 UTC
So whats the verdict on this one?
Comment 17 Christophe Fergeau 2012-04-17 11:54:45 UTC
Well, I don't know what to tell you, at first you insist that things should be done this way for reasons that were not convincing to me, then you bring up some limitations in the current code which would make alternative worse than what your patch does, but I don't know where these current limitations are documented, which makes it hard to think about them. So dunno unfortunately
Comment 18 Zeeshan Ali 2012-04-17 17:23:58 UTC
Attachment 211959 [details] pushed as 7e46c24 - Mark CD-ROM device as optional after installation
Comment 19 Marc-Andre Lureau 2012-04-17 21:03:20 UTC
fwiw, this seems quite flaky to me too. I think we could have reached a better decision. It feels like hiding a problem.
Comment 20 Marc-Andre Lureau 2012-04-17 21:11:32 UTC
I would have split into various bug:
- the error message should have been made explicit
- there could be an additional property to unmount iso
- there could be a way to mount back iso
- we should find a way to unmount the iso automatically when no longer need. It might not be possible for all distro today, but it should be possible for some. For example, some distro eject CD/DVD at end of install. We could also push for an agent notification etc..
Comment 21 Christophe Fergeau 2012-04-17 21:21:55 UTC
(In reply to comment #20)
> - there could be an additional property to unmount iso
> - there could be a way to mount back iso

For everything related to removable media and devices, we don't have any designs at the moment afaik, we'll need help there.

> We could also push for an agent notification etc..

Yes, I was thinking that spice-gtk could expose a property telling us if an agent is running, this would be a reliable way to detect when an automatic install is done imo.
Comment 22 Marc-Andre Lureau 2012-04-17 21:37:11 UTC
(In reply to comment #21)
> For everything related to removable media and devices, we don't have any
> designs at the moment afaik, we'll need help there.

Yes, but at least we could have a simple lable and a button in the properties page. Somethink like

CD/DVD:   path-to-iso [⏏]
CD/DVD:   [Mount an ISO]            

Not saying it should be the final design, but at least we would have it ready, only UI would need to be modified.

> > We could also push for an agent notification etc..
> 
> Yes, I was thinking that spice-gtk could expose a property telling us if an
> agent is running, this would be a reliable way to detect when an automatic
> install is done imo.

That's not just agent is running (there is agent-connected property for that in spice-gtk), and I don't think it fits very well in spice agent. We have plenty of agents, so we just need to find which one is best. No clear idea.
Comment 23 Marc-Andre Lureau 2012-04-17 21:38:29 UTC
I forgot to say why agent-connected is not enough: we also want the installers and live-cd to use the agent.
Comment 24 Zeeshan Ali 2012-04-17 21:44:39 UTC
(In reply to comment #20)
> I would have split into various bug:
> - the error message should have been made explicit
> - there could be an additional property to unmount iso
> - there could be a way to mount back iso
> - we should find a way to unmount the iso automatically when no longer need. It
> might not be possible for all distro today, but it should be possible for some.
> For example, some distro eject CD/DVD at end of install. We could also push for
> an agent notification etc..

Could you file those as separate bugs please, then we can solve/discuss them one by one.
Comment 25 Christophe Fergeau 2012-04-18 09:09:54 UTC
(In reply to comment #23)
> I forgot to say why agent-connected is not enough: we also want the installers
> and live-cd to use the agent.

Ah comment #22 makes more sense with this :) I was indeed thinking of using agent-connected for that.