From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un4cv-0000kf-Bv for qemu-devel@nongnu.org; Thu, 13 Jun 2013 06:19:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Un4cu-000429-4H for qemu-devel@nongnu.org; Thu, 13 Jun 2013 06:19:33 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49351 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Un4ct-00041x-Uc for qemu-devel@nongnu.org; Thu, 13 Jun 2013 06:19:32 -0400 Message-ID: <51B99CB1.6020006@suse.de> Date: Thu, 13 Jun 2013 12:19:29 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1369239012-8180-1-git-send-email-akong@redhat.com> <1369239012-8180-2-git-send-email-akong@redhat.com> <87mwrcct1t.fsf@codemonkey.ws> <20130531123117.GA8400@t430s.nay.redhat.com> In-Reply-To: <20130531123117.GA8400@t430s.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 1/2] ps2: add support of auto-repeat List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: peter.maydell@linaro.org, Anthony Liguori , lilei@linux.vnet.ibm.com, qemu-devel@nongnu.org, kraxel@redhat.com, lersek@redhat.com Am 31.05.2013 14:31, schrieb Amos Kong: > diff --git a/hw/input/ps2.c b/hw/input/ps2.c > index cdb18e6..fdb9912 100644 > --- a/hw/input/ps2.c > +++ b/hw/input/ps2.c > @@ -615,7 +615,17 @@ static bool ps2_keyboard_repeatstate_needed(void > *opaque) > { > PS2KbdState *s =3D opaque; > =20 > - return s->repeat_period || s->repeat_delay; > + return s->repeat_period || s->repeat_delay || s->repeat_key || > s->repeat_timer; > +} > + > +static int ps2_kbd_repeatstate_load(QEMUFile *f, void *opaque, int > version_id) > +{ > + PS2KbdState *s =3D opaque; > + qemu_get_timer(f, s->repeat_timer); > + qemu_mod_timer(s->repeat_timer, qemu_get_clock_ns(vm_clock) + > + muldiv64(get_ticks_per_sec(), s->repeat_period, > 1000)); > + > + return 0; > } > =20 > static bool ps2_keyboard_ledstate_needed(void *opaque) > @@ -638,9 +648,12 @@ static const VMStateDescription > vmstate_ps2_keyboard_repeatstate =3D { > .version_id =3D 3, > .minimum_version_id =3D 2, > .minimum_version_id_old =3D 2, > + .load_state_old =3D ps2_kbd_repeatstate_load, > .fields =3D (VMStateField[]) { > VMSTATE_INT32(repeat_period, PS2KbdState), > VMSTATE_INT32(repeat_delay, PS2KbdState), > + VMSTATE_INT32(repeat_key, PS2KbdState), > + VMSTATE_TIMER(repeat_timer, PS2KbdState), You can't just add fields here, they'd need to be specific to a new version 4. Requested was to make it a subsection instead. Andreas > VMSTATE_END_OF_LIST() > } > }; >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg