* [Qemu-devel] Querying possible -cpu variants
@ 2019-01-25 9:58 Pavel Dovgalyuk
2019-01-25 10:04 ` Peter Maydell
2019-01-25 10:10 ` Daniel P. Berrangé
0 siblings, 2 replies; 5+ messages in thread
From: Pavel Dovgalyuk @ 2019-01-25 9:58 UTC (permalink / raw)
To: qemu-devel
Cc: armbru, mdroth, eblake,
'Фурсова Наталия'
Hello.
We are making GUI for QEMU (which also should allow convenient record/replay command line
generation): https://github.com/ispras/qemu-gui
To fill the combo box in CPU selection form we run QEMU with "-cpu help" command and parse its
output.
The format of this list depends on target. Therefore our parsing code does not look good (and also
may corrupt someday).
Is there a better way of requesting this information?
Or we should do one of the following:
1. Patch all targets and make the uniform "-cpu help" output format
2. Add QMP command for requesting this list.
Pavel Dovgalyuk
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Querying possible -cpu variants
2019-01-25 9:58 [Qemu-devel] Querying possible -cpu variants Pavel Dovgalyuk
@ 2019-01-25 10:04 ` Peter Maydell
2019-01-25 10:10 ` Daniel P. Berrangé
1 sibling, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2019-01-25 10:04 UTC (permalink / raw)
To: Pavel Dovgalyuk
Cc: QEMU Developers, Markus Armbruster,
Фурсова Наталия,
Michael Roth
On Fri, 25 Jan 2019 at 09:59, Pavel Dovgalyuk <dovgaluk@ispras.ru> wrote:
> To fill the combo box in CPU selection form we run QEMU with "-cpu help" command and parse its
> output.
>
> The format of this list depends on target. Therefore our parsing code does not look good (and also
> may corrupt someday).
>
> Is there a better way of requesting this information?
Yes, and you list it below...
> Or we should do one of the following:
>
> 1. Patch all targets and make the uniform "-cpu help" output format
>
> 2. Add QMP command for requesting this list.
...you should use QMP. The whole point of that protocol is to
be a guaranteed-not-to-break-or-change-format machine readable
way to query properties of QEMU. Don't try to hand-parse
the human-readable help output, please.
thanks
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Querying possible -cpu variants
2019-01-25 9:58 [Qemu-devel] Querying possible -cpu variants Pavel Dovgalyuk
2019-01-25 10:04 ` Peter Maydell
@ 2019-01-25 10:10 ` Daniel P. Berrangé
2019-01-25 10:38 ` Pavel Dovgalyuk
2019-01-25 13:31 ` Eric Blake
1 sibling, 2 replies; 5+ messages in thread
From: Daniel P. Berrangé @ 2019-01-25 10:10 UTC (permalink / raw)
To: Pavel Dovgalyuk
Cc: qemu-devel, armbru,
'Фурсова Наталия',
mdroth
On Fri, Jan 25, 2019 at 12:58:04PM +0300, Pavel Dovgalyuk wrote:
> Hello.
>
>
>
> We are making GUI for QEMU (which also should allow convenient record/replay command line
> generation): https://github.com/ispras/qemu-gui
>
>
>
> To fill the combo box in CPU selection form we run QEMU with "-cpu help" command and parse its
> output.
>
> The format of this list depends on target. Therefore our parsing code does not look good (and also
> may corrupt someday).
>
>
>
> Is there a better way of requesting this information?
>
>
>
> Or we should do one of the following:
>
> 1. Patch all targets and make the uniform "-cpu help" output format
Machine parsing of "help" output is not supported by the QEMU project.
This must all be done via the QMP interfaces.
> 2. Add QMP command for requesting this list.
This already exists as the 'query-cpu-definitions' command
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Querying possible -cpu variants
2019-01-25 10:10 ` Daniel P. Berrangé
@ 2019-01-25 10:38 ` Pavel Dovgalyuk
2019-01-25 13:31 ` Eric Blake
1 sibling, 0 replies; 5+ messages in thread
From: Pavel Dovgalyuk @ 2019-01-25 10:38 UTC (permalink / raw)
To: 'Daniel P. Berrangé'
Cc: qemu-devel, armbru,
'Фурсова Наталия',
mdroth
> From: Daniel P. Berrangé [mailto:berrange@redhat.com]
> On Fri, Jan 25, 2019 at 12:58:04PM +0300, Pavel Dovgalyuk wrote:
> >
> > We are making GUI for QEMU (which also should allow convenient record/replay command line
> > generation): https://github.com/ispras/qemu-gui
> >
> >
> >
> > To fill the combo box in CPU selection form we run QEMU with "-cpu help" command and parse
> its
> > output.
> >
> > The format of this list depends on target. Therefore our parsing code does not look good
> (and also
> > may corrupt someday).
> >
> > 2. Add QMP command for requesting this list.
>
> This already exists as the 'query-cpu-definitions' command
Thank you!
Pavel Dovgalyuk
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Querying possible -cpu variants
2019-01-25 10:10 ` Daniel P. Berrangé
2019-01-25 10:38 ` Pavel Dovgalyuk
@ 2019-01-25 13:31 ` Eric Blake
1 sibling, 0 replies; 5+ messages in thread
From: Eric Blake @ 2019-01-25 13:31 UTC (permalink / raw)
To: Daniel P. Berrangé, Pavel Dovgalyuk
Cc: mdroth, qemu-devel,
'Фурсова Наталия',
armbru
[-- Attachment #1: Type: text/plain, Size: 725 bytes --]
On 1/25/19 4:10 AM, Daniel P. Berrangé wrote:
>
>> 2. Add QMP command for requesting this list.
>
> This already exists as the 'query-cpu-definitions' command
What's more, you can use libvirt code as an example of how to parse QMP
commands to see what features are present. And if the existing QMP
commands don't answer a question you need answered, enhancing QMP is a
worthwhile patch (other projects, like libvirt, will probably also end
up using those enhancements). Among other things, we know that our
command-line parameters are not yet fully queryable by QMP.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-01-25 13:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-25 9:58 [Qemu-devel] Querying possible -cpu variants Pavel Dovgalyuk
2019-01-25 10:04 ` Peter Maydell
2019-01-25 10:10 ` Daniel P. Berrangé
2019-01-25 10:38 ` Pavel Dovgalyuk
2019-01-25 13:31 ` Eric Blake
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).