qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/5]: Improve machine type functions


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 0/5]: Improve machine type functions
Date: Fri, 24 Feb 2012 09:44:56 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 02/24/2012 09:20 AM, Luiz Capitulino wrote:
On Fri, 24 Feb 2012 08:58:55 -0600
Anthony Liguori<address@hidden>  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.





reply via email to

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