Received: from eggs.gnu.org ([208.118.235.92]:41879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBRuN-0001Wm-W7 for qemu-devel@nongnu.org; Fri, 01 Mar 2013 10:30:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBRuJ-00016l-2w for qemu-devel@nongnu.org; Fri, 01 Mar 2013 10:30:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBRuI-00016d-Qe for qemu-devel@nongnu.org; Fri, 01 Mar 2013 10:29:59 -0500 Date: Fri, 1 Mar 2013 12:31:29 -0300 From: Eduardo Habkost Message-ID: <20130301153129.GW8494@otherpad.lan.raisama.net> References: <20130221145818.GK16618@otherpad.lan.raisama.net> <20130301132837.GF3375700@orkuz.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130301132837.GF3375700@orkuz.home> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] libvirt<->QEMU interfaces for CPU models List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, libvir-list@redhat.com, Andreas =?iso-8859-1?Q?F=E4rber?= , Igor Mammedov On Fri, Mar 01, 2013 at 02:28:37PM +0100, Jiri Denemark wrote: > On Thu, Feb 21, 2013 at 11:58:18 -0300, Eduardo Habkost wrote: > > =3D Querying host capabilities =3D > >=20 > > Requirement: libvirt needs to know which feature can really be enable= d, before > > it tries to start a VM, and before it tries to start a live-migration= process. > >=20 > > The set of available capabilities depend on: > >=20 > > =E2=80=A2 Host CPU (hardware) capabilities; > > =E2=80=A2 Kernel capabilities (reported by GET_SUPPORTED_CPUID); > > =E2=80=A2 QEMU capabilities; > > =E2=80=A2 Specific configuration options (e.g. in-kernel IRQ chip i= s required for > > some features). >=20 > Actually, one more thing. Can any of these requirements change while a > host is up and QEMU is not upgraded? I believe, host CPU capabilities > can only change when the host starts. Kernel capabilities are a bit les= s > clear since I guess they could possibly change when kvm module is > unloaded and loaded back with a different options. QEMU capabilities > should only change when different version is installed. And the specifi= c > configuration options are the most unclear to me. The reason I'm asking > is whether libvirt could run-time cache CPU definitions (including all > model details) in the same way we currently cache QEMU capabilities, > such as availability of specific QMP commands. That's a good question. Let's check each item so I don't forget any detail: > > =E2=80=A2 Host CPU (hardware) capabilities; This shouldn't change without a host reboot. > > =E2=80=A2 Kernel capabilities (reported by GET_SUPPORTED_CPUID); This may possibly change if the KVM module is unloaded and reloaded with different options, but... I guess we should simply require libvirtd to be restarted if any user does that? > > =E2=80=A2 QEMU capabilities; This shouldn't change as long as the QEMU binary doesn't change. > > =E2=80=A2 Specific configuration options (e.g. in-kernel IRQ chip i= s required for > > some features). This part seems tricky. Currently kernel-irqchip is probably the only option that affects which features are available, but what if other QEMU options affect the set of features too? I believe the answer is to rely on machine-types. I mean: if a new option that affects "-cpu host" and the set of available CPU features is created, there are two options: 1) Using the default value; 2) Setting the option explicitly. 1) If using the default value, the default will depend on machine-type, s= o libvirt should already consider machine-type as an option that affects available-CPU-features. 2) If using an explicit value, libvirt should use the explicit value only after being changed to take into account the fact that the option affects available-CPU-features. So, let's add one more item to the list. The set of available capabilities depend on: =E2=80=A2 Host CPU (hardware) capabilities; =E2=80=A2 Kernel capabilities (reported by GET_SUPPORTED_CPUID); =E2=80=A2 QEMU capabilities; =E2=80=A2 Specific configuration options: =E2=80=A2 kernel-irqchip (currently affects tsc-deadline and x2apic, = but may affect other features in the future) =E2=80=A2 machine-type (may affect any feature in the future) --=20 Eduardo