On Mon, Feb 19, 2018 at 10:29:18 +0100, Andrea Bolognani wrote:
On Mon, 2018-02-19 at 07:24 +0100, Peter Krempa wrote:
> On Fri, Feb 16, 2018 at 17:28:03 +0100, Andrea Bolognani wrote:
> > Validate time is a bit too early to check whether the required
> > capabilities are available, since the QEMU binary might have
> > been updated or replaced by the time we are asked to run the
> > guest.
>
> So are you having problem with the fact that the definition will be
> rejected right away and not just when you try to start it?
>
> Validate is re-run when starting the VM so a downgrade is handled
> properly.
Right, but isn't checking for QEMU capabilities at validate time
unreasonably strict?
Well, the only difference is that you are unable to 'define' such XML. I
don't think it's strict since you would not be able to run it anyways.
A guest which uses eg. an invalid combination
of machine type and architecture will never become valid at a later
point, but a guest should not be considered invalid just because
the QEMU binary you happened to have installed at the time you
defined it lacked some features - the guest itself is perfectly
valid, it just can't be run :)
I think the term 'guest' here is misleading. The configuration is
invalid and thus you can't really create a guest out of it.
This is actually a great example, as you actually are not able to define
a XML which would fail to be run anyways.
The specific reason for the validation callback is to not make the
definition vanish in such case.
In general, I think that the command line generator is the wrong place
for such checks since they are scattered around and you can't really
figure out whether you can start such config until you've done a lot of
preparation steps.