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?
Hmm, you're right. In general, this is advertising the host CPU
(ideally
as seen by QEMU), which doesn't really work for ppc since host-model
was
misused for compatibility modes. I think we'll have to add a special
hack to produce <mode name='host-model' supported='yes'/> without
showing any CPU model. Ideally, we would somehow list all supported
compatibility modes, but this can be left for the future.
Sounds good.
> > - <mode name='custom'
supported='no'/>
> > + <mode name='custom' supported='yes'>
> > + <model usable='unknown'>POWER9</model>
> > + <model usable='unknown'>POWER8</model>
> > + <model usable='unknown'>POWER7</model>
> > + </mode>
>
> This is of course an improvement, but I'm not sure we want to keep
> exposing uppercase model names to users.
>
> I understand we need to keep accepting them for compatibility
> reasons, but since QEMU has moved to lowercase CPU model names
> wouldn't it make sense for libvirt to follow suit?
I don't think so. Introducing new aliases (i.e., lower case variants)
for the existing models would IMHO cause more troubles than having a
mixture of upper case and lower case names (once something like
power10
is introduced). Users or apps would have to use a crystal ball to
check
which CPU model name would be compatible with older libvirt.
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.
--
Andrea Bolognani / Red Hat / Virtualization