I'm against changing semantic of "start" operation based on some property. You
basically want that if VM has disposable=true, then VM start really does:
1. Clone the VM to "${basename}-{$uid}"
2. Start that cloned one
So you mean here that setting disposable=true makes that VM a _template_ for
new "DispVMs"? If implementing it this way (but see below for alternatives), I
think it should be rather separate VM type, not a simple property. Otherwise
you'll need to worry about many problems like "what happens when TemplateVM
have disposable=true" or so.
On the other hand it might have sense to have disposable=true for NetVM. But
if that property changes the VM to DispVM template which is only used to
create new DispVMs - differently named, it will be rather problematic to
reference that VM from other places.
Technically /rw of DispVM template VM (fedora-20-x64-dvm) exists. Savefile
preparation looks like this:
1. The VM is started normally, with /rw mounted (but not as /home)
2. If /rw/home/user/.qubes-dispvm-customized exists, /rw/home is used as
template for /home
3. dispvm-prerun script is called (which starts some common apps for a moment
to warm caches, create config files etc).
4. /rw is unmounted, device detached
5. VM state is saved
So for such new DispVMs you'll need two start modes:
1. Normal start for VM configuration (customization of files in /rw/home)
2. Start new DispVM based on such template
Perhaps we could create new tool qvm-start-dvm, which will create new DispVM
based on selected VM (using above procedure, with savefile or not). Then
create new RPC policy action/dstvm keyword ("$dispvm:docviewer"?) to use this
mechanism.
> We still might have a default dispvm in the system, of course -- this
> would be based on the default template and using default netvm and
> default f/w settings.
>
> The policies could then be defined like this:
>
> work docviewer allow
> anonvm $anyvm deny
>
> The reason #2 given above (quick start from savefile) is somehow
> orthogonal to the property discussed in #1 -- I think we can use it even
> for normal AppVMs, just make sure we generate the savefile without /rw
> and then mount it after the VM wakes up after restore.
Except that xen/kernel support for that is often broken... Infamous 4GB memory
limit, single vCPU, or recent balloon driver problems at least.
> In some other scenarios, we might not want to, or not be able to, use
> savefile restoration even for the VMs with "disposable" flag (e.g.
> Windows AppVMs).
>
> The above change should allow for more flexible and powerful
> configurations, satisfying various users who often have varying
> expectations as witnessed in the original thread.
>
> I wouldn't even be entirely against introduction of the "disposable"
> flag before R2, if that is really so simple as I think :) Marek, what's
> your take on this?
I'm strongly against introducing any new feature before R2 release. We are at
release candidate stage, we should fix current bugs and release final R2 (or
rc2). Otherwise final R2 will never happen...
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?