Received: from eggs.gnu.org ([208.118.235.92]:54580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7A16-0000lZ-8U for qemu-devel@nongnu.org; Mon, 12 Mar 2012 14:30:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7A11-0003j7-4h for qemu-devel@nongnu.org; Mon, 12 Mar 2012 14:30:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7A10-0003io-SB for qemu-devel@nongnu.org; Mon, 12 Mar 2012 14:30:39 -0400 Date: Mon, 12 Mar 2012 15:30:36 -0300 From: Eduardo Habkost Message-ID: <20120312183036.GK20654@otherpad.lan.raisama.net> References: <20120310155843.GJ2914@otherpad.lan.raisama.net> <4F5B9C6F.3050705@codemonkey.ws> <20120311132755.GJ17882@redhat.com> <4F5CB2EA.10000@codemonkey.ws> <20120311145655.GK17882@redhat.com> <4F5CC5BB.3070000@codemonkey.ws> <20120311161625.GN17882@redhat.com> <4F5E1B1B.1040606@suse.de> <20120312165014.GA25451@otherpad.lan.raisama.net> <4F5E3532.4060003@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <4F5E3532.4060003@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [libvirt] Modern CPU models cannot be used with libvirt List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: "Liu, Jinsong" , Gleb Natapov , libvir-list@redhat.com, Jan Kiszka , qemu-devel@nongnu.org, Avi Kivity , Anthony Liguori , Igor Mammedov , Jiri Denemark , "arch@ovirt.org" On Mon, Mar 12, 2012 at 06:41:06PM +0100, Andreas F=E4rber wrote: > Am 12.03.2012 17:50, schrieb Eduardo Habkost: > > On Mon, Mar 12, 2012 at 04:49:47PM +0100, Andreas F=E4rber wrote: [...] > >> IMO interpreting an explicit -cpu parameter depending on -M would be > >> wrong. Changing the default CPU based on -M is fine with me. For an > >> explicit argument we would need Westmere-1.0 analog to pc-1.0. Then = the > >> user gets what the user asks for, without unexpected magic. > >=20 > > It is not unexpected magic. It would be a documented mechanism: > > "-cpu Nehalem-1.0" and "-cpu Nehalem-1.1" would have the same meaning > > every time, with any machine-type, but "-cpu Nehalem" would be an ali= as, > > whose meaning depends on the machine-type. > >=20 > > Otherwise we would be stuck with a broken "Nehalem" model forever, an= d > > we don't want that. >=20 > Not quite what I meant: In light of QOM we should be able to instantiat= e > a CPU based on its name and optional parameters IMO. No dependency on > the machine, please. An alias sure, but if the user explicitly says -cp= u > Nehalem then on 1.1 it should always be an alias to Nehalem-1.1 whether > the machine is -M pc-0.15 or pc. If no -cpu was specified by the user, > then choosing a default of Nehalem-1.0 for pc-1.0 is fine. Just trying > to keep separate things separate here. As Gleb explained, things aren't really separated: "qemu-1.1 -M pc-1.0 -cpu Nehalem" should result in the same machine as "qemu-1.0 -cpu Nehalem", no difference should be visible to the guest. simply make incompatible changes. >=20 > Also keep in mind linux-user. There's no concept of a machine there, bu= t > there's a cpu_copy() function used for forking that tries to re-create > the CPU based on its model. So currently cpu_*_init(env->cpu_model_str) > needs to be able to recreate an identical CPU through the central code > path, without access to a QEMUMachine. So just translate the CPU alias given to "-cpu" to the true CPU model name as soon as possible, at the command-line-handling code, so the rest of the code always see the true CPU model name. After all, the need to make the aliases is a command-line interface compatibility problem, so it makes sense to handle this at the command-line-handling code. --=20 Eduardo