From: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, dovgaluk@ispras.ru, kraxel@redhat.com,
marcandre.lureau@gmail.com
Subject: [Qemu-devel] [PATCH v2] audio: make audio poll timer deterministic
Date: Thu, 02 Feb 2017 09:09:24 +0300 [thread overview]
Message-ID: <20170202060924.7440.78149.stgit@PASHA-ISP> (raw)
This patch changes resetting strategy of the audio polling timer.
It does not change expiration time if the timer is already set.
This patch is needed to make this timer deterministic and to use execution
record/replay for audio devices.
audio_reset_timer is used in the function audio_vm_change_state_handler.
Therefore every time VM is stopped or restarted the timer will be reset
to new timeout. Virtual clock does not proceed while VM is stopped.
Therefore there is no need in resetting the timeout when VM restarts.
v2: updated commit message
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
audio/audio.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index c845a44..834d433 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1112,8 +1112,10 @@ static int audio_is_timer_needed (void)
static void audio_reset_timer (AudioState *s)
{
if (audio_is_timer_needed ()) {
- timer_mod (s->ts,
- qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
+ if (!timer_pending(s->ts)) {
+ timer_mod(s->ts,
+ qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
+ }
}
else {
timer_del (s->ts);
reply other threads:[~2017-02-02 6:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20170202060924.7440.78149.stgit@PASHA-ISP \
--to=pavel.dovgaluk@ispras.ru \
--cc=dovgaluk@ispras.ru \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@gmail.com \
--cc=pbonzini@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.