[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support |
Date: |
Tue, 08 Jun 2010 17:58:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Thunderbird/3.0.4 |
On 06/08/2010 05:36 PM, Paul Brook wrote:
Once you eliminate machine_register_core that knowledge has
somehow got to come from your device tree description file. Having a
single device tree that can morph into significantly different machines
seems like unnecessary complexity given this is a user-specified file.
99% of qemu users will never touch a device tree. The practical matter
is, we're going to have to provide higher level interfaces that allow a
user to significantly morph a base device tree into something different.
That's the bit I don't get. Why are we significantly morphing a base device
tree? Surely it's easier to just use a different base tree.
Because at some point the base tree will have to be written in C. Of
course you have to decide where to stop allowing customization, but
anyway it will be significantly more complex than a QemuOpts config
file. QemuOpts obviously doesn't have the flexibility to create an
entire device tree.
Want to let the user add an IDE controller? Fine, you need to provide
him with a way of writing the following logic:
for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) {
hd[i] = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);
}
pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1);
What do you do? Invent your own language (another YaST? no thanks)?
Massive refactoring of QEMU's bowels (cannot solve all the problems,
Anthony gave more examples in the email I replied to)? Keep C code
(then you're not doing anything different than what Anthony's
MachineCore is doing)?
I think there are four choices:
1) only merge the first 5-7 patches of the series, basically up to the
creation of -machine and conversion of -kernel/-initrd/-M/-m. This is
also what is needed for KVM's irqchip. Think about some other smart way
to implement default devices.
2) do not expose some things to the config files. This requires
implementing an additional QemuOpts feature for internal options, plus
the current patchset. It means that moving machine types out to config
files is not possible.
3) put some things into an implementation-dependent namespace, i.e.
__pci or __default_device or __serial. In the future it's possible to
these things in config files, just nobody has to worry about users
relying on them and can refactor to death. This is the current patchset
plus some search and replace, and is my favorite.
4) expose everything to the user, at the cost of regretting it later.
This is the current patchset.
One "smart way to implement default devices" could be an inclusion
mechanism where a machine can ask qemu to read other config files. Then
you'd have config files for the default serial/parallel/etc. This could
also be implemented on top of choices 2/3/4 though.
Paolo
- Re: [Qemu-devel] [PATCH 22/22] machine: introduce -machine-def option to define a machine via config, (continued)
[Qemu-devel] [PATCH 20/22] machine: introduce machine core and split qemu_register_machine, Anthony Liguori, 2010/06/07
[Qemu-devel] [PATCH 18/22] machine: final conversion to pure QemuOpts, Anthony Liguori, 2010/06/07
Re: [Qemu-devel] [PATCH 0/22] Refactor machine support, Paul Brook, 2010/06/07
- [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Paolo Bonzini, 2010/06/08
- Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Paul Brook, 2010/06/08
- Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Anthony Liguori, 2010/06/08
- Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Paul Brook, 2010/06/08
- Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support,
Paolo Bonzini <=
- Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Anthony Liguori, 2010/06/08
- Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Alexander Graf, 2010/06/08
- Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Anthony Liguori, 2010/06/08
Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Anthony Liguori, 2010/06/08
Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Paul Brook, 2010/06/08
Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Anthony Liguori, 2010/06/09
Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Paul Brook, 2010/06/09
Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Blue Swirl, 2010/06/09
Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Anthony Liguori, 2010/06/09
Re: [Qemu-devel] Re: [PATCH 0/22] Refactor machine support, Blue Swirl, 2010/06/09