From nobody Mon Feb 9 12:14:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1573656296; cv=none; d=zoho.com; s=zohoarc; b=O5RO5ZJJt9/oqJBtVT4icKgw+8mtYEaU0ydu88kd2gFYmTtWjr6eyIqhm1m3493EfwFN6zZbT7P0A1nOc9/bpDZyRvIa109yksAwXSnyVKJvslcYWQbT43EiFSd3J5YdOyVCzH3MPK0zv/D8YF0K+zpGWZiOpyJOeqO42egBczk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573656296; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=BMoj3pLYyIvpZE90nhRpNRgweOStTA6dPJpbWeqyIqQ=; b=E0EKwkOdy8h1BxEC/8O+MATVzvneyUY0wYk0fYGTrV3L+xDQjDdS9WZdSO10S1XOqY1BB5V5nJPeB8Vk9y9HoTOvOGWr4KFo3nbm61WjBqBm7elLSCZGiu0Kp2h4lxMpgz5dW6VeI1WEHoo6qIB8bXafFwvYMesoVKOeQzyj8uA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1573656296526689.1813103580363; Wed, 13 Nov 2019 06:44:56 -0800 (PST) Received: from localhost ([::1]:45684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUtt9-00048T-1b for importer@patchew.org; Wed, 13 Nov 2019 09:44:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54483) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUtnd-0005ih-WF for qemu-devel@nongnu.org; Wed, 13 Nov 2019 09:39:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUtnc-0006JU-Vk for qemu-devel@nongnu.org; Wed, 13 Nov 2019 09:39:13 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:33032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUtnc-0006JB-OX for qemu-devel@nongnu.org; Wed, 13 Nov 2019 09:39:12 -0500 Received: by mail-wr1-x441.google.com with SMTP id w9so2667432wrr.0 for ; Wed, 13 Nov 2019 06:39:12 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id s11sm2965823wrr.43.2019.11.13.06.39.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Nov 2019 06:39:10 -0800 (PST) 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=BMoj3pLYyIvpZE90nhRpNRgweOStTA6dPJpbWeqyIqQ=; b=TnFge3x3+IgpnvnFjoTBzC6C4TgEH73eBp9JvzN1Z+Log2Wks1dYzLUXF4qbkO0V0W Qh+SfD6hrwB69FBBj4r3gpD7VsGpnRYY/+yLZQ5WM/uG/jVAICo933BuzltwN3tdIi+g OOe9+bzfeTW1XgqlpE0mqNVX5uxNrc3OylpzHns2+5GFMRmUsXs+mxHfuSBVljt7U4qX XkQNi1T1R5Bg0ZuuCHuAlRdCzu0UAeKWO+yE0JDp975/gPjSJGPr7b31GKS+ghniuIVx 5p6zoZfEbbMM6J2p3CA77ulnPe+glSfrXw5eOiz70nOa3PSreb3tilY60dpA7WJFyWwE ixZw== 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=BMoj3pLYyIvpZE90nhRpNRgweOStTA6dPJpbWeqyIqQ=; b=r3em8jgcnZKCtf9gBk12MGvhQARflrD/JhXxNOjnET1XTW1o2taCnaQ0tHpKfCTWoF MY0n6GVGZ0C2PG2egzjlEzlKnMP3HigJQGbEXd8kLJjflEnxS8bCrangiawjvqP1nF2K Q0sb+Hqzy4HUbEA9uVOYkxXLE1VLTPgz2id7WyqGwvL6ovbe5qCrhoiZDCP7lOiP/EM4 Rg3hj0nWxpaivUMRxWHUdksxyDO53INLVbqkF9ik5yxeJ1Z8b+cKh621OgELMj01Ul51 Ly6itNXoFfybS5iN5n112Na43fAaXBMZLOtjwEiNKrIJhgf7+WPaITYM1L6jixLEaP7e FIng== X-Gm-Message-State: APjAAAVFUN8agImoWV+7w/BQra0yerg7TtnKCvP2CXaKaHQti6ceI6Dn VOJ/w5hzgU/98R/KiCKblx+N9+8S X-Google-Smtp-Source: APXvYqyU5bACf/fUSCh/UMDpw/ZTXwjkL+n/6PZA6pDio2/uZlRNeM/6FAkz70Qmrlte2HILhEAplw== X-Received: by 2002:adf:fa0b:: with SMTP id m11mr3365936wrr.279.1573655951103; Wed, 13 Nov 2019 06:39:11 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 04/16] vl: move icount configuration earlier Date: Wed, 13 Nov 2019 15:38:53 +0100 Message-Id: <1573655945-14912-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1573655945-14912-1-git-send-email-pbonzini@redhat.com> References: <1573655945-14912-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::441 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: , Cc: thuth@redhat.com, armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 init_machine method, which currently runs after "-icount" is processed. However, it is harmless to do configure_icount for all accelerators; we will just fail later if a non-TCG accelerator being selected. So do that. Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth --- vl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/vl.c b/vl.c index fc9e70f..dbc99d7 100644 --- a/vl.c +++ b/vl.c @@ -2829,11 +2829,7 @@ static void user_register_global_props(void) =20 static int do_configure_icount(void *opaque, QemuOpts *opts, Error **errp) { - if (tcg_enabled()) { - configure_icount(opts, errp); - } else { - error_setg(errp, "-icount is not allowed with hardware virtualizat= ion"); - } + configure_icount(opts, errp); return 0; } =20 @@ -2854,6 +2850,9 @@ static void configure_accelerators(const char *progna= me) bool init_failed =3D false; AccelClass *acc =3D NULL; =20 + qemu_opts_foreach(qemu_find_opts("icount"), + do_configure_icount, NULL, &error_fatal); + accel =3D qemu_opt_get(qemu_get_machine_opts(), "accel"); if (accel =3D=3D NULL) { /* Select the default accelerator */ @@ -2901,11 +2900,13 @@ static void configure_accelerators(const char *prog= name) error_report("Back to %s accelerator", acc->name); } =20 - qemu_opts_foreach(qemu_find_opts("icount"), - do_configure_icount, NULL, &error_fatal); - qemu_opts_foreach(qemu_find_opts("accel"), do_configure_accelerator, NULL, &error_fatal); + + if (!tcg_enabled() && use_icount) { + error_report("-icount is not allowed with hardware virtualization"= ); + exit(1); + } } =20 int main(int argc, char **argv, char **envp) --=20 1.8.3.1