From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6Fye-00085D-GL for qemu-devel@nongnu.org; Tue, 28 Aug 2012 03:12:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6Fya-00043Z-8K for qemu-devel@nongnu.org; Tue, 28 Aug 2012 03:12:44 -0400 Received: from mout.web.de ([212.227.17.11]:59120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6FyZ-00043Q-TG for qemu-devel@nongnu.org; Tue, 28 Aug 2012 03:12:40 -0400 Message-ID: <503C6F61.90900@web.de> Date: Tue, 28 Aug 2012 09:12:33 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <48961.0236989849$1346137146@news.gmane.org> In-Reply-To: <48961.0236989849$1346137146@news.gmane.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig275EA2C21E26C968ED1571C1" Subject: Re: [Qemu-devel] [PATCH] Save/load PC speaker internal state (v2) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgaluk Cc: 'qemu-devel' This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig275EA2C21E26C968ED1571C1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-08-28 08:58, Pavel Dovgaluk wrote: > 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 > v2: Do not save the data that cannot affect the guest code behavior. >=20 > Signed-off-by: Pavel Dovgalyuk > --- > hw/pcspk.c | 17 +++++++++++++++-- > 1 files changed, 15 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/pcspk.c b/hw/pcspk.c > index e430324..07a3de0 100644 > --- a/hw/pcspk.c > +++ b/hw/pcspk.c > @@ -46,8 +46,8 @@ typedef struct { > unsigned int pit_count; > unsigned int samples; > unsigned int play_pos; > - int data_on; > - int dummy_refresh_clock; > + uint8_t data_on; > + uint8_t dummy_refresh_clock; > } PCSpkState; > =20 > static const char *s_spk =3D "pcspk"; > @@ -159,6 +159,18 @@ 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(data_on, PCSpkState), > + VMSTATE_UINT8(dummy_refresh_clock, PCSpkState), Just to understand the plan: The intention is to leave the audio disabled after resume, just saving those bits that can be read back via IO port, correct? Then please document this in a comment, otherwise fix i= t. Jan --------------enig275EA2C21E26C968ED1571C1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlA8b2QACgkQitSsb3rl5xR4pwCgwlVoqnRdngzhKE39wQNjiF9e s8UAoKmXigs9YK8apuCzbBGuAuNZ8K4W =aanl -----END PGP SIGNATURE----- --------------enig275EA2C21E26C968ED1571C1--