All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Avi Kivity <avi@redhat.com>
Cc: libvir-list@redhat.com, Jiri Denemark <jdenemar@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Gleb Natapov <gleb@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [libvirt] Modern CPU models cannot be used with libvirt
Date: Sun, 25 Mar 2012 13:11:04 -0500	[thread overview]
Message-ID: <4F6F5FB8.2040505@codemonkey.ws> (raw)
In-Reply-To: <4F6F3C5D.7040802@redhat.com>

On 03/25/2012 10:40 AM, Avi Kivity wrote:
> On 03/25/2012 05:26 PM, Anthony Liguori wrote:
>>> Put the emphasis around *configuration*.
>>
>>
>> So how about:
>>
>> 1) Load ['@SYSCONFDIR@/qemu/qemu.cfg',
>> '@SYSCONFDIR@/qemu/target-@ARCH@.cfg',
>>           '@DATADIR@/system.cfg', '@DATADIR@/system-@ARCH@.cfg']
>>
>> 2) system-@ARCH@.cfg will contain:
>>
>> [system]
>> readconfig=@DATADIR@/target-@ARCH@-cpus.cfg
>> readconfig=@DATADIR@/target-@ARCH@-machine.cfg
>>
>> 3) -nodefconfig will not load any configuration files from DATADIR or
>> SYSCONFDIR.  -no-user-config will not load any configuration files
>> from SYSCONFDIR.
>
> What, more options?

Okay, we can just drop -no-user-config and then if a management tool wants to do 
the equivalent, they can do -nodefconfig + '-readconfig 
@DATADIR@/system-@ARCH@.cfg'.  I'm equally happy with that :-)

> I don't think -nodefconfig (as defined) is usable, since there is no way
> for the user to tell what it means short of reading those files.

*if the user doesn't know specifics about this QEMU version.

You make the assumption that all users are going to throw arbitrary options at 
arbitrary QEMU versions.  That's certainly an important use-case but it's not 
the only one.

> -no-user-config is usable, I think it needs also to mean that qemu
> without -M/-cpu/-m options will error out?

You're confusing -nodefaults (or something stronger than -nodefaults) with 
-no-user-config.

Yes, the distinctions are confusing.  It's not all fixable tomorrow.  If we take 
my config refactoring series, we can get 90% of the way there soon but Paolo has 
a more thorough refactoring..

>>> "#define westmere blah" is not configuration, otherwise the meaning of
>>> configuration will drift over time.
>>>
>>> -cpu blah is, of course.
>>
>> It's the same mechanism, but the above would create two classes of
>> default configuration files and then it becomes a question of how
>> they're used.
>
> Confused.

We don't have a formal concept of -read-definition-config and 
-read-configuration-config

There's no easy or obvious way to create such a concept either nor do I think 
the distinction is meaningful to users.

>>>>> The file defines westmere as an alias for a grab bag of options.
>>>>> Whether it's loaded or not is immaterial, unless someone uses one
>>>>> of the
>>>>> names within.
>>>>
>>>> But you would agree, a management tool should be able to control
>>>> whether class factories get loaded, right?
>>>
>>> No, why?  But perhaps I don't entirely get what you mean by "class
>>> factories".
>>>
>>> Aren't they just implementations of
>>>
>>>      virtual Device *new_instance(...) = 0?
>>>
>>> if so, why not load them?
>>
>> No, a class factory creates a new type of class.  -cpudef will
>> ultimately call type_register() to create a new QOM visible type.
>>  From a management tools perspective, the type is no different than a
>> built-in type.
>
> Exactly.  The types are no different, so there's no reason to
> discriminate against types that happen to live in qemu-provided data
> files vs. qemu code.  They aren't instantiated, so we lose nothing by
> creating the factories (just so long as the factories aren't
> mass-producing objects).

At some point, I'd like to have type modules that are shared objects.  I'd like 
QEMU to start with almost no builtin types and allow the user to configure which 
modules get loaded.

In the long term, I'd like QEMU to be a small, robust core with the vast 
majority of code relegated to modules with the user ultimately in control of 
module loading.

Yes, I'd want some module autoloading system but there should always be a way to 
launch QEMU without loading any modules and then load a very specific set of 
modules (as defined by the user).

You can imagine this being useful for something like Common Criteria certifications.

>>>>> Otherwise, the meaning of -nodefconfig changes as more stuff is moved
>>>>> out of .c and into .cfg.
>>>>
>>>> What's the problem with this?
>>>
>>> The command line becomes unstable if you use -nodefconfig.
>>
>> -no-user-config solves this but I fully expect libvirt would continue
>> to use -nodefconfig.
>
>
> I don't see how libvirt can use -nodefconfig with the fluid meaning you
> attach to it, or what it gains from it.
>
>>>
>>> -nodefconfig = create an empty machine, don't assume anything (=don't
>>> read qemu.cfg) let me build it out of all those lego bricks.  Those can
>>> be defined in code or in definition files in /usr/share, I don't care.
>>>
>>> Maybe that's -nodevices -vga none.  But in this case I don't see the
>>> point in -nodefconfig.  Not loading target_x86-64.cfg doesn't buy the
>>> user anything, since it wouldn't affect the guest in any way.
>>
>>
>> -nodefconfig doesn't mean what you think it means.  -nodefconfig
>> doesn't say anything about the user visible machine.
>>
>> -nodefconfig tells QEMU not to read any configuration files at start
>> up.  This has an undefined affect on the user visible machine that
>> depends on the specific version of QEMU.
>
> Then it's broken.  How can anyone use something that has an undefined
> effect?

It's obviously defined for a given release, just not defined long term.

> If I see something like -nodefconfig, I assume it will create a bare
> bones guest that will not depend on any qemu defaults and will be stable
> across releases.

That's not even close to what -nodefconfig is.  That's pretty much what 
-nodefaults is but -nodefaults has also had a fluid definition historically.

Regards,

Anthony Liguori

> I don't think anyone will understand -nodefconfig to
> be something version dependent without reading the qemu management tool
> author's guide.
>

  reply	other threads:[~2012-03-25 18:11 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
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 [this message]
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=4F6F5FB8.2040505@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.