qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sebastian Tanase <sebastian.tanase@openwide.fr>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, aliguori@amazon.com,
	wenchaoqemu@gmail.com, quintela@redhat.com, mjt@tls.msk.ru,
	mst@redhat.com, stefanha@redhat.com, armbru@redhat.com,
	lcapitulino@redhat.com, michael@walle.cc, alex@alex.org.uk,
	crobinso@redhat.com, afaerber@suse.de, rth@twiddle.net
Subject: Re: [Qemu-devel] [RFC PATCH V3 2/6] icount: Add align option to icount
Date: Mon, 30 Jun 2014 18:33:38 +0200	[thread overview]
Message-ID: <53B19162.6060709@redhat.com> (raw)
In-Reply-To: <1404136749-523-3-git-send-email-sebastian.tanase@openwide.fr>

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.tanase@openwide.fr>
> Tested-by: Camille Bégué <camille.begue@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

  reply	other threads:[~2014-06-30 16:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 13:59 [Qemu-devel] [RFC PATCH V3 0/6] icount: Implement delay algorithm between guest and host clocks Sebastian Tanase
2014-06-30 13:59 ` [Qemu-devel] [RFC PATCH V3 1/6] icount: Add QemuOpts for icount Sebastian Tanase
2014-07-01  8:59   ` Frederic Konrad
2014-06-30 13:59 ` [Qemu-devel] [RFC PATCH V3 2/6] icount: Add align option to icount Sebastian Tanase
2014-06-30 16:33   ` Paolo Bonzini [this message]
2014-07-01 15:26     ` Sebastian Tanase
2014-06-30 13:59 ` [Qemu-devel] [RFC PATCH V3 3/6] icount: Make icount_time_shift available everywhere Sebastian Tanase
2014-06-30 13:59 ` [Qemu-devel] [RFC PATCH V3 4/6] cpu_exec: Add sleeping algorithm Sebastian Tanase
2014-06-30 16:46   ` Paolo Bonzini
2014-07-01 15:44     ` Sebastian Tanase
2014-06-30 17:08   ` Paolo Bonzini
2014-06-30 13:59 ` [Qemu-devel] [RFC PATCH V3 5/6] cpu_exec: Print to console if the guest is late Sebastian Tanase
2014-06-30 17:11   ` Paolo Bonzini
2014-07-01 15:52     ` Sebastian Tanase
2014-06-30 13:59 ` [Qemu-devel] [RFC PATCH V3 6/6] monitor: Add drift info to 'info jit' Sebastian Tanase
2014-07-01  7:47   ` Frederic Konrad
2014-07-01 15:55     ` Sebastian Tanase
2014-06-30 17:16 ` [Qemu-devel] [RFC PATCH V3 0/6] icount: Implement delay algorithm between guest and host clocks Paolo Bonzini
2014-07-01 15:54   ` Sebastian Tanase
2014-07-04 15:36   ` Sebastian Tanase
2014-07-04 15:49     ` Paolo Bonzini
2014-07-04 16:05     ` Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53B19162.6060709@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=alex@alex.org.uk \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=crobinso@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=michael@walle.cc \
    --cc=mjt@tls.msk.ru \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    --cc=sebastian.tanase@openwide.fr \
    --cc=stefanha@redhat.com \
    --cc=wenchaoqemu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).