From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T62M1-0007Ku-4i for qemu-devel@nongnu.org; Mon, 27 Aug 2012 12:40:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T62Lx-0004Yg-F2 for qemu-devel@nongnu.org; Mon, 27 Aug 2012 12:39:55 -0400 Message-ID: <503BA2D2.8020602@suse.de> Date: Mon, 27 Aug 2012 18:39:46 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <000001cd844e$7747c480$65d74d80$@Dovgaluk@ispras.ru> In-Reply-To: <000001cd844e$7747c480$65d74d80$@Dovgaluk@ispras.ru> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] Save/load PC speaker internal state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgaluk , Peter Maydell Cc: qemu-stable@nongnu.org, 'qemu-devel' , Juan Quintela Am 27.08.2012 14:21, schrieb Pavel Dovgaluk: > Save PC speaker state to remove differences between system > states after saving the snapshot and after loading it again. > This patch is needed for deterministic replay of the execution. >=20 > Signed-off-by: Pavel Dovgalyuk > --- > hw/pcspk.c | 18 ++++++++++++++++++ > 1 files changed, 18 insertions(+), 0 deletions(-) >=20 > diff --git a/hw/pcspk.c b/hw/pcspk.c > index e430324..3fb3dd1 100644 > --- a/hw/pcspk.c > +++ b/hw/pcspk.c > @@ -159,10 +159,28 @@ static const MemoryRegionOps pcspk_io_ops =3D { > }, > }; > =20 > +static const VMStateDescription vmstate_spk =3D { > + .name =3D "pcspk", > + .version_id =3D 1, > + .minimum_version_id =3D 1, > + .minimum_version_id_old =3D 1, > + .fields =3D (VMStateField[]) { > + VMSTATE_UINT8_ARRAY(sample_buf, PCSpkState, PCSPK_BUF_LEN), > + VMSTATE_UINT32(pit_count, PCSpkState), > + VMSTATE_UINT32(samples, PCSpkState), > + VMSTATE_UINT32(play_pos, PCSpkState), > + VMSTATE_INT32(data_on, PCSpkState), > + VMSTATE_INT32(dummy_refresh_clock, PCSpkState), > + VMSTATE_END_OF_LIST() > + } > +}; > + > static int pcspk_initfn(ISADevice *dev) > { > PCSpkState *s =3D DO_UPCAST(PCSpkState, dev, dev); > =20 > + vmstate_register(NULL, 0, &vmstate_spk, s); > + > memory_region_init_io(&s->ioport, &pcspk_io_ops, s, "elcr", 1); > isa_register_ioport(dev, &s->ioport, s->iobase); >=20 What about pc-1.0 etc. machines? Does this need to be backported to stable branches first for migration from v1.2 to work? Or is such incoming excess data silently ignored? Or any compat magic required on to= p? Andreas --=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