qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Pavel Dovgaluk <Pavel.Dovgaluk@ispras.ru>
Cc: 'qemu-devel' <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Save/load PC speaker internal state (v2)
Date: Tue, 28 Aug 2012 09:12:33 +0200	[thread overview]
Message-ID: <503C6F61.90900@web.de> (raw)
In-Reply-To: <48961.0236989849$1346137146@news.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]

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.
> 
> v2: Do not save the data that cannot affect the guest code behavior.
> 
> Signed-off-by: Pavel Dovgalyuk<pavel.dovgaluk@gmail.com>
> ---
>  hw/pcspk.c |   17 +++++++++++++++--
>  1 files changed, 15 insertions(+), 2 deletions(-)
> 
> 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;
>  
>  static const char *s_spk = "pcspk";
> @@ -159,6 +159,18 @@ static const MemoryRegionOps pcspk_io_ops = {
>      },
>  };
>  
> +static const VMStateDescription vmstate_spk = {
> +    .name = "pcspk",
> +    .version_id = 1,
> +    .minimum_version_id = 1,
> +    .minimum_version_id_old = 1,
> +    .fields      = (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 it.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

       reply	other threads:[~2012-08-28  7:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <48961.0236989849$1346137146@news.gmane.org>
2012-08-28  7:12 ` Jan Kiszka [this message]
2012-08-29  7:05   ` [Qemu-devel] [PATCH] Save/load PC speaker internal state (v2) Pavel Dovgaluk
2012-08-29  8:57     ` Jan Kiszka
2012-08-28  6:58 Pavel Dovgaluk

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=503C6F61.90900@web.de \
    --to=jan.kiszka@web.de \
    --cc=Pavel.Dovgaluk@ispras.ru \
    --cc=qemu-devel@nongnu.org \
    /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).