From nobody Mon Feb 9 19:53:19 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; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554109869609177.52319452852862; Mon, 1 Apr 2019 02:11:09 -0700 (PDT) Received: from localhost ([127.0.0.1]:33182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAsyC-000730-EQ for importer@patchew.org; Mon, 01 Apr 2019 05:11:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAsvl-0005PQ-Rh for qemu-devel@nongnu.org; Mon, 01 Apr 2019 05:08:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAsvk-0004H7-Vg for qemu-devel@nongnu.org; Mon, 01 Apr 2019 05:08:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35512) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hAsvk-0004Gi-OM for qemu-devel@nongnu.org; Mon, 01 Apr 2019 05:08:36 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0243030198A5; Mon, 1 Apr 2019 09:08:36 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9EF2B5D9D4; Mon, 1 Apr 2019 09:08:33 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 018A01132B38; Mon, 1 Apr 2019 11:08:28 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 11:08:27 +0200 Message-Id: <20190401090827.20793-6-armbru@redhat.com> In-Reply-To: <20190401090827.20793-1-armbru@redhat.com> References: <20190401090827.20793-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 01 Apr 2019 09:08:36 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 5/5] accel: Unbreak accelerator fallback 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: kwolf@redhat.com, quintela@redhat.com, dgilbert@redhat.com, peterx@redhat.com, anthony.perard@citrix.com, imammedo@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" When the user specifies a list of accelerators, we pick the first one that initializes successfully. Recent commit 1a3ec8c1564 broke that. Reproducer: $ qemu-system-x86_64 --machine accel=3Dxen:tcg xencall: error: Could not obtain handle on privileged command interface= : No such file or directory xen be core: xen be core: can't open xen interface can't open xen interface qemu-system-x86_64: failed to initialize Xen: Operation not permitted qemu-system-x86_64: /home/armbru/work/qemu/qom/object.c:436: object_set= _accelerator_compat_props: Assertion `!object_compat_props[0]' failed. Root cause: we register accelerator compat properties even when the accelerator fails. The failed assertion is object_set_accelerator_compat_props() telling us off. Fix by calling it only for the accelerator that succeeded. Fixes: 1a3ec8c1564f51628cce10d435a2e22559ea29fd Signed-off-by: Markus Armbruster Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- accel/accel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accel/accel.c b/accel/accel.c index 8deb475b5d..454fef9d92 100644 --- a/accel/accel.c +++ b/accel/accel.c @@ -65,8 +65,9 @@ static int accel_init_machine(AccelClass *acc, MachineSta= te *ms) ms->accelerator =3D NULL; *(acc->allowed) =3D false; object_unref(OBJECT(accel)); + } else { + object_set_accelerator_compat_props(acc->compat_props); } - object_set_accelerator_compat_props(acc->compat_props); return ret; } =20 --=20 2.17.2