[libvirt] [PATCH 3/3] qemu: Adapt to changed ppc64 CPU model names
Jiri Denemark
jdenemar at redhat.com
Tue Oct 8 12:12:08 UTC 2019
Resurrecting an old forgotten series... It should fix PPC64 issues with
my recent "qemu: Store default CPU in domain XML" patches.
On Tue, May 22, 2018 at 16:51:44 +0200, Andrea Bolognani wrote:
> On Tue, 2018-05-22 at 15:46 +0200, Jiri Denemark wrote:
> > On Tue, May 22, 2018 at 11:02:17 +0200, Andrea Bolognani wrote:
> > > On Thu, 2018-05-17 at 17:33 +0200, Jiri Denemark wrote:
> > > [...]
> > > > --- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
> > > > +++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml
> > > > @@ -25,7 +25,11 @@
> > > > <mode name='host-model' supported='yes'>
> > > > <model fallback='allow'>POWER8</model>
> > > > </mode>
> > >
> > > This is quite suspicious - it looks like a proper CPU model, but
> > > it's really a compatibility mode, so it should be lowercase rather
> > > than uppercase. You certainly won't be able to use
> > >
> > > <cpu mode='host-model>
> > > <model>POWER8</model>
> > > </cpu>
> > >
> > > so why are we advertising the uppercase variant here? Am I missing
> > > something?
Actually the current way of reporting host-model in domain capabilities
for ppc64 is not incorrect given the way domain capabilities are
documented.
<mode name='host-model' supported='yes'>
<model fallback='allow'>POWER8</model>
</mode>
means <cpu mode='host-model'> CPU definition can be used in domain XML
and the CPU model corresponding to the host CPU is POWER8. This is not
supposed to be translated to
<cpu mode='host-model'>
<model>POWER8</model>
</cpu>
The interpretation of the domain capabilities snippet is either
<cpu mode='host-model'/>
or
<cpu mode='custom' match='exact'>
<model>POWER8</model>
</cpu>
And both will work, although the first one will not do what a user would
expect due to the way host-model is misused for ppc. There's just no way
of reporting this misuse in domain capabilities now. Perhaps we will
come up with a way to solve this in the future. But we can stick with
the current state now.
...
> You have a point. The current situation is a bit confusing, again
> because of the misuse of host-model, but it's probably better to
> stick with the confusing situation we've grown used to rather than
> change things around for cosmetic reasons.
>
> Plus, it's already strongly recommended to use
>
> <cpu mode='host-model'>
> <model>power8</model>
> </cpu>
>
> rather than
>
> <cpu mode='custom'>
> <model>POWER8</model>
> </cpu>
>
> because the resulting QEMU command line is more idiomatic, so
> applications and users sticking with the best practices wouldn't
> benefit from the change either way.
>
> I disagree on having a mixture of uppercase and lowercase model,
> though: that's just bad UI, and a clear violation of the principle
> of least surprise; if and when a 'power10' CPU model will be added
> to QEMU, we should introduce a suitable 'POWER10' alias along with
> the existing ones.
OK, we can revisit this discussion later when a new power CPU model is
introduced.
I'll rebase this series on current master and resend it.
Jirka
More information about the libvir-list
mailing list