From patchwork Tue Oct 4 12:29:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 678045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3spJCP4Txfz9s5g for ; Tue, 4 Oct 2016 23:30:09 +1100 (AEDT) Received: from localhost ([::1]:42146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brOrG-00016T-8i for incoming@patchwork.ozlabs.org; Tue, 04 Oct 2016 08:30:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brOqd-0000pC-Sj for qemu-devel@nongnu.org; Tue, 04 Oct 2016 08:29:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brOqY-0003X5-MA for qemu-devel@nongnu.org; Tue, 04 Oct 2016 08:29:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brOqY-0003RL-FW for qemu-devel@nongnu.org; Tue, 04 Oct 2016 08:29:22 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E97593F201; Tue, 4 Oct 2016 12:29:20 +0000 (UTC) Received: from [10.36.112.35] (ovpn-112-35.ams2.redhat.com [10.36.112.35]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u94CTHWO000431; Tue, 4 Oct 2016 08:29:18 -0400 To: "Daniel P. Berrange" References: <1475580648-6470-1-git-send-email-lvivier@redhat.com> <1475580648-6470-2-git-send-email-lvivier@redhat.com> <20161004120001.GG5578@redhat.com> From: Laurent Vivier Message-ID: Date: Tue, 4 Oct 2016 14:29:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161004120001.GG5578@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 04 Oct 2016 12:29:20 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH 1/2] accel: allows to select the "best" 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: Peter Maydell , Thomas Huth , Stefano Stabellini , "Michael S . Tsirkin" , qemu-devel@nongnu.org, Paolo Bonzini , =?UTF-8?Q?Alex_Benn=c3=a9e?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" On 04/10/2016 14:00, Daniel P. Berrange wrote: > On Tue, Oct 04, 2016 at 01:30:47PM +0200, Laurent Vivier wrote: >> By default, QEMU uses 'tcg' or the one provided with the "accel" >> property. >> >> But sometime, user wants to use a real accelerator without knowing >> if he really can, with, for instance accel=kvm:tcg. >> In this case, and if the accelerator is not available we >> have a noisy "XXX accelerator not found". > > IMHO it would be better to just remove that warning message > and continue using existing accel=kvm:tcg syntax to specify > the preference of which accelerators to use. > > Only emit "XXX accelerator not found", if there are not > further accelerators listed. eg > > accel=kvm:tcg > > should not print a "KVM accelerator not found" warning > when it falls back to tcg, but a > > accel=kvm > > would print a warning, since no fallback is given. Something like this? --- a/accel.c +++ b/accel.c @@ -99,7 +99,12 @@ void configure_accelerator(MachineState *ms) p = get_opt_name(buf, sizeof(buf), p, ':'); acc = accel_find(buf); if (!acc) { - fprintf(stderr, "\"%s\" accelerator not found.\n", buf); + if (*p != ':') { + /* to avoid to pollute logs, display error only + * on the last accelerator of the list + */ + fprintf(stderr, "\"%s\" accelerator not found.\n", buf); + } continue; } if (acc->available && !acc->available()) {