----- Mail original ----- > De: "Paolo Bonzini" <pbonz...@redhat.com> > À: "Sebastian Tanase" <sebastian.tan...@openwide.fr>, qemu-devel@nongnu.org > Cc: aligu...@amazon.com, afaer...@suse.de, r...@twiddle.net, "peter maydell" > <peter.mayd...@linaro.org>, > mich...@walle.cc, a...@alex.org.uk, stefa...@redhat.com, > lcapitul...@redhat.com, crobi...@redhat.com, > arm...@redhat.com, wenchaoq...@gmail.com, quint...@redhat.com, > kw...@redhat.com, m...@tls.msk.ru, m...@redhat.com > Envoyé: Lundi 30 Juin 2014 18:33:38 > Objet: Re: [RFC PATCH V3 2/6] icount: Add align option to icount > > Il 30/06/2014 15:59, Sebastian Tanase ha scritto: > > The align option is used for activating the align algorithm > > in order to synchronise the host clock and the guest clock. > > > > Signed-off-by: Sebastian Tanase <sebastian.tan...@openwide.fr> > > Tested-by: Camille Bégué <camille.be...@openwide.fr> > > --- > > cpus.c | 13 +++++++++++++ > > include/qemu-common.h | 1 + > > qemu-options.hx | 15 +++++++++++++-- > > vl.c | 4 ++++ > > 4 files changed, 31 insertions(+), 2 deletions(-) > > > > diff --git a/cpus.c b/cpus.c > > index dcca96a..3fa8ce7 100644 > > --- a/cpus.c > > +++ b/cpus.c > > @@ -448,13 +448,24 @@ void configure_icount(QemuOpts *opts, Error > > **errp) > > vmstate_register(NULL, 0, &vmstate_timers, &timers_state); > > option = qemu_opt_get(opts, "shift"); > > if (!option) { > > + if (qemu_opt_get(opts, "align") != NULL) { > > + error_setg(errp, "Please specify shift option when > > using align"); > > + } > > return; > > } > > + icount_align_option = qemu_opt_get_bool(opts, "align", false); > > /* When using -icount shift, the shift option will be > > misinterpreted as a boolean */ > > if (strcmp(option, "on") == 0 || strcmp(option, "off") == 0) { > > error_setg(errp, "The shift option must be a number or > > auto"); > > } > > + /* When using icount [shift=]N|auto -icount align, shift > > becomes > > + align therefore we have to specify align=on|off. > > + We do however inform the user whenever the case. */ > > + if (strcmp(option, "align") == 0) { > > + error_setg(errp, "Please specify align=on or off so as not > > " > > + "to create confusion between the shift and align > > options"); > > + } > > Can you prepare a follow-up (on top of this patch) that instead adds > proper error handling to the strtol call below? Then these strcmps > can > probably go away. > > Paolo > Sure, no problem.
Thanks for the advice. Sebastian