From patchwork Thu Oct 18 07:12:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Artem Pisarenko X-Patchwork-Id: 10646793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1FC1117D4 for ; Thu, 18 Oct 2018 07:14:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03F4C204FB for ; Thu, 18 Oct 2018 07:14:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAB532522B; Thu, 18 Oct 2018 07:14:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C67E8204FB for ; Thu, 18 Oct 2018 07:14:47 +0000 (UTC) Received: from localhost ([::1]:40601 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gD2W6-0005Ah-BY for patchwork-qemu-devel@patchwork.kernel.org; Thu, 18 Oct 2018 03:14:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gD2Up-0004No-Rz for qemu-devel@nongnu.org; Thu, 18 Oct 2018 03:13:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gD2Uk-00083e-UI for qemu-devel@nongnu.org; Thu, 18 Oct 2018 03:13:27 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:44888) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gD2Ui-0007w5-Vt for qemu-devel@nongnu.org; Thu, 18 Oct 2018 03:13:21 -0400 Received: by mail-lj1-x242.google.com with SMTP id v6-v6so26678594ljc.11 for ; Thu, 18 Oct 2018 00:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3v2Pn1q29hZtC5SdDEY1KCESLpfWgwv2prNiMOWjoyA=; b=QzGjxqZigdWXFF9iTS3AvFRU/styd6GVBk7bTIa3GnugtPdLLBp62g10oAy3MULnDd 0LcZPY5lok9Pvy63dPT+APdVXnd3FQ65j4OWZWcAOLrK5PniNTdnN9ZpjQQBNefrvZ2n lvzjV3XJxOCf2iY9jvhEYCF7BO1w2HQVeer5ltEphsxzcD2MHbkSCsK8C67sLjOp3nzc vVFvHuuPvhwq8VYcLAd6J2i7p7J5WpIZYncHovhCkAzb8wwgeYN+JuEeq0KzljD3e09N l+qQnnE0jfS1EPSYEXHYxgSoKq/tesqsjavUS8zv6zw1FXvnArAyhqQYsWICA+5UU3RJ rvjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3v2Pn1q29hZtC5SdDEY1KCESLpfWgwv2prNiMOWjoyA=; b=rEUNrpIKHFzVRQ7j6/ifU62j7MSzzQCW4VEMnrecU21q8e5pqQEd56cnD8sMOiZ7fM YCfypv36iMMXWwXAsYtgyokRQgqnfJncGXlIQMq5FDhtQVGTM4RfcCda94wpNwZGCkhP FxLokvjtqSOojpjazsmKPcg/Wus8+Vd276ILX51mtHHg9H1USRR3uiaO+PgUA3cfSjkn Kz4VUOOlwUYmmdgnKAeQP7E2NUnGhPoYIU78HV6ykD5jIsD5v4VQZiCZZq4hE5S67hn0 UXzoqRhlIMiwSFRAhibeKYmVg7fbAuYpVIhItftbFnu2LKvzaDi6X9kEDoHyDmGD9ng0 +5KQ== X-Gm-Message-State: ABuFfogqwnZ+mogCVUhr+SbPBVzpdln8UadYeRT/LgsJunmJADnHE47f 2VeC31Dfw76wFXl0YbLL1JmR9acGql8= X-Google-Smtp-Source: ACcGV63EKBG/xt9FJJ46PunO1JJ62j7apD1UHUspj0tVvcaYeICP3nPg3kAgR4y5ljakcJIqwjvc/g== X-Received: by 2002:a2e:9cd3:: with SMTP id g19-v6mr20145590ljj.161.1539846797663; Thu, 18 Oct 2018 00:13:17 -0700 (PDT) Received: from localhost.localdomain ([77.221.221.49]) by smtp.gmail.com with ESMTPSA id r4-v6sm4445426ljg.12.2018.10.18.00.13.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Oct 2018 00:13:16 -0700 (PDT) From: Artem Pisarenko To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2018 13:12:51 +0600 Message-Id: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::242 Subject: [Qemu-devel] [PATCH v3 0/4] Fix and improve core RTC function and documentation 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: Artem Pisarenko Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Modifications are motivated by bug https://bugs.launchpad.net/qemu/+bug/1797033 I've encountered recently. Trying to fix it and analyzing its effect on all use cases (not covered in bug report) revealed much deeper problems. This is my first patch to QEMU and I'm not sure whether the way I addressed them is proper. They definitely require either modifications to current implementation (breaking compability), or adding clarifications to user documentation. I've tried to find compromise. Changes I propose are driven mostly by my interpretation of user documentation and comments in code, rather than by existing implementation. I've splitted patches in a way that at least some of them may be accepted. Following subsets are make sense on their own: - 1 - 1,2,3 I limited refactoring only to vl.c, although it leads to reworking of all hw/* rtc models which have unreasonable duplications of actions performed by vl.c. I'm sure such kind of rework will reveal more hidden bugs/features, but so far I've had enough (it's a long story how muсh effort and pain cost me to find that tricky bug above). I suppose just to draw attention of relevant hw/* maintainers. v3 changes: - commit messages rewritten/shortened/wrapped to match patch requirements - fixed minor typo v2 changes: - fixed compiler warning caused non-debug build fail Artem Pisarenko (4): vl: improve/fix documentation related to RTC function vl: refactor -rtc option references Fixes RTC bug with base datetime shifts in clock=vm vl,qapi: offset calculation in RTC_CHANGE event reverted qapi/misc.json | 3 +- qemu-options.hx | 14 +++++--- vl.c | 105 +++++++++++++++++++++++++++++++++++++------------------- 3 files changed, 80 insertions(+), 42 deletions(-)