From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755153AbbCBQoJ (ORCPT ); Mon, 2 Mar 2015 11:44:09 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:50672 "EHLO e06smtp13.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755096AbbCBQoA convert rfc822-to-8bit (ORCPT ); Mon, 2 Mar 2015 11:44:00 -0500 Date: Mon, 2 Mar 2015 17:43:52 +0100 From: Michael Mueller To: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: qemu-devel@nongnu.org, "Edgar E. Iglesias" , Peter Crosthwaite , linux-s390@vger.kernel.org, kvm@vger.kernel.org, Gleb Natapov , Alexander Graf , Eduardo Habkost , linux-kernel@vger.kernel.org, Christian Borntraeger , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Alistair Francis , Richard Henderson Subject: Re: [Qemu-devel] [PATCH v3 01/16] Introduce probe mode for machine type none Message-ID: <20150302174352.3715f1e4@bee> In-Reply-To: <54F46C41.3000201@suse.de> References: <1425300248-40277-1-git-send-email-mimu@linux.vnet.ibm.com> <1425300248-40277-2-git-send-email-mimu@linux.vnet.ibm.com> <54F46C41.3000201@suse.de> Organization: IBM X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15030216-0013-0000-0000-000003233692 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 02 Mar 2015 14:57:21 +0100 Andreas Färber wrote: > > int configure_accelerator(MachineState *ms) > > { > > - const char *p; > > + const char *p, *name; > > char buf[10]; > > int ret; > > bool accel_initialised = false; > > bool init_failed = false; > > AccelClass *acc = NULL; > > + ObjectClass *oc; > > + bool probe_mode = false; > > > > p = qemu_opt_get(qemu_get_machine_opts(), "accel"); > > if (p == NULL) { > > - /* Use the default "accelerator", tcg */ > > - p = "tcg"; > > + oc = (ObjectClass *) MACHINE_GET_CLASS(current_machine); > > + name = object_class_get_name(oc); > > + probe_mode = !strcmp(name, "none" TYPE_MACHINE_SUFFIX); > > + if (probe_mode) { > > + /* Use these accelerators in probe mode, tcg should be last */ > > + p = probe_mode_accels; > > + } else { > > + /* Use the default "accelerator", tcg */ > > + p = "tcg"; > > + } > > } > > Can't we instead use an explicit ,accel=probe or ,accel=auto? > That would then obsolete the next patch. How would you express the following with the accel= approach? -probe -machine s390-ccw,accel=kvm Using machine "none" as default with tcg as last accelerator initialized should not break anything. -M none The return code of configure_accelerator() is ignored anyway. Thanks, Michael