From nobody Mon Feb 9 00:18:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576670877; cv=none; d=zohomail.com; s=zohoarc; b=QTh6gE6BeDW0+GiTyBL5dwpYkBYRhi7bcYcQIdMt5I2s2XWTP2zZxG30ByIvoXJT30qZxockoUctZ8ouMoh1417EXU7WbAC2hE6UJ/fMEfJXaOtxBaEt+NVkZQ7SuCs3V5vBQOGTBfrtcxFPgjZR3qSeVNJjUJq1yoc1vQucJsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576670877; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wpdalmmTK/FCoQs/NtWe2+gF7RTn+BqZ+IAbD5CsqGs=; b=VLgLlnXZWblDEGyjUE6RR8u4ixfmghN9A5k/qgwVbISvGjd2dLzUQjW84pvx0srN5BHovPxenA9GfkET4az/0esLYirOoyvnJB/YIDlobjJoEeaFf6bXq/JEJwFJUXlj0kK0cvyTZ0xX0gsS2l9yB9ELsOlL+rK84tAPlK98nhs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576670877868746.8835332337421; Wed, 18 Dec 2019 04:07:57 -0800 (PST) Received: from localhost ([::1]:53210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihY7Q-0003n0-8Y for importer@patchew.org; Wed, 18 Dec 2019 07:07:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46065) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihY2q-00066J-1c for qemu-devel@nongnu.org; Wed, 18 Dec 2019 07:03:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihY2o-0008PP-Na for qemu-devel@nongnu.org; Wed, 18 Dec 2019 07:03:11 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:51499) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihY2o-0008N6-C4 for qemu-devel@nongnu.org; Wed, 18 Dec 2019 07:03:10 -0500 Received: by mail-wm1-x343.google.com with SMTP id d73so1561039wmd.1 for ; Wed, 18 Dec 2019 04:03:09 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id n67sm2236838wmf.46.2019.12.18.04.03.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Dec 2019 04:03:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wpdalmmTK/FCoQs/NtWe2+gF7RTn+BqZ+IAbD5CsqGs=; b=AbjDn1YpIIy8iVVP2uw7d3EDL20dZoUDPuC9yuO1mcLnzerfQ/pFd5NyxOcxFbxe6K Kx0YotAPebeuSgwP9j1Ur3gWkVYzX5hhJnD3/aFAIjIVIDdxSz4ZcV0s4XsoGZHkHDB8 sC/ASss97Tp4GRs6B8KJX7q4AbJ7E7tTfaax3txUKkN46McCZAR3C7dUMXlPwzgyIL/p xJFkOpIu0pzOm22dbOhn+O4vTNg4BPOe+ORkDd4qOE33BICKZYN032udiBMN80/rwco/ fdcD/xochb3ruCqfuq71DYDQY5u7MC6f1R+GCY3Xbt9v4WzkJ/jzRUueVND/DiuGiun6 Vo3A== 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:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wpdalmmTK/FCoQs/NtWe2+gF7RTn+BqZ+IAbD5CsqGs=; b=dkz0KS5F7egkSg5fCj7z8VPqGrgBAn6a978t1v6sCnI1vbxhS9+3lm77ljPc12Ht7e L/1Rlc2a0S8Zlf/GOeKJzwO2NuYCUuwCtmiC4sLPndaB8PoubrRXNZPr7uw7GvrXfuQD XQFSVcmpDF0xNehx8qil6vTfuZZcSoRpVqHmUm4r/NDfSe+VsW8TBR0YgQkWo+HyD6h5 PFOc/KJpbhyiLfyn0X4P9bS7ktRSuYyASIgEikWywDeayVGStCsfSSUDWesIWNUtDUYf 5iUO9ezR60A2r4FlfaJuIpzAl33dAqEejOxagy4YkeHFPk/GcDu0Brh7lTQ4UPV3hlM/ lH0w== X-Gm-Message-State: APjAAAU3qDOc7YipPpKfJn+FXadU1ZaUlCdz4bveRGLTvL5YSJUujf1R WTgLiy8eB1htpcPj3kRFHEmFVpfe X-Google-Smtp-Source: APXvYqz1XrF5BAb3px2qnqxZgD89d5G1SgdY/95FQrg9vuKQz7la+FigzgKmJJZfSUWAIAPHJQzgIw== X-Received: by 2002:a7b:c317:: with SMTP id k23mr2884998wmj.75.1576670588532; Wed, 18 Dec 2019 04:03:08 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 13/87] vl: move icount configuration earlier Date: Wed, 18 Dec 2019 13:01:39 +0100 Message-Id: <1576670573-48048-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576670573-48048-1-git-send-email-pbonzini@redhat.com> References: <1576670573-48048-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Once qemu_tcg_configure is turned into a QOM property setter, it will not be able to set a default value for mttcg_enabled. Setting the default will move to the TCG instance_init function, which currently runs before "-icoun= t" is processed. However, it is harmless to do configure_icount for all accelerators; we will just fail later if a non-TCG accelerator is selected. So do that. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Paolo Bonzini --- vl.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/vl.c b/vl.c index 9450830..6e58c1d 100644 --- a/vl.c +++ b/vl.c @@ -2700,6 +2700,12 @@ static void user_register_global_props(void) global_init_func, NULL, NULL); } =20 +static int do_configure_icount(void *opaque, QemuOpts *opts, Error **errp) +{ + configure_icount(opts, errp); + return 0; +} + int main(int argc, char **argv, char **envp) { int i; @@ -4010,6 +4016,8 @@ int main(int argc, char **argv, char **envp) * Note: uses machine properties such as kernel-irqchip, must run * after machine_set_property(). */ + qemu_opts_foreach(qemu_find_opts("icount"), + do_configure_icount, NULL, &error_fatal); configure_accelerator(current_machine, argv[0]); =20 /* @@ -4095,13 +4103,9 @@ int main(int argc, char **argv, char **envp) qemu_spice_init(); =20 cpu_ticks_init(); - if (icount_opts) { - if (!tcg_enabled()) { - error_report("-icount is not allowed with hardware virtualizat= ion"); - exit(1); - } - configure_icount(icount_opts, &error_abort); - qemu_opts_del(icount_opts); + if (use_icount && !(tcg_enabled() || qtest_enabled())) { + error_report("-icount is not allowed with hardware virtualization"= ); + exit(1); } =20 if (tcg_enabled()) { --=20 1.8.3.1