From nobody Thu Nov 6 01:10:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153829627714156.31583830475472; Sun, 30 Sep 2018 01:31:17 -0700 (PDT) Received: from localhost ([::1]:54302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6X8F-0001OW-Vl for importer@patchew.org; Sun, 30 Sep 2018 04:31:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6Wrh-0002br-5O for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6Wrg-0000wF-Cw for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:09 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:33493) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6Wrg-0000vm-4H for qemu-devel@nongnu.org; Sun, 30 Sep 2018 04:14:08 -0400 Received: by mail-wm1-x342.google.com with SMTP id y140-v6so334258wmd.0 for ; Sun, 30 Sep 2018 01:14:08 -0700 (PDT) Received: from 640k.lan (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.gmail.com with ESMTPSA id u76-v6sm11369194wmd.10.2018.09.30.01.14.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 01:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=HxlO4C1Kci0hRsp+HIykaR9GkIpW8hbvsclYn/vEFYk=; b=GMc7MQ0DgG1Mkn+If9/1JTPnUN/m31oeFM8JSq4MYxyWdrRolHh16vrUjpc7Rzw9Re yQMOu00lW7W3WErhJjEu7Nqv/fOyE0E/Vw9rxcTFW9xMVkgX/23M0bxeZHA1ItVn9NcN r0juchM+PZH+wnPJH15InbQcgJEaHamXjiS3ytZyXfdJWYgHpdMUL/AX1c5otSbZQ1/T mX5lhUwL4CTh4AfU7KyE1zkglTyIst5N2laY4uxT+HB3WmiPoLz3DYGCofPxO3Y/d5Ws Vn+wbIc7yj/tORQzEN5pPbNWCMmZ35GJpAw3Uj23H1ws8wKAUNvc3ybqHHgWsy0hRmkv wA7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=HxlO4C1Kci0hRsp+HIykaR9GkIpW8hbvsclYn/vEFYk=; b=jXjCSiTlx41XBBVode00lp6GNHtJgs/OgYaUCwOMbz+i9Gn8k9hHDsjDiJo+Tf65yA IEnOKj+UXiV10byAXAnZWvVf1Gh866Bu8gA28Ae1foQSAaVPfRGoIdO5fylrfvYG6fzb Y4Yv7RiggQx+tlFvs+q2Uz+noJpN36GlEZPqySHMZw/SHIK+SV7aznbAGi3hTpU/Liv4 ilINtcb7mKMU6yRLssTbL1+dnFYlT3MnyK4WEx9P41V7epj8C4ewDddatJBvuAOqRtSU ONMvun8q6HZgptx6muFQWL9/9E66GwiMktp8VyIWjjPu7htHqDgQakQrgaU8m61OIW/G fFQw== X-Gm-Message-State: ABuFfohhifJXpT+EzWkRn3gIiJ+NmvoOKbTe72bypxZo1/wfVSusb3O5 mR2VYoWPDiSZCWTS7tOriwDnrpnw X-Google-Smtp-Source: ACcGV62hOljK0mUXXebymTwecpgsHPcCP/sIYM72Y9rQRvO76Jvxbwa2cC2TQ4GvD2we73nlgaM52A== X-Received: by 2002:a1c:a794:: with SMTP id q142-v6mr2298341wme.77.1538295246850; Sun, 30 Sep 2018 01:14:06 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 30 Sep 2018 10:12:42 +0200 Message-Id: <1538295197-23704-45-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> References: <1538295197-23704-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 Subject: [Qemu-devel] [PULL 44/79] ui: fix virtual timers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pavel Dovgalyuk Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pavel Dovgalyuk UI uses timers based on virtual clock for managing key queue. This is incorrect because this service is not related to the guest state, and its events should not be recorded and replayed. But these timers should stop when the guest is not executing. This patch changes using virtual clock to the new virtual_ext clock, which runs as virtual clock, but its timers are not saved to the log. Signed-off-by: Pavel Dovgalyuk Message-Id: <20180912082013.3228.33664.stgit@pasha-VirtualBox> Signed-off-by: Paolo Bonzini --- ui/input.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/input.c b/ui/input.c index 51b1019..dd7f6d7 100644 --- a/ui/input.c +++ b/ui/input.c @@ -271,7 +271,7 @@ static void qemu_input_queue_process(void *opaque) item =3D QTAILQ_FIRST(queue); switch (item->type) { case QEMU_INPUT_QUEUE_DELAY: - timer_mod(item->timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + timer_mod(item->timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL_EX= T) + item->delay_ms); return; case QEMU_INPUT_QUEUE_EVENT: @@ -301,7 +301,7 @@ static void qemu_input_queue_delay(struct QemuInputEven= tQueueHead *queue, queue_count++; =20 if (start_timer) { - timer_mod(item->timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + timer_mod(item->timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL_EXT) + item->delay_ms); } } @@ -448,8 +448,8 @@ void qemu_input_event_send_key_delay(uint32_t delay_ms) } =20 if (!kbd_timer) { - kbd_timer =3D timer_new_ms(QEMU_CLOCK_VIRTUAL, qemu_input_queue_pr= ocess, - &kbd_queue); + kbd_timer =3D timer_new_ms(QEMU_CLOCK_VIRTUAL_EXT, + qemu_input_queue_process, &kbd_queue); } if (queue_count < queue_limit) { qemu_input_queue_delay(&kbd_queue, kbd_timer, --=20 1.8.3.1