Hi Luis,
     Sorry for the long delay; I was away for most of the week.

     So what you are trying to do here is to allow the user to optionally specify the nicmodel and the diskbus in order to speed things up.  For Linux guests we have typically just changed the default as the distros gained support for virtio.  Presumably that won't happen with Windows, though, so I see the need for what you want to do here.  I have a question, and an idea to change this up.
     The question is: what do you need to do in Windows in order to get this to work?  Presumably Windows doesn't have built-in virtio drivers, so how do you convince the Windows installer to see your install disk?  I see below that you mentioned you "inject" them into the disk, can you describe that process in more detail?
     As far as the patch is concerned, I have two issues (both solvable).  The first is that I would like to see this option available to all guests, not just Windows.  That would basically mean moving your code into oz/Guest.py, plus probably putting a little glue around it.  The second thing is that I'm not sure this should be in the configuration file.  While I haven't documented this, there are really 3 sources of configuration in Oz:

1)  The configuration file - these are global environmental options that tend to affect all guests
2)  The TDL - this is the configuration about what gets put *on* the diskimage
3)  Command-line - these are per-install configuration options

Therefore, I think this would be a little more appropriate as a command-line option.  Could you look into that and see if you could do that?

I definitely appreciate the contribution, and I am certainly willing to listen to other opinions, so if you disagree with the above let me know.

Thanks,
Chris


On Mon, Nov 5, 2012 at 3:08 AM, Luis Fernandez Alvarez <luis.fernandez.alvarez@cern.ch> wrote:
The Windows VirtIO Drivers allows Microsoft Windows guests to be
installed using virtio devices. In order to  make Oz support this
case, it's proposed to modify the class Windows.py to get the
diskbus and nicmodel from the configuration file. The performance
boost installing Microsoft Windows guests is remarkable.
---
 oz/Windows.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/oz/Windows.py b/oz/Windows.py
index ddc3e7f..ee4a266 100644
--- a/oz/Windows.py
+++ b/oz/Windows.py
@@ -33,8 +33,16 @@ class Windows(oz.Guest.CDGuest):
     Shared Windows base class.
     """
     def __init__(self, tdl, config, output_disk):
-        oz.Guest.CDGuest.__init__(self, tdl, config, output_disk, "rtl8139",
-                                  "localtime", "usb", None, True, False)
+        diskbus = oz.ozutil.config_get_key(config,
+                                           'libvirt',
+                                           'diskbus',
+                                           'ide')
+        nicmodel = oz.ozutil.config_get_key(config,
+                                            'libvirt',
+                                            'nicmodel',
+                                            'rtl8139')
+        oz.Guest.CDGuest.__init__(self, tdl, config, output_disk, nicmodel,
+                                  "localtime", "usb", diskbus, True, False)

         if self.tdl.key is None:
             raise oz.OzException.OzException("A key is required when installing Windows")
--
1.7.1