Received: from eggs.gnu.org ([2001:4830:134:3::10]:48638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8To6-0004vi-Pb for qemu-devel@nongnu.org; Thu, 02 Jun 2016 10:41:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8To4-0005dy-S0 for qemu-devel@nongnu.org; Thu, 02 Jun 2016 10:41:09 -0400 Date: Thu, 2 Jun 2016 11:41:00 -0300 From: Eduardo Habkost Message-ID: <20160602144100.GE19055@thinpad.lan.raisama.net> References: <1464799050-11002-1-git-send-email-imammedo@redhat.com> <1464799050-11002-7-git-send-email-imammedo@redhat.com> <20160601185450.GG13503@thinpad.lan.raisama.net> <20160602120659.13aef452@igors-macbook-pro.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160602120659.13aef452@igors-macbook-pro.local> Subject: Re: [Qemu-devel] [PATCH RFC 6/8] cpu: use CPUClass->parse_features() as convertor to global properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: peter.maydell@linaro.org, mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, blauwirbel@gmail.com, qemu-arm@nongnu.org, pbonzini@redhat.com, rth@twiddle.net On Thu, Jun 02, 2016 at 12:06:59PM +0200, Igor Mammedov wrote: > On Wed, 1 Jun 2016 15:54:50 -0300 > Eduardo Habkost wrote: [...] > > > -static void cpu_common_parse_features(CPUState *cpu, char > > > *features, +static void cpu_common_parse_features(const char > > > *typename, char *features, Error **errp) > > > { > > > char *featurestr; /* Single "key=value" string being parsed */ > > > char *val; > > > - Error *err = NULL; > > > + static bool cpu_globals_initialized; > > > + > > > + if (cpu_globals_initialized) { > > > + return; > > > + } > > > > Should we replace this with assert(!cpu_globals_initialized) > > after applying patch 8/8? > assert might potentially break cpu_init() users, so I went safest route > here. No problem: we can add an assert() after fixing the cpu_init() users, if necessary (we have only two of them). -- Eduardo