On Fri, Sep 23, 2016 at 15:23:45 -0300, Eduardo Habkost wrote:
On Fri, Sep 23, 2016 at 02:05:59PM +0200, Jiri Denemark wrote:
> It's not critical for query-cpu-model-expansion, but do we have an
> interface we can use to check whether the new commands are supported by
> a QEMU binary? Trying and checking for
>
> {"error": {"class": "GenericError",
"desc": "this feature or command
> is not currently supported"}}
>
> is not really possible. At least we'd need a specific error class.
I believe query-qmp-schema and/or query-commands can be used for
that.
But you may still have the command returning the error above if
it is simply not implemented in that architecture. I will start a
qemu-devel thread to look for better solutions.
Yes, that's my concern.
...
> No, virsh cpu-models will just list CPU models supported by
libvirt (or
> an empty list if libvirt supports all models supported by QEMU). The CPU
> model data from QEMU can be found in domain capabilities XML.
That's interesting to know. I was often confused about the
interfaces that seem to be generic (not depend on a specific QEMU
binary) but seemed to depend on information from the QEMU binary
(virsh capabilities and virsh cpu-models). It looks like I was
looking at the wrong commands.
Those are just old interfaces. We may add newer versions for some of
them that would take more input parameters, but I don't feel a strong
need for it right now.
And the domain capabilities XML gained support for showing CPU related
stuff only recently (it will be included in the upcoming 2.3.0 release),
so it's not like you had a choice where to look at :-)
...
> Slightly related, I don't think we have a way to list CPU
features
> supported by QEMU over QMP, do we? "-cpu ?" will show them all, but I
> couldn't find a QMP command that would give me the same list.
device-list-properties should return all the properties you can
set. But I recommend that you don't make libvirt set any of the
properties in the list unless: 1) you know what it does; or 2) it
is returned by a query-cpu-model-expansion call.
The use case was for pre-checking whether all CPU features specified in
domain XML are supported by current QEMU binary. What parameters would
I need to use for device-list-properties? And would it work with
-machine none?
...
> Well, IIUC the new commands are not supported on any other
architecture
> right now, are they? Anyway, I don't think we need to switch everything
> at the same time. If we have a way to detect what commands are supported
> for a specific QEMU binary, we can implement the code in libvirt and use
> when we can or falling back to the current way.
Right now the commands are available only on s390x. I plan to
have them implemented in x86 before QEMU 2.8 is out.
That would be nice.
Jirka