qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] machine opts framework


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 2/2] machine opts framework
Date: Wed, 24 Mar 2010 16:11:32 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 03/24/2010 03:58 PM, Glauber Costa wrote:
On Wed, Mar 24, 2010 at 02:43:35PM -0500, Anthony Liguori wrote:
On 03/24/2010 02:26 PM, Glauber Costa wrote:
This patch adds initial support for the -machine option, that allows
command line specification of machine attributes (always relying on safe
defaults). Besides its value per-se, it is the saner way we found to
allow for enabling/disabling of kvm's in-kernel irqchip.

A machine with in-kernel-irqchip could be specified as:
        -machine irqchip=apic-kvm
And one without it:
        -machine irqchip=apic

To demonstrate how it'd work, this patch introduces a choice between
"pic" and "apic", pic being the old-style isa thing.
I started from a different place.  See machine-qemuopts in my staging tree.

I think we should combine efforts.

Regards,

Absolutely. I see little overlap between what we did. Just a comment on yours:

-static void an5206_init(ram_addr_t ram_size,
-                     const char *boot_device,
-                     const char *kernel_filename, const char *kernel_cmdline,
-                     const char *initrd_filename, const char *cpu_model)
+static void an5206_init(QemuOpts *opts)
  {

Since we're changing init functions anyway, I believe we should also pass
a pointer to the machine structure. With that, we can avoing using the global
current_machine.

Yes, I had the same thought. For instance, with isa-pc is just pc_init with an extra parameter. If we had a structure like:

typedef struct QEMUPCMachine
{
   QEMUMachine parent;
   int pci_enabled;
} QEMUPCMachine;

Then you wouldn't need those dispatch functions. Not a huge win for x86 but for sparc and some arm boards, it's pretty significant.

Regards,

Anthony Liguori




reply via email to

[Prev in Thread] Current Thread [Next in Thread]