From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuXrj-0000K6-7k for qemu-devel@nongnu.org; Wed, 24 Mar 2010 17:11:51 -0400 Received: from [140.186.70.92] (port=56554 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuXrg-0000Jh-Hd for qemu-devel@nongnu.org; Wed, 24 Mar 2010 17:11:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuXrZ-0004Fl-LE for qemu-devel@nongnu.org; Wed, 24 Mar 2010 17:11:43 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:45342) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuXrZ-0004Fg-GD for qemu-devel@nongnu.org; Wed, 24 Mar 2010 17:11:41 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e32.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o2OL526Q016704 for ; Wed, 24 Mar 2010 15:05:02 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o2OLBYp1076384 for ; Wed, 24 Mar 2010 15:11:36 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o2OEBX52027047 for ; Wed, 24 Mar 2010 08:11:33 -0600 Message-ID: <4BAA8004.309@linux.vnet.ibm.com> Date: Wed, 24 Mar 2010 16:11:32 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/2] machine opts framework References: <1269458782-6123-1-git-send-email-glommer@redhat.com> <1269458782-6123-2-git-send-email-glommer@redhat.com> <1269458782-6123-3-git-send-email-glommer@redhat.com> <4BAA6B67.6050904@codemonkey.ws> <20100324205855.GB11840@mothafucka.localdomain> In-Reply-To: <20100324205855.GB11840@mothafucka.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber Costa Cc: Anthony Liguori , qemu-devel@nongnu.org, avi@redhat.com 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