[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH V3 2/6] icount: Add align option to icount
From: |
Sebastian Tanase |
Subject: |
Re: [Qemu-devel] [RFC PATCH V3 2/6] icount: Add align option to icount |
Date: |
Tue, 1 Jul 2014 17:26:08 +0200 (CEST) |
----- Mail original -----
> De: "Paolo Bonzini" <address@hidden>
> À: "Sebastian Tanase" <address@hidden>, address@hidden
> Cc: address@hidden, address@hidden, address@hidden, "peter maydell"
> <address@hidden>,
> address@hidden, address@hidden, address@hidden, address@hidden,
> address@hidden,
> address@hidden, address@hidden, address@hidden, address@hidden,
> address@hidden, address@hidden
> 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 <address@hidden>
> > Tested-by: Camille Bégué <address@hidden>
> > ---
> > 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [RFC PATCH V3 2/6] icount: Add align option to icount,
Sebastian Tanase <=