Received: from eggs.gnu.org ([2001:4830:134:3::10]:43488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrr3e-0005Wb-MF for qemu-devel@nongnu.org; Mon, 11 May 2015 12:59:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrr3Y-0001dh-VN for qemu-devel@nongnu.org; Mon, 11 May 2015 12:59:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrr3Y-0001dY-Oc for qemu-devel@nongnu.org; Mon, 11 May 2015 12:59:52 -0400 Date: Mon, 11 May 2015 13:59:36 -0300 From: Eduardo Habkost Message-ID: <20150511165936.GR17796@thinpad.lan.raisama.net> References: <1430146411-34632-1-git-send-email-mimu@linux.vnet.ibm.com> <1430146411-34632-16-git-send-email-mimu@linux.vnet.ibm.com> <20150506123741.GH25766@thinpad.lan.raisama.net> <20150506164857.5df6a1ae@bee> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150506164857.5df6a1ae@bee> Subject: Re: [Qemu-devel] [PATCH v6 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: Michael Mueller Cc: Cornelia Huck , Gleb Natapov , qemu-devel@nongnu.org, Alexander Graf , Christian Borntraeger , "Jason J. Herne" , Daniel Hansel , Paolo Bonzini , Andreas Faerber , Richard Henderson On Wed, May 06, 2015 at 04:48:57PM +0200, Michael Mueller wrote: > On Wed, 6 May 2015 09:37:41 -0300 > Eduardo Habkost wrote: [...] > > > > > > > > - info = g_malloc0(sizeof(*info)); > > > - info->name = g_strdup("host"); > > > + memset(&mach, 0, sizeof(mach)); > > > + if (has_accel) { > > > + switch (accel) { > > > + case ACCEL_ID_KVM: > > > + kvm_s390_get_machine_props(NULL, &mach); > > > + break; > > > + default: > > > + return qmp_query_cpu_definition_host(); > > > > This will return only a single element. I don't think that's correct. If > > machine or accel is omitted, I believe we should just omit the > > "runnable" field, but always return the full list of CPU models. > > That is the !KVM case where I keep the behavior currently unchanged to > the existing implementation. But right for the TCG case there has to be > a comparable get_machine_props() call returning whatever TCG is implementing. > But that is not part of this patch series. I believe the right thing to do is to return the full list of CPU models, but report them as not runnable if accel is TCG, and simply omit the runnable field if no accel argument is provided. This way, existing management code that already runs query-cpu-models (e.g. libvirt, that does that with "-machine none") will keep working. -- Eduardo