From nobody Sat May 4 04:11:53 2024 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; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505323838259313.87021475523284; Wed, 13 Sep 2017 10:30:38 -0700 (PDT) Received: from localhost ([::1]:43830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsBUj-0008K3-GS for importer@patchew.org; Wed, 13 Sep 2017 13:30:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsBTx-0007qh-KT for qemu-devel@nongnu.org; Wed, 13 Sep 2017 13:29:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsBTu-0002jG-89 for qemu-devel@nongnu.org; Wed, 13 Sep 2017 13:29:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45716) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dsBTu-0002hM-0Z for qemu-devel@nongnu.org; Wed, 13 Sep 2017 13:29:46 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 032EF85542; Wed, 13 Sep 2017 17:29:45 +0000 (UTC) Received: from localhost (ovpn-117-3.ams2.redhat.com [10.36.117.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5EDEB4DA65; Wed, 13 Sep 2017 17:29:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 032EF85542 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Wed, 13 Sep 2017 19:29:41 +0200 Message-Id: <20170913172941.5470-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 13 Sep 2017 17:29:45 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2] accel: default to an actually available accelerator 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: lvivier@redhat.com, kwolf@redhat.com, thuth@redhat.com, peter.maydell@linaro.org, Cornelia Huck , richard.henderson@linaro.org, mreitz@redhat.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" configure_accelerator() falls back to tcg if no accelerator has been specified. Formerly, we could be sure that tcg is always available; however, with --disable-tcg, this is not longer true, and you are not able to start qemu without explicitly specifying another accelerator on those builds. Instead, choose an accelerator in the order tcg->kvm->hax. Signed-off-by: Cornelia Huck Reviewed-by: Thomas Huth --- RFC->v2: - drop xen from the list of fallbacks - use comma-delimited list of accelerators (much easier) - changed one place in qemu-options.hx that had been missed --- accel/accel.c | 3 +-- qemu-options.hx | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/accel/accel.c b/accel/accel.c index 8ae40e1e13..e8a3121d06 100644 --- a/accel/accel.c +++ b/accel/accel.c @@ -79,8 +79,7 @@ void configure_accelerator(MachineState *ms) =20 accel =3D qemu_opt_get(qemu_get_machine_opts(), "accel"); if (accel =3D=3D NULL) { - /* Use the default "accelerator", tcg */ - accel =3D "tcg"; + accel =3D "tcg:kvm:hax"; } =20 p =3D accel; diff --git a/qemu-options.hx b/qemu-options.hx index 9f6e2adfff..2ff88389e0 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -31,7 +31,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ "-machine [type=3D]name[,prop[=3Dvalue][,...]]\n" " selects emulated machine ('-machine help' for list)\n" " property accel=3Daccel1[:accel2[:...]] selects accele= rator\n" - " supported accelerators are kvm, xen, hax or tcg (defa= ult: tcg)\n" + " supported accelerators are kvm, xen, hax or tcg (defa= ult: tcg:kvm:hax)\n" " kernel_irqchip=3Don|off|split controls accelerated ir= qchip support (default=3Doff)\n" " vmport=3Don|off|auto controls emulation of vmport (de= fault: auto)\n" " kvm_shadow_mem=3Dsize of KVM shadow MMU in bytes\n" @@ -66,7 +66,8 @@ Supported machine properties are: @table @option @item accel=3D@var{accels1}[:@var{accels2}[:...]] This is used to enable an accelerator. Depending on the target architectur= e, -kvm, xen, hax or tcg can be available. By default, tcg is used. If there is +kvm, xen, hax or tcg can be available. By default, the first one available +out of tcg, kvm, hax (in that order) is used. If there is more than one accelerator specified, the next one is used if the previous = one fails to initialize. @item kernel_irqchip=3Don|off @@ -126,7 +127,8 @@ STEXI @item -accel @var{name}[,prop=3D@var{value}[,...]] @findex -accel This is used to enable an accelerator. Depending on the target architectur= e, -kvm, xen, hax or tcg can be available. By default, tcg is used. If there is +kvm, xen, hax or tcg can be available. By default, the first one available +out of tcg, kvm, hax (in that order) is used. If there is more than one accelerator specified, the next one is used if the previous = one fails to initialize. @table @option --=20 2.13.5