From: Anthony Liguori <anthony@codemonkey.ws>
To: Gleb Natapov <gleb@redhat.com>
Cc: libvir-list@redhat.com, Jiri Denemark <jdenemar@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
Avi Kivity <avi@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [libvirt] Modern CPU models cannot be used with libvirt
Date: Thu, 22 Mar 2012 11:37:39 -0500 [thread overview]
Message-ID: <4F6B5553.20601@codemonkey.ws> (raw)
In-Reply-To: <20120322093244.GE22368@redhat.com>
On 03/22/2012 04:32 AM, Gleb Natapov wrote:
> On Tue, Mar 13, 2012 at 11:53:19AM -0300, Eduardo Habkost wrote:
>> So, trying to summarize what was discussed in the call:
>>
>> On Mon, Mar 12, 2012 at 10:08:10AM -0300, Eduardo Habkost wrote:
>>>> Let's say we moved CPU definitions to /usr/share/qemu/cpu-models.xml.
>>>>
>>>> Obviously, we'd want a command line option to be able to change that
>>>> location so we'd introduce -cpu-models PATH.
>>>>
>>>> But we want all of our command line options to be settable by the
>>>> global configuration file so we would have a cpu-model=PATH to the
>>>> configuration file.
>>>>
>>>> But why hard code a path when we can just set the default path in the
>>>> configuration file so let's avoid hard coding and just put
>>>> cpu-models=/usr/share/qemu/cpu-models.xml in the default
>>>> configuration file.
>>>
>>> We wouldn't do the above.
>>>
>>> -nodefconfig should disable the loading of files on /etc, but it
>>> shouldn't disable loading internal non-configurable data that we just
>>> happened to choose to store outside the qemu binary because it makes
>>> development easier.
>>
>> The statement above is the one not fulfilled by the compromise solution:
>> -nodefconfig would really disable the loading of files on /usr/share.
>>
> What does this mean? Will -nodefconfig disable loading of bios.bin,
> option roms, keymaps?
>
>>>
>>> Really, the requirement of a "default configuration file" is a problem
>>> by itself. Qemu should not require a default configuration file to work,
>>> and it shouldn't require users to copy the default configuration file to
>>> change options from the default.
>>
>> The statement above is only partly true. The default configuration file
>> would be still needed, but if defaults are stored on /usr/share, I will
>> be happy with it.
>>
>> My main problem was with the need to _copy_ or edit a non-trivial
>> default config file. If the not-often-edited defaults/templates are
>> easily found on /usr/share to be used with -readconfig, I will be happy
>> with this solution, even if -nodefconfig disable the files on
>> /usr/share.
>>
>>>
>>> Doing this would make it impossible to deploy fixes to users if we evern
>>> find out that the default configuration file had a serious bug. What if
>>> a bug in our default configuration file has a serious security
>>> implication?
>>
>> The answer to this is: if the broken templates/defaults are on
>> /usr/share, it would be easy to deploy the fix.
>>
>> So, the compromise solution is:
>>
>> - We can move some configuration data (especially defaults/templates)
>> to /usr/share (machine-types and CPU models could go there). This
>> way we can easily deploy fixes to the defaults, if necessary.
>> - To reuse Qemu models, or machine-types, and not define everything from
>> scratch, libvirt will have to use something like:
>> "-nodefconfig -readconfig /usr/share/qemu/cpu-models-x86.conf"
>>
> cpu-models-x86.conf is not a configuration file. It is hardware
> description file. QEMU should not lose capability just because you run
> it with -nodefconfig. -nodefconfig means that QEMU does not create
> machine for you, but all parts needed to create a machine that would have
> been created without -nodefconfig are still present. Not been able to
> create Nehalem CPU after specifying -nodefconfig is the same as not been
> able to create virtio-net i.e the bug.
>
>>
>> (the item below is not something discussed on the call, just something I
>> want to add)
>>
>> To make this work better, we can allow users (humans or machines) to
>> "extend" CPU models on the config file, instead of having to define
>> everything from scratch. So, on /etc (or on a libvirt-generated config)
>> we could have something like:
>>
>> =============
>> [cpu]
>> base_cpudef = Nehalem
>> add_features = "vmx"
>> =============
>>
>> Then, as long as /usr/share/cpu-models-x86.conf is loaded, the user will
>> be able to reuse the Nehalem CPU model provided by Qemu.
>>
> And if it will not be loaded?
>
>>>
>>>>
>>>> But now when libvirt uses -nodefconfig, those models go away.
>>>> -nodefconfig means start QEMU in the most minimal state possible.
>>>> You get what you pay for if you use it.
>>>>
>>>> We'll have the same problem with machine configuration files. At
>>>> some point in time, -nodefconfig will make machine models disappear.
>>>
>>> It shouldn't. Machine-types are defaults to be used as base, they are
>>> not user-provided configuration. And the fact that we decided to store
>>> some data outside of the Qemu binary is orthogonal the design decisions
>>> in the Qemu command-line and configuration interface.
>>
>> So, this problem is solved if the defaults are easily found on
>> /usr/share.
>>
> What problem is solved and why are we mixing machine configuration files
> and cpu configuration files? They are different and should be treated
> differently. -nodefconfig exists only because there is not machine
> configuration files currently. With machine configuration files
> libvirt does not need -nodefconfig because it can create its own machine
> file and make QEMU use it. So specifying machine file on QEMU's command
> line implies -nodefconfig. The option itself loses its meaning and can be
> dropped.
No, -nodefconfig means "no default config".
As with many projects, we can have *some* configuration required.
The default configure should have a:
[system]
readconfig=@SYSCONFDIR@/cpu-models-x86_64.cfg
Stanza by default. If libvirt wants to reuse this, they can use -readconfig if
they use -nodefconfig.
Regards,
Anthony Liguori
>
>> We still have the backwards compatibility problem for pc-1.0, pc-1.1,
>> and so on. But that can be discussed later, when we actually move
>> machine-types to somewhere outside .c files.
>>
>>>
>>> As I said previously, requiring generation of opaque config files (and
>>> "copy the default config file and change it" is included on my
>>> definition of "generation of opaque config files") is poor design, IMO.
>>> I bet this even has an entry in some design anti-pattern catalog
>>> somewhere.
>>
>> This problem is also solved if the defaults are deployed on /usr/share
>> and just reused/included by the config files on /etc.
>>
>
> --
> Gleb.
next prev parent reply other threads:[~2012-03-22 16:37 UTC|newest]
Thread overview: 108+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-15 14:54 [Qemu-devel] Modern CPU models cannot be used with libvirt Jiri Denemark
2011-12-15 14:58 ` Anthony Liguori
2011-12-15 15:30 ` Jiri Denemark
2011-12-18 10:07 ` Dor Laor
2011-12-15 15:42 ` [Qemu-devel] [libvirt] " Daniel P. Berrange
2011-12-18 9:58 ` Gleb Natapov
2012-03-09 20:56 ` Eduardo Habkost
2012-03-09 21:04 ` Daniel P. Berrange
2012-03-09 21:15 ` Anthony Liguori
2012-03-10 4:37 ` Eduardo Habkost
2012-03-11 11:45 ` Gleb Natapov
2012-03-10 12:42 ` Daniel P. Berrange
2012-03-10 15:58 ` Eduardo Habkost
2012-03-10 18:24 ` Anthony Liguori
2012-03-10 18:37 ` Andreas Färber
2012-03-10 22:39 ` Doug Goldstein
2012-03-11 0:55 ` Andrew Cathrow
2012-03-11 13:27 ` Gleb Natapov
2012-03-11 14:12 ` Anthony Liguori
2012-03-11 14:56 ` Gleb Natapov
2012-03-11 15:33 ` Anthony Liguori
2012-03-11 16:16 ` Gleb Natapov
2012-03-12 14:48 ` Anthony Liguori
2012-03-12 15:16 ` Eduardo Habkost
2012-03-12 15:49 ` Andreas Färber
2012-03-12 16:50 ` Eduardo Habkost
2012-03-12 17:41 ` Andreas Färber
2012-03-12 17:47 ` Peter Maydell
2012-03-12 17:53 ` Andreas Färber
2012-03-12 17:55 ` Gleb Natapov
2012-03-12 17:59 ` Alexander Graf
2012-03-12 17:52 ` Gleb Natapov
2012-03-12 18:30 ` Eduardo Habkost
2012-03-12 18:42 ` Anthony Liguori
2012-03-12 18:53 ` Itamar Heim
2012-03-12 19:01 ` Anthony Liguori
2012-03-12 19:12 ` Itamar Heim
2012-03-12 19:50 ` Anthony Liguori
2012-03-12 20:00 ` Itamar Heim
2012-03-12 20:19 ` Ayal Baron
2012-03-13 8:32 ` Itamar Heim
2012-03-14 0:11 ` Ayal Baron
2012-03-12 12:52 ` Eduardo Habkost
2012-03-12 13:04 ` Daniel P. Berrange
2012-03-12 13:15 ` Gleb Natapov
2012-03-12 13:32 ` Eduardo Habkost
2012-03-12 13:34 ` Gleb Natapov
2012-03-12 13:50 ` Daniel P. Berrange
2012-03-12 13:53 ` Gleb Natapov
2012-03-12 13:55 ` Daniel P. Berrange
2012-03-12 14:01 ` Gleb Natapov
2012-03-25 13:21 ` Avi Kivity
2012-03-25 13:26 ` Anthony Liguori
2012-03-25 16:06 ` Avi Kivity
2012-03-11 12:41 ` Gleb Natapov
2012-03-11 14:16 ` Anthony Liguori
2012-03-11 15:12 ` Gleb Natapov
2012-03-11 15:41 ` Anthony Liguori
2012-03-11 16:27 ` Gleb Natapov
2012-03-12 13:08 ` Eduardo Habkost
2012-03-13 14:53 ` Eduardo Habkost
2012-03-22 9:32 ` Gleb Natapov
2012-03-22 13:31 ` Eduardo Habkost
2012-03-22 14:30 ` Gleb Natapov
2012-03-22 15:50 ` Eduardo Habkost
2012-03-25 10:19 ` Gleb Natapov
2012-03-25 13:09 ` Anthony Liguori
2012-03-25 14:46 ` Gleb Natapov
2012-03-25 15:06 ` Anthony Liguori
2012-03-25 16:34 ` Gleb Natapov
2012-03-26 16:00 ` Eduardo Habkost
2012-03-22 16:37 ` Anthony Liguori [this message]
2012-03-22 17:14 ` Eduardo Habkost
2012-03-22 20:01 ` Anthony Liguori
2012-03-25 9:49 ` Gleb Natapov
2012-03-25 12:55 ` Anthony Liguori
2012-03-25 13:08 ` Avi Kivity
2012-03-25 13:12 ` Anthony Liguori
2012-03-25 13:14 ` Avi Kivity
2012-03-25 13:22 ` Anthony Liguori
2012-03-25 13:34 ` Avi Kivity
2012-03-25 14:36 ` Anthony Liguori
2012-03-25 14:46 ` Avi Kivity
2012-03-25 14:59 ` Anthony Liguori
2012-03-25 15:16 ` Avi Kivity
2012-03-25 15:26 ` Anthony Liguori
2012-03-25 15:40 ` Avi Kivity
2012-03-25 18:11 ` Anthony Liguori
2012-03-26 9:08 ` Avi Kivity
2012-03-26 9:53 ` Gleb Natapov
2012-03-26 19:03 ` Anthony Liguori
2012-03-28 9:55 ` Avi Kivity
2012-03-26 16:34 ` Eduardo Habkost
2012-03-26 11:24 ` Jiri Denemark
2012-03-26 11:59 ` Avi Kivity
2012-03-26 12:03 ` Gleb Natapov
2012-03-26 16:14 ` Eduardo Habkost
2012-03-26 19:04 ` Anthony Liguori
2012-03-25 14:58 ` Gleb Natapov
2012-03-25 15:07 ` Anthony Liguori
2012-03-25 15:18 ` Avi Kivity
2012-03-25 15:30 ` Anthony Liguori
2012-03-25 15:45 ` Avi Kivity
2012-03-25 18:01 ` Anthony Liguori
2012-03-25 18:09 ` Avi Kivity
2012-03-26 19:00 ` Anthony Liguori
2012-03-28 9:59 ` Avi Kivity
2012-03-20 18:59 ` Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F6B5553.20601@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=avi@redhat.com \
--cc=ehabkost@redhat.com \
--cc=gleb@redhat.com \
--cc=jdenemar@redhat.com \
--cc=libvir-list@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).