From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1zwp-0005j9-4F for qemu-devel@nongnu.org; Tue, 01 Jul 2014 11:26:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1zwk-0007fa-NS for qemu-devel@nongnu.org; Tue, 01 Jul 2014 11:26:19 -0400 Received: from zimbra3.corp.accelance.fr ([2001:4080:204::2:8]:38986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1zwk-0007f3-Cd for qemu-devel@nongnu.org; Tue, 01 Jul 2014 11:26:14 -0400 Date: Tue, 1 Jul 2014 17:26:08 +0200 (CEST) From: Sebastian Tanase Message-ID: <169767045.19194652.1404228368485.JavaMail.root@openwide.fr> In-Reply-To: <53B19162.6060709@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH V3 2/6] icount: Add align option to icount List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, peter maydell , aliguori@amazon.com, wenchaoqemu@gmail.com, quintela@redhat.com, qemu-devel@nongnu.org, 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 ----- Mail original ----- > De: "Paolo Bonzini" > =C3=80: "Sebastian Tanase" , qemu-devel@non= gnu.org > Cc: aliguori@amazon.com, afaerber@suse.de, rth@twiddle.net, "peter maydel= l" , > michael@walle.cc, alex@alex.org.uk, stefanha@redhat.com, lcapitulino@redh= at.com, crobinso@redhat.com, > armbru@redhat.com, wenchaoqemu@gmail.com, quintela@redhat.com, kwolf@redh= at.com, mjt@tls.msk.ru, mst@redhat.com > Envoy=C3=A9: Lundi 30 Juin 2014 18:33:38 > Objet: Re: [RFC PATCH V3 2/6] icount: Add align option to icount >=20 > 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 > > Tested-by: Camille B=C3=A9gu=C3=A9 > > --- > > 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 =3D qemu_opt_get(opts, "shift"); > > if (!option) { > > + if (qemu_opt_get(opts, "align") !=3D NULL) { > > + error_setg(errp, "Please specify shift option when > > using align"); > > + } > > return; > > } > > + icount_align_option =3D qemu_opt_get_bool(opts, "align", false); > > /* When using -icount shift, the shift option will be > > misinterpreted as a boolean */ > > if (strcmp(option, "on") =3D=3D 0 || strcmp(option, "off") =3D=3D = 0) { > > error_setg(errp, "The shift option must be a number or > > auto"); > > } > > + /* When using icount [shift=3D]N|auto -icount align, shift > > becomes > > + align therefore we have to specify align=3Don|off. > > + We do however inform the user whenever the case. */ > > + if (strcmp(option, "align") =3D=3D 0) { > > + error_setg(errp, "Please specify align=3Don or off so as not > > " > > + "to create confusion between the shift and align > > options"); > > + } >=20 > 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. >=20 > Paolo >=20 Sure, no problem. Thanks for the advice. Sebastian