On Mon, Sep 28, 2026 at 7:48 PM Markus Armbruster <[email protected]> wrote: > > Yonggang Luo <[email protected]> writes: > > > Add a none target for when no TargetInfo is selected. It is last > > so existing SYS_EMU_TARGET_* values stay put, and it is not a > > qemu-system- executable name. target_is_none() and target_none() > > report that state. > > Why does it matter that existing SYS_EMU_TARGET_* stay put?
We need a state that not a real CPU target is selected( I called it none), then we can use it to list all targets. for example, do query-targets. query-machines(all machines for all targets). Any better ways to handle it would be appreciated, I am not choosing to set it to NULL because that would cause too much NULL-check error, as the pre-existing code presume there is always a CPU target present. > > > Signed-off-by: Yonggang Luo <[email protected]> > > [...] > > > diff --git a/qapi/machine.json b/qapi/machine.json > > index b1be5608b61..6aaa2af709a 100644 > > --- a/qapi/machine.json > > +++ b/qapi/machine.json > > @@ -22,6 +22,10 @@ > > # The individual target constants are not documented here, for the > > # time being. > > # > > +# @none: no TargetInfo selected. > > Doc comments are reference documentation for users. TargetInfo is an > internal thing. Please rephrase in terms that make sense to users. > > > Not a qemu-system- executable name. > > This barely makes sense. I recommend to leave documenting the > qemu-system-T naming convention to the note below. > > > +# Last enumerator so existing SYS_EMU_TARGET_* values stay put. > > Of no concern to users, therefore inappropriate for user documentation. > > > +# (since 11.2) > > +# > > # @rx: since 5.0 > > # > > # @avr: since 5.1 > > @@ -30,9 +34,10 @@ > > # > > # @hexagon: since 11.0 > > # > > -# .. note:: The resulting QMP strings can be appended to the > > -# "qemu-system-" prefix to produce the corresponding QEMU > > -# executable name. This is true even for "qemu-system-x86_64". > > +# .. note:: Except for ``none``, the resulting QMP strings can be > > +# appended to the "qemu-system-" prefix to produce the > > +# corresponding QEMU executable name. This is true even for > > +# "qemu-system-x86_64". > > Not this patch's concern: I don't understand what's so special about > x86_64. > > > # > > # Since: 3.0 > > ## > > @@ -42,7 +47,7 @@ > > 'mips64el', 'mipsel', 'or1k', 'ppc', > > 'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4', > > 'sh4eb', 'sparc', 'sparc64', 'tricore', > > - 'x86_64', 'xtensa', 'xtensaeb' ] } > > + 'x86_64', 'xtensa', 'xtensaeb', 'none' ] } > > > > ## > > # @S390CpuState: > > [...] > -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo
