Sebastian Tanase <sebastian.tan...@openwide.fr> writes: > Make icount parameter use QemuOpts style options in order > to easily add other suboptions. > > Signed-off-by: Sebastian Tanase <sebastian.tan...@openwide.fr> > Tested-by: Camille Bégué <camille.be...@openwide.fr> > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> [...] > diff --git a/qemu-options.hx b/qemu-options.hx > index 9e54686..143def4 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -3011,11 +3011,11 @@ re-inject them. > ETEXI > > DEF("icount", HAS_ARG, QEMU_OPTION_icount, \ > - "-icount [N|auto]\n" \ > + "-icount [shift=N|auto]\n" \ > " enable virtual instruction counter with 2^N clock ticks > per\n" \ > " instruction\n", QEMU_ARCH_ALL) > STEXI > -@item -icount [@var{N}|auto] > +@item -icount [shift=@var{N}|auto] > @findex -icount > Enable virtual instruction counter. The virtual cpu will execute one > instruction every 2^@var{N} ns of virtual time. If @code{auto} is specified
"shift=" is documented to be required, but... [...] > diff --git a/vl.c b/vl.c > index 41ddcd2..103027f 100644 > --- a/vl.c > +++ b/vl.c > @@ -537,6 +537,20 @@ static QemuOptsList qemu_mem_opts = { > }, > }; > > +static QemuOptsList qemu_icount_opts = { > + .name = "icount", > + .implied_opt_name = "shift", ... it's actually optional. Please fix the documentation. I guess [[shift=][N|auto] would be correct. > + .merge_lists = true, > + .head = QTAILQ_HEAD_INITIALIZER(qemu_icount_opts.head), > + .desc = { > + { > + .name = "shift", > + .type = QEMU_OPT_STRING, > + }, > + { /* end of list */ } > + }, > +}; > + > /** > * Get machine options > * [...]