All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [PULL 4/9] qcow2: use external virtual timers
Date: Tue, 30 Mar 2021 14:39:52 +0200	[thread overview]
Message-ID: <20210330123957.826170-5-mreitz@redhat.com> (raw)
In-Reply-To: <20210330123957.826170-1-mreitz@redhat.com>

From: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>

Regular virtual timers are used to emulate timings
related to vCPU and peripheral states. QCOW2 uses timers
to clean the cache. These timers should have external
flag. In the opposite case they affect the execution
and it can't be recorded and replayed.
This patch adds external flag to the timer for qcow2
cache clean.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <161700516327.1141158.8366564693714562536.stgit@pasha-ThinkPad-X280>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/qcow2.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index 0db1227ac9..2fb43c6f7e 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -840,9 +840,10 @@ static void cache_clean_timer_init(BlockDriverState *bs, AioContext *context)
 {
     BDRVQcow2State *s = bs->opaque;
     if (s->cache_clean_interval > 0) {
-        s->cache_clean_timer = aio_timer_new(context, QEMU_CLOCK_VIRTUAL,
-                                             SCALE_MS, cache_clean_timer_cb,
-                                             bs);
+        s->cache_clean_timer =
+            aio_timer_new_with_attrs(context, QEMU_CLOCK_VIRTUAL,
+                                     SCALE_MS, QEMU_TIMER_ATTR_EXTERNAL,
+                                     cache_clean_timer_cb, bs);
         timer_mod(s->cache_clean_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) +
                   (int64_t) s->cache_clean_interval * 1000);
     }
-- 
2.29.2



  parent reply	other threads:[~2021-03-30 12:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 12:39 [PULL 0/9] Block patches for 6.0-rc1 Max Reitz
2021-03-30 12:39 ` [PULL 1/9] iotests: Fix typo in iotest 051 Max Reitz
2021-03-30 12:39 ` [PULL 2/9] iotests: fix 051.out expected output after error text touchups Max Reitz
2021-03-30 12:39 ` [PULL 3/9] iotests/116: Fix reference output Max Reitz
2021-03-30 12:39 ` Max Reitz [this message]
2021-03-30 12:39 ` [PULL 5/9] iotests/046: Filter request length Max Reitz
2021-03-30 12:39 ` [PULL 6/9] block/mirror: Fix mirror_top's permissions Max Reitz
2021-03-30 12:39 ` [PULL 7/9] qsd: Document FUSE exports Max Reitz
2021-03-30 12:39 ` [PULL 8/9] qcow2: Force preallocation with data-file-raw Max Reitz
2021-03-30 12:39 ` [PULL 9/9] iotests/244: Test preallocation for data-file-raw Max Reitz
2021-03-30 15:34 ` [PULL 0/9] Block patches for 6.0-rc1 Peter Maydell

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=20210330123957.826170-5-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --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.