Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932585AbbD0K3d (ORCPT ); Mon, 27 Apr 2015 06:29:33 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:59978 "EHLO e06smtp16.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932395AbbD0K3b (ORCPT ); Mon, 27 Apr 2015 06:29:31 -0400 Date: Mon, 27 Apr 2015 12:29:23 +0200 From: Michael Mueller To: Christian Borntraeger Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Eduardo Habkost , Gleb Natapov , Alexander Graf , Daniel Hansel , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Richard Henderson , Andreas Faerber Subject: Re: [Qemu-devel] [PATCH v5 15/17] target-s390x: Extend arch specific QMP command query-cpu-definitions 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> 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=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15042710-0025-0000-0000-000004E528A7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1523 Lines: 30 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/