From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0xKX-0005Ay-EO for qemu-devel@nongnu.org; Fri, 24 Feb 2012 10:45:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0xKR-0006mN-HS for qemu-devel@nongnu.org; Fri, 24 Feb 2012 10:45:09 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:53247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0xKR-0006l8-Dz for qemu-devel@nongnu.org; Fri, 24 Feb 2012 10:45:03 -0500 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2012 10:45:01 -0500 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id E3FE238C806B for ; Fri, 24 Feb 2012 10:44:58 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q1OFiwRQ3690734 for ; Fri, 24 Feb 2012 10:44:58 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q1OFiv29009945 for ; Fri, 24 Feb 2012 10:44:57 -0500 Message-ID: <4F47B078.9070509@us.ibm.com> Date: Fri, 24 Feb 2012 09:44:56 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1330092792-22455-1-git-send-email-lcapitulino@redhat.com> <4F47A5AF.5070707@us.ibm.com> <20120224132034.5573c4fc@doriath.home> In-Reply-To: <20120224132034.5573c4fc@doriath.home> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/5]: Improve machine type functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Peter Maydell , qemu-devel@nongnu.org, =?ISO-8859-1?Q?Andreas_F=E4rber?= On 02/24/2012 09:20 AM, Luiz Capitulino wrote: > On Fri, 24 Feb 2012 08:58:55 -0600 > Anthony Liguori wrote: > >> On 02/24/2012 08:13 AM, Luiz Capitulino wrote: >>> I was reading some related code yesterday and couldn't resist improving this. >>> Not sure if this is aligned with any possible QOM work in this area, but I'm >>> posting this anyway... >> >> I'm not sure how easy this is, but the way to do this with QOM would be: > > This seems like a cool thing to work on. The two major problems (for me at least) > is testing and the possible huge amount of manual work, Heh, I wouldn't quite call it huge :-) I think you can pretty easily sed the machine init function definitions to accept a Machine parameter as the first argument. I think to introduce the types, you would need to write a quick python script that parsed the QEMUMachine declarations and then converted that into a TypeInfo + class_init function. I wouldn't bother trying to make the code conversion script perfect. I've found it's easiest to convert the easy 90% automatically and then do the remaining 10% by hand. or do you think that > most of the work can be automated? > > The problem with testing is that, we have a whole lot of machines I have no idea > what's the best way of testing the conversion work. Since the conversion shouldn't change any logic, there shouldn't be a huge test burden. What I've done in the past is just write a little script that parses the output of -M ? and then walks through and executes qemu with no arguments other than -M $name. It's a bit tedious since you have to manually close the window but it's a relatively quick way to check each machine is behaving the same as it was before. Regards, Anthony Liguori > > [...] > >> That's not to say this series isn't a good cleanup. I haven't actually reviewed >> it yet. I just wanted to illustrate the next QOM steps. > > Ok. I honestly think that this series is a small first step. Even the QTAILQ > conversion is worth it IMHO, because it clearly shows what the function is doing > in a single line. >