From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmgI9-0004ZQ-07 for qemu-devel@nongnu.org; Mon, 27 Apr 2015 06:29:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmgI4-0000u0-0K for qemu-devel@nongnu.org; Mon, 27 Apr 2015 06:29:32 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:56979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmgI3-0000to-Mj for qemu-devel@nongnu.org; Mon, 27 Apr 2015 06:29:27 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 27 Apr 2015 11:29:26 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id E24981B08061 for ; Mon, 27 Apr 2015 11:30:03 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t3RATPxn5767538 for ; Mon, 27 Apr 2015 10:29:25 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t3RATOMK026983 for ; Mon, 27 Apr 2015 04:29:25 -0600 Date: Mon, 27 Apr 2015 12:29:23 +0200 From: Michael Mueller Message-ID: <20150427122923.490287f0@bee> In-Reply-To: <553DEF31.5070803@de.ibm.com> References: <1428933396-37887-1-git-send-email-mimu@linux.vnet.ibm.com> <1428933396-37887-16-git-send-email-mimu@linux.vnet.ibm.com> <553DEF31.5070803@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 15/17] target-s390x: Extend arch specific QMP command query-cpu-definitions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: linux-s390@vger.kernel.org, Eduardo Habkost , kvm@vger.kernel.org, Gleb Natapov , qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, Cornelia Huck , Alexander Graf , "Jason J. Herne" , Daniel Hansel , Paolo Bonzini , Andreas Faerber , Richard Henderson On Mon, 27 Apr 2015 10:11:29 +0200 Christian Borntraeger wrote: > > This patch implements the QMP command 'query-cpu-definitions' in the S390 > > context. The command returns a list of cpu definitions in the current host > > context. A runnable and migratable cpu model has the related attributes > > set to true. The order attribute is used to bring the listed cpu definitions > > in a release order. > > Can you add some explanation why we need the fallback code (e.g. something > along the line, when querying no KVM guest is available and to query the > capabilities we have to open a dummy VM bla bla) Maybe something like that: The returned values for attributes like runnable depend on the machine type QEMU is running on. The function kvm_s390_get_machine_props() is used to determine that. If QEMU was started for accelerator KVM, a KVMstate is established and machine properties are retrieved by cpu_model_get(). In case no KVMstate was established, e.g. during QEMU startup in daemonized mode with the default accelerator TCG, a fallback routine named get_machine_props_fallback() is used to retrieve the KVM machine properties. It first creates a temporary VM, performs the required ioctls and finally destroys the VM again. Michael