From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sul5P-0006sg-55 for qemu-devel@nongnu.org; Fri, 27 Jul 2012 10:00:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sul5F-0008Nt-Jm for qemu-devel@nongnu.org; Fri, 27 Jul 2012 10:00:11 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:53866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sul5F-0008Np-FN for qemu-devel@nongnu.org; Fri, 27 Jul 2012 10:00:01 -0400 Received: by yenl1 with SMTP id l1so3156373yen.4 for ; Fri, 27 Jul 2012 07:00:01 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1343396239-19272-6-git-send-email-aliguori@us.ibm.com> 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 15:00:00 +0100 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 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: Anthony Liguori Cc: libvir-list@redhat.com, Markus Armbruster , Alexander Graf , qemu-devel@nongnu.org, Eric Blake 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-*... > 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). 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 etc. -- PMM