On Tue, Oct 04, 2016 at 18:25:32 +0200, Michal Privoznik wrote:
On 04.10.2016 18:03, Peter Krempa wrote:
> On Fri, Sep 30, 2016 at 15:28:08 +0200, Daniel Veillard wrote:
>> On Fri, Sep 30, 2016 at 11:37:08AM +0200, Guido Günther wrote:
>>> On Tue, Sep 27, 2016 at 10:14:36PM +0200, Daniel Veillard wrote:
[...]
Agreed. However, we should really make this work. I mean, the idea
that
the domain def *copy* function also fills in some blanks, or prepares
domain definition for something is really just combining two separate
steps into one (that's why we ran into the issue I am fixing with those
patches in the first place).
Well the thing is that the domain def copy function should copy the
domain definition. The domain definition as in the running program is a
superset of the domain XML. If we had the deep copy function there
wouldn't be a problem in this case since all members would be copied
properly. The round trip through the XML is the problem.
What we should do is:
1) call virDomainDefCopy() to create live definition
Whether live or config, that does not matter really. You need to take
the full transformation from XML to def if you are parsing a XML piece.
And part of this transformation now is the post parse callback.
Otherwise the code that does some modifications would need to be moved
to the parser itself which is ridiculous. (Yes we still have a lot of
logic in the parser.)
2) call qemuPrepareDef() (or whatever the name is going to be) to fix
up
passed definition os vCPU hotplug (or just any other functionality) works.
That won't help in this case. The missing piece causing the regression
was in the global post parse callback.
Since you did not describe your actual motivation to not call the post
parse callbacks in the commit messages it was not clear to me what you
need. Now from what I understand is that in some cases you don't have
qemu caps since the migration destination XML may have a path to a
different emulator not present at the source.
In this case we should rather probably skip all the caps dependent code
there.
Peter
As a side note, we should also probably exchange the def and newDef
pointers when the definition is copied, so that such bugs get detected
earliers.