From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUZN8-0002Fk-K3 for qemu-devel@nongnu.org; Tue, 02 Aug 2016 09:04:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUZN5-0007DS-Ao for qemu-devel@nongnu.org; Tue, 02 Aug 2016 09:04:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUZN5-0007DH-3c for qemu-devel@nongnu.org; Tue, 02 Aug 2016 09:04:35 -0400 Date: Tue, 2 Aug 2016 10:04:32 -0300 From: Eduardo Habkost Message-ID: <20160802130432.GD3337@thinpad.lan.raisama.net> References: <1470139155-53900-1-git-send-email-dahi@linux.vnet.ibm.com> <1470139155-53900-2-git-send-email-dahi@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1470139155-53900-2-git-send-email-dahi@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [Patch v1 01/29] qmp: details about CPU definitions in query-cpu-definitions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Hildenbrand Cc: qemu-devel@nongnu.org, jdenemar@redhat.com, imammedo@redhat.com, cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, fiuczy@linux.vnet.ibm.com, mimu@linux.vnet.ibm.com On Tue, Aug 02, 2016 at 01:58:47PM +0200, David Hildenbrand wrote: > It might be of interest for tooling whether a CPU definition can be safely > used when migrating, or if e.g. CPU features might get lost during > migration when migrationg from/to a different QEMU version or host, even if > the same compatibility machine is used. > > Also, we want to know if a CPU definition is static and will never change. > Beause these definitions can then be used independantly of a compatibility > machine and will always have the same feature set, they can e.g. be used > to indicate the "host" model in libvirt later on. > > Let's add optional return values to query-cpu-definitions, stating for > each returned CPU definition, if it is migration-safe and if it is static. > > Signed-off-by: David Hildenbrand > --- > qapi-schema.json | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/qapi-schema.json b/qapi-schema.json > index 5658723..3f50c1d 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -3038,10 +3038,19 @@ > # > # @name: the name of the CPU definition > # > +# @migration-safe: #optional whether a CPU definition can be safely used for > +# migration in combination with a QEMU compatibility machine > +# when migrating between different QMU versions and hosts. > +# If not provided, information is not available. I would be more explicit about migration between different hosts. I suggest "between different QEMU versions and between hosts with different sets of (hardware or software) capabilities". Maybe we should make the "if not provided" case clearer. Maybe "if not provided, information is not available and caller should not assume the CPU model is migration-safe". We know that existing libvirt x86 code assumes all CPU models (except "host") are migration-safe, but it's better to advise people to not try to make any assumptions in new code. Later, we need to document somewhere that the "migratable" property in "host" does not mean "migration-safe" (at least in x86), because migration of "host" is safe only if the host (software and hardware) capabilities are exactly the same. For reference: in x86, all CPU models except "host" are migration-safe. > +# > +# @static: #optional whether a CPU definition is static and will not change > +# between QEMU versions / QEMU machines. A static model is always > +# migration-safe. If not provided, information is not available. I assume static models don't change depending on the machine-type, either. If that's case, we should document that. I believe in this case we don't need to make it optional: just make the field always present and set it to "false" by default. > +# > # Since: 1.2.0 > ## > { 'struct': 'CpuDefinitionInfo', > - 'data': { 'name': 'str' } } > + 'data': { 'name': 'str', '*migration-safe' : 'bool', '*static' : 'bool' } } > > ## > # @query-cpu-definitions: > -- > 2.6.6 > -- Eduardo