From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sum7u-0000dz-0D for qemu-devel@nongnu.org; Fri, 27 Jul 2012 11:06:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sum7s-0000L9-J6 for qemu-devel@nongnu.org; Fri, 27 Jul 2012 11:06:49 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:58541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sum7s-0000L1-Es for qemu-devel@nongnu.org; Fri, 27 Jul 2012 11:06:48 -0400 Received: from /spool/local by e6.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Jul 2012 11:06:43 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 32DD6C90050 for ; Fri, 27 Jul 2012 11:02:07 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6RF264D380774 for ; Fri, 27 Jul 2012 11:02:06 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6RKWupm010667 for ; Fri, 27 Jul 2012 16:32:59 -0400 From: Anthony Liguori In-Reply-To: References: <1343396239-19272-1-git-send-email-aliguori@us.ibm.com> <1343396239-19272-6-git-send-email-aliguori@us.ibm.com> Date: Fri, 27 Jul 2012 10:01:54 -0500 Message-ID: <87ehnx9rj1.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 5/7] qapi: add query-cpudefs command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: libvir-list@redhat.com, Markus Armbruster , Alexander Graf , qemu-devel@nongnu.org, Eric Blake Peter Maydell writes: > On 27 July 2012 14:37, Anthony Liguori wrote: >> This command attempts to map to the behavior of -cpu ?. Unfortunately, the >> output of this command differs wildly across targets. > > I've never really understood why so much of the cpu selection > logic is deferred to target-*... It will be fixed as part of the QOM conversion. >> To accomodate this, we use a weak symbol to implement a default version of the >> command that fails with a QERR_NOT_SUPPORTED error code. Targets can then >> override and implement this command if it makes sense for them. > > This is a bit of a weak reason (boom boom!) for requiring a platform > specific thing like weak symbols, though, and it's not how we handle > similar existing cases (eg see the configure/makefile logic for > memory_mapping.c vs memory_mapping-stub.c). I don't think we have a consistent approach today FWIW. I think using weak symbols is sufficiently compelling that it will become consistent. > > If having separate configure/make stuff for each of these things > sounds a bit heavyweight, we could just have a target-stubs.c which > #includes cpu.h and has a lot of > #ifndef TARGET_QUERY_CPUDEFS > [stub version] > #endif > #ifndef TARGET_GET_MEMORY_MAPPING > [stub version] > #endif This is pretty hideous. FWIW, weak symbols are supported on OS X as of 10.2. Regards, Anthony Liguori > > etc. > > -- PMM