All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Fedorov <serge.fdrv@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Alex Bligh" <alex@alex.org.uk>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Sergey Fedorov" <serge.fdrv@gmail.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH] qtest: fix qtest_clock_warp() for no deadline case
Date: Mon,  9 Jun 2014 20:42:51 +0400	[thread overview]
Message-ID: <1402332171-7159-1-git-send-email-serge.fdrv@gmail.com> (raw)

If there is no deadline across all timerlists attached to the clock
then qemu_clock_deadline_ns_all() returns -1. Cast it to unsinged so
MIN() do not treat it as minimum.

Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com>
---
 cpus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpus.c b/cpus.c
index dd7ac13..3ec15cb 100644
--- a/cpus.c
+++ b/cpus.c
@@ -346,8 +346,8 @@ void qtest_clock_warp(int64_t dest)
     int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
     assert(qtest_enabled());
     while (clock < dest) {
-        int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
-        int64_t warp = MIN(dest - clock, deadline);
+        uint64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
+        uint64_t warp = MIN(dest - clock, deadline);
         seqlock_write_lock(&timers_state.vm_clock_seqlock);
         qemu_icount_bias += warp;
         seqlock_write_unlock(&timers_state.vm_clock_seqlock);
-- 
1.9.1

             reply	other threads:[~2014-06-09 16:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 16:42 Sergey Fedorov [this message]
2014-06-09 17:36 ` [Qemu-devel] [PATCH] qtest: fix qtest_clock_warp() for no deadline case Alex Bligh
2014-06-10  9:08   ` Sergey Fedorov
  -- strict thread matches above, loose matches on Subject: below --
2014-06-10  9:10 Sergey Fedorov
2014-06-10 11:03 ` Paolo Bonzini

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=1402332171-7159-1-git-send-email-serge.fdrv@gmail.com \
    --to=serge.fdrv@gmail.com \
    --cc=afaerber@suse.de \
    --cc=alex@alex.org.uk \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    /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.