diff mbox

[1/2] KVM test: Cleaning up scripts/unattended.py

Message ID 1285035924-2791-2-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues Sept. 21, 2010, 2:25 a.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/scripts/unattended.py b/client/tests/kvm/scripts/unattended.py
index a0f96e7..4c219cc 100755
--- a/client/tests/kvm/scripts/unattended.py
+++ b/client/tests/kvm/scripts/unattended.py
@@ -3,49 +3,9 @@ 
 Simple script to setup unattended installs on KVM guests.
 """
 # -*- coding: utf-8 -*-
-import os, sys, shutil, tempfile, re, ConfigParser, glob
+import os, sys, shutil, tempfile, re, ConfigParser, glob, inspect
 import common
 
-KNOWN_PACKAGE_MANAGERS = ['rpm', 'dpkg']
-
-
-def command(cmd):
-    """
-    Find a given command on the user's PATH.
-
-    @param cmd: Command you wish to find (ie, 'ls').
-    @return: Full path to the command.
-    @raise ValueError: In case the command are not found on PATH.
-    """
-    for dir in os.environ['PATH'].split(':'):
-        file = os.path.join(dir, cmd)
-        if os.path.exists(file):
-            return file
-    raise ValueError('Missing command: %s' % cmd)
-
-
-def package_that_owns(file):
-    """
-    Inquiry the main package manager which package owns file.
-
-    @param file: Path to a given file
-    """
-    support_info = {}
-    for package_manager in KNOWN_PACKAGE_MANAGERS:
-        try:
-            command(package_manager)
-            support_info[package_manager] = True
-        except:
-            support_info[package_manager] = False
-
-    if support_info['rpm']:
-        return str(os.popen('rpm -qf %s' % file).read())
-    elif support_info['dpkg']:
-        return str(os.popen('dpkg -S %s' % file).read())
-    else:
-        return ('Did not find a known package manager to inquire about '
-                'file %s' % file)
-
 
 class SetupError(Exception):
     """
@@ -71,80 +31,60 @@  class UnattendedInstall(object):
         self.deps_dir = os.path.join(kvm_test_dir, 'deps')
         self.unattended_dir = os.path.join(kvm_test_dir, 'unattended')
 
-        tftp_root = os.environ.get('KVM_TEST_tftp', '')
-        if tftp_root:
-            self.tftp_root = os.path.join(kvm_test_dir, tftp_root)
-            if not os.path.isdir(self.tftp_root):
-                os.makedirs(self.tftp_root)
-        else:
-            self.tftp_root = tftp_root
-
-        self.kernel_args = os.environ.get('KVM_TEST_kernel_args', '')
-        self.finish_program = os.environ.get('KVM_TEST_finish_program', '')
-        cdrom_iso = os.environ.get('KVM_TEST_cdrom_cd1')
-        self.unattended_file = os.environ.get('KVM_TEST_unattended_file')
-
-        install_virtio = os.environ.get('KVM_TEST_install_virtio', 'no')
-        if install_virtio == 'yes':
-            self.install_virtio = True
-        else:
-            self.install_virtio = False
-
-        virtio_floppy = os.environ.get('KVM_TEST_virtio_floppy', '')
-        self.virtio_floppy = None
-        self.virtio_floppy_mount = tempfile.mkdtemp(prefix='floppy_',
-                                                    dir='/tmp')
-        if self.install_virtio:
-            if virtio_floppy and os.path.isfile(virtio_floppy):
-                print package_that_owns(virtio_floppy)
-                self.virtio_floppy = virtio_floppy
-            elif virtio_floppy and not os.path.isfile(virtio_floppy):
-                print ('Virtio floppy path %s was not found. Please verify' %
-                       virtio_floppy)
-
-        vni = os.environ.get('KVM_TEST_virtio_network_installer', '')
-        self.virtio_network_installer = None
-        if self.install_virtio and vni:
-            self.virtio_network_installer = vni
-
-        voi = os.environ.get('KVM_TEST_virtio_oemsetup_id', '')
-        self.virtio_oemsetup_identifier = None
-        if self.install_virtio and voi:
-            self.virtio_oemsetup_identifier = voi
-
-        vsp = os.environ.get('KVM_TEST_virtio_storage_path', '')
-        self.virtio_storage_path = None
-        if self.install_virtio and vsp:
-            self.virtio_storage_path = vsp
-
-        self.qemu_img_bin = os.environ.get('KVM_TEST_qemu_img_binary')
-        if not os.path.isabs(self.qemu_img_bin):
-            self.qemu_img_bin = os.path.join(kvm_test_dir, self.qemu_img_bin)
-        self.cdrom_iso = os.path.join(kvm_test_dir, cdrom_iso)
+        attributes = ['kernel_args', 'finish_program', 'cdrom_cd1',
+                      'unattended_file', 'medium', 'url', 'kernel', 'initrd',
+                      'nfs_server', 'nfs_dir', 'pxe_dir', 'pxe_image',
+                      'pxe_initrd', 'install_virtio', 'tftp', 'qemu_img_binary',
+                      'floppy']
+        for a in attributes:
+            self._setattr(a)
+
+        if self.install_virtio == 'yes':
+            v_attributes = ['virtio_floppy', 'virtio_storage_path',
+                            'virtio_network_path', 'virtio_oemsetup_id',
+                            'virtio_network_installer']
+            for va in v_attributes:
+                self._setattr(va)
+            self.virtio_floppy_mount = tempfile.mkdtemp(prefix='virtio_floppy_',
+                                                        dir='/tmp')
+
+        if self.tftp:
+            self.tftp = os.path.join(kvm_test_dir, self.tftp)
+            if not os.path.isdir(self.tftp):
+                os.makedirs(self.tftp)
+
+        if not os.path.isabs(self.qemu_img_binary):
+            self.qemu_img_binary = os.path.join(kvm_test_dir,
+                                                self.qemu_img_binary)
+
+        self.cdrom_cd1 = os.path.join(kvm_test_dir, self.cdrom_cd1)
         self.floppy_mount = tempfile.mkdtemp(prefix='floppy_', dir='/tmp')
         self.cdrom_mount = tempfile.mkdtemp(prefix='cdrom_', dir='/tmp')
-        self.nfs_mount = tempfile.mkdtemp(prefix='nfs_', dir='/tmp')
-        floppy_name = os.environ['KVM_TEST_floppy']
-        self.floppy_img = os.path.join(kvm_test_dir, floppy_name)
-        floppy_dir = os.path.dirname(self.floppy_img)
-        if not os.path.isdir(floppy_dir):
-            os.makedirs(floppy_dir)
-
-        self.pxe_dir = os.environ.get('KVM_TEST_pxe_dir', '')
-        self.pxe_image = os.environ.get('KVM_TEST_pxe_image', '')
-        self.pxe_initrd = os.environ.get('KVM_TEST_pxe_initrd', '')
-
-        self.medium = os.environ.get('KVM_TEST_medium', '')
-        self.url = os.environ.get('KVM_TEST_url', '')
-        self.kernel = os.environ.get('KVM_TEST_kernel', '')
-        self.initrd = os.environ.get('KVM_TEST_initrd', '')
-        self.nfs_server = os.environ.get('KVM_TEST_nfs_server', '')
-        self.nfs_dir = os.environ.get('KVM_TEST_nfs_dir', '')
+        if self.medium == 'nfs':
+            self.nfs_mount = tempfile.mkdtemp(prefix='nfs_', dir='/tmp')
+
+        self.floppy = os.path.join(kvm_test_dir, self.floppy)
+        if not os.path.isdir(os.path.dirname(self.floppy)):
+            os.makedirs(os.path.dirname(self.floppy))
+
         self.image_path = kvm_test_dir
         self.kernel_path = os.path.join(self.image_path, self.kernel)
         self.initrd_path = os.path.join(self.image_path, self.initrd)
 
 
+    def _setattr(self, key):
+        """
+        Populate class attributes with contents of environment variables.
+
+        Example: KVM_TEST_medium will populate self.medium.
+
+        @param key: Name of the class attribute we desire to have.
+        """
+        env_name = 'KVM_TEST_%s' % key
+        value = os.environ.get(env_name, '')
+        setattr(self, key, value)
+
+
     def copy_virtio_drivers_floppy(self):
         """
         Copy the virtio drivers on the virtio floppy to the install floppy.
@@ -231,20 +171,20 @@  class UnattendedInstall(object):
         """
         print "Creating boot floppy"
 
-        if os.path.exists(self.floppy_img):
-            os.remove(self.floppy_img)
+        if os.path.exists(self.floppy):
+            os.remove(self.floppy)
 
-        c_cmd = '%s create -f raw %s 1440k' % (self.qemu_img_bin,
-                                               self.floppy_img)
+        c_cmd = '%s create -f raw %s 1440k' % (self.qemu_img_binary,
+                                               self.floppy)
         if os.system(c_cmd):
             raise SetupError('Could not create floppy image.')
 
-        f_cmd = 'mkfs.msdos -s 1 %s' % self.floppy_img
+        f_cmd = 'mkfs.msdos -s 1 %s' % self.floppy
         if os.system(f_cmd):
             raise SetupError('Error formatting floppy image.')
 
         try:
-            m_cmd = 'mount -o loop,rw %s %s' % (self.floppy_img,
+            m_cmd = 'mount -o loop,rw %s %s' % (self.floppy,
                                                 self.floppy_mount)
             if os.system(m_cmd):
                 raise SetupError('Could not mount floppy image.')
@@ -255,17 +195,17 @@  class UnattendedInstall(object):
                 setup_file_path = os.path.join(self.unattended_dir, setup_file)
                 setup_file_dest = os.path.join(self.floppy_mount, setup_file)
                 shutil.copyfile(setup_file_path, setup_file_dest)
-                if self.install_virtio:
+                if self.install_virtio == "yes":
                     self.setup_virtio_win2003()
 
             elif self.unattended_file.endswith('.ks'):
                 # Red Hat kickstart install
                 dest_fname = 'ks.cfg'
             elif self.unattended_file.endswith('.xml'):
-                if  self.tftp_root is '':
+                if not self.tftp:
                     # Windows unattended install
                     dest_fname = "autounattend.xml"
-                    if self.install_virtio:
+                    if self.install_virtio == "yes":
                         self.setup_virtio_win2008()
                 else:
                     # SUSE autoyast install
@@ -293,50 +233,54 @@  class UnattendedInstall(object):
             elif self.medium == "url":
                 content = "url --url %s" % self.url
             elif self.medium == "nfs":
-                content = "nfs --server=%s --dir=%s" % (self.nfs_server, self.nfs_dir)
+                content = "nfs --server=%s --dir=%s" % (self.nfs_server,
+                                                        self.nfs_dir)
             else:
                 raise SetupError("Unexpected installation medium %s" % self.url)
 
-            unattended_contents = re.sub(dummy_medium_re, content, unattended_contents)
-
-            dummy_path = "C:"
-
-            dummy_storage_re = r'\bKVM_TEST_STORAGE_DRIVER_PATH\b'
-            storage_driver = os.environ.get('KVM_TEST_virtio_storage_path', '')
-            if re.search(dummy_storage_re, unattended_contents):
-                if self.install_virtio:
-                    unattended_contents = re.sub(dummy_storage_re,
-                                                 storage_driver,
-                                                 unattended_contents)
-                else:
-                    unattended_contents = re.sub(dummy_storage_re,
-                                                 dummy_path,
-                                                 unattended_contents)
-
-            dummy_network_re = r'\bKVM_TEST_NETWORK_DRIVER_PATH\b'
-            network_driver = os.environ.get('KVM_TEST_virtio_network_path', '')
-            if re.search(dummy_network_re, unattended_contents):
-                if self.install_virtio:
-                    unattended_contents = re.sub(dummy_network_re,
-                                                 network_driver,
-                                                 unattended_contents)
-                else:
-                    unattended_contents = re.sub(dummy_network_re,
-                                                 dummy_path,
-                                                 unattended_contents)
-
-            dummy_nw_install_re = r'\bKVM_TEST_VIRTIO_NETWORK_INSTALLER\b'
-            nw_install = os.environ.get('KVM_TEST_virtio_network_installer',
-                                        'help')
-            if re.search(dummy_nw_install_re, unattended_contents):
-                if self.install_virtio:
-                    unattended_contents = re.sub(dummy_nw_install_re,
-                                                 nw_install,
-                                                 unattended_contents)
-                else:
-                    unattended_contents = re.sub(dummy_nw_install_re,
-                                                 'help',
-                                                 unattended_contents)
+            unattended_contents = re.sub(dummy_medium_re, content,
+                                         unattended_contents)
+
+            def replace_virtio_key(contents, dummy_re, env):
+                """
+                Replace a virtio dummy string with contents.
+
+                If install_virtio is not set, replace it with a dummy string.
+
+                @param contents: Contents of the unattended file
+                @param dummy_re: Regular expression used to search on the.
+                        unattended file contents.
+                @param env: Name of the environment variable.
+                """
+                dummy_path = "C:"
+                driver = os.environ.get(env, '')
+
+                if re.search(dummy_re, contents):
+                    if self.install_virtio == "yes":
+                        if driver.endswith("msi"):
+                            driver = 'msiexec /passive /package ' + driver
+                        else:
+                            try:
+                                # Let's escape windows style paths properly
+                                drive, path = driver.split(":")
+                                driver = drive + ":" + re.escape(path)
+                            except:
+                                pass
+                        contents = re.sub(dummy_re, driver, contents)
+                    else:
+                        contents = re.sub(dummy_re, dummy_path, contents)
+                return contents
+
+            vdict = {r'\bKVM_TEST_STORAGE_DRIVER_PATH\b':
+                     'KVM_TEST_virtio_storage_path',
+                     r'\bKVM_TEST_NETWORK_DRIVER_PATH\b':
+                     'KVM_TEST_virtio_network_path',
+                     r'\bKVM_TEST_VIRTIO_NETWORK_INSTALLER\b':
+                     'KVM_TEST_virtio_network_installer_path'}
+
+            for vkey in vdict:
+                unattended_contents = replace_virtio_key(unattended_contents,
+                                                         vkey, vdict[vkey])
 
             print
             print "Unattended install %s contents:" % dest_fname
@@ -356,7 +300,7 @@  class UnattendedInstall(object):
                                  self.floppy_mount)
             self.cleanup(self.floppy_mount)
 
-        os.chmod(self.floppy_img, 0755)
+        os.chmod(self.floppy, 0755)
 
         print "Boot floppy created successfuly"
 
@@ -369,7 +313,7 @@  class UnattendedInstall(object):
         initrd.img files from the CD to a directory that qemu will serve trough
         TFTP to the VM.
         """
-        print "Setting up PXE boot using TFTP root %s" % self.tftp_root
+        print "Setting up PXE boot using TFTP root %s" % self.tftp
 
         pxe_file = None
         pxe_paths = ['/usr/lib/syslinux/pxelinux.0',
@@ -384,15 +328,15 @@  class UnattendedInstall(object):
                              'sure pxelinux or equivalent package for your '
                              'distro is installed.')
 
-        pxe_dest = os.path.join(self.tftp_root, 'pxelinux.0')
+        pxe_dest = os.path.join(self.tftp, 'pxelinux.0')
         shutil.copyfile(pxe_file, pxe_dest)
 
         try:
-            m_cmd = 'mount -t iso9660 -v -o loop,ro %s %s' % (self.cdrom_iso,
+            m_cmd = 'mount -t iso9660 -v -o loop,ro %s %s' % (self.cdrom_cd1,
                                                               self.cdrom_mount)
             if os.system(m_cmd):
                 raise SetupError('Could not mount CD image %s.' %
-                                 self.cdrom_iso)
+                                 self.cdrom_cd1)
 
             pxe_dir = os.path.join(self.cdrom_mount, self.pxe_dir)
             pxe_image = os.path.join(pxe_dir, self.pxe_image)
@@ -409,8 +353,8 @@  class UnattendedInstall(object):
                                  'or a initrd.img file. Cannot find a PXE '
                                  'image to proceed.' % self.pxe_dir)
 
-            tftp_image = os.path.join(self.tftp_root, 'vmlinuz')
-            tftp_initrd = os.path.join(self.tftp_root, 'initrd.img')
+            tftp_image = os.path.join(self.tftp, 'vmlinuz')
+            tftp_initrd = os.path.join(self.tftp, 'initrd.img')
             shutil.copyfile(pxe_image, tftp_image)
             shutil.copyfile(pxe_initrd, tftp_initrd)
 
@@ -421,7 +365,7 @@  class UnattendedInstall(object):
                                  self.cdrom_mount)
             self.cleanup(self.cdrom_mount)
 
-        pxe_config_dir = os.path.join(self.tftp_root, 'pxelinux.cfg')
+        pxe_config_dir = os.path.join(self.tftp, 'pxelinux.cfg')
         if not os.path.isdir(pxe_config_dir):
             os.makedirs(pxe_config_dir)
         pxe_config_path = os.path.join(pxe_config_dir, 'default')
@@ -461,13 +405,15 @@  class UnattendedInstall(object):
 
         print "Downloading finish"
 
+
     def setup_nfs(self):
         """
         Copy the vmlinuz and initrd.img from nfs.
         """
         print "Copying the vmlinuz and initrd.img from nfs"
 
-        m_cmd = "mount %s:%s %s -o ro" % (self.nfs_server, self.nfs_dir, self.nfs_mount)
+        m_cmd = "mount %s:%s %s -o ro" % (self.nfs_server, self.nfs_dir,
+                                          self.nfs_mount)
         if os.system(m_cmd):
             raise SetupError('Could not mount nfs server.')
 
@@ -491,6 +437,7 @@  class UnattendedInstall(object):
                 raise SetupError("Could not unmont nfs at %s" % self.nfs_mount)
             self.cleanup(self.nfs_mount)
 
+
     def cleanup(self, mount):
         """
         Clean up a previously used mountpoint.
@@ -507,31 +454,20 @@  class UnattendedInstall(object):
 
     def setup(self):
         print "Starting unattended install setup"
+        print
 
         print "Variables set:"
-        print "    medium: " + str(self.medium)
-        print "    qemu_img_bin: " + str(self.qemu_img_bin)
-        print "    cdrom iso: " + str(self.cdrom_iso)
-        print "    unattended_file: " + str(self.unattended_file)
-        print "    kernel_args: " + str(self.kernel_args)
-        print "    tftp_root: " + str(self.tftp_root)
-        print "    floppy_mount: " + str(self.floppy_mount)
-        print "    floppy_img: " + str(self.floppy_img)
-        print "    finish_program: " + str(self.finish_program)
-        print "    pxe_dir: " + str(self.pxe_dir)
-        print "    pxe_image: " + str(self.pxe_image)
-        print "    pxe_initrd: " + str(self.pxe_initrd)
-        print "    url: " + str(self.url)
-        print "    kernel: " + str(self.kernel)
-        print "    initrd: " + str(self.initrd)
-        print "    nfs_server: " + str(self.nfs_server)
-        print "    nfs_dir: " + str(self.nfs_dir)
-        print "    nfs_mount: " + str(self.nfs_mount)
-
-        if self.unattended_file and self.floppy_img is not None:
+        for member in inspect.getmembers(self):
+            name, value = member
+            attribute = getattr(self, name)
+            if not (name.startswith("__") or callable(attribute) or not value):
+                print "    %s: %s" % (name, value)
+        print
+
+        if self.unattended_file and self.floppy is not None:
             self.create_boot_floppy()
         if self.medium == "cdrom":
-            if self.tftp_root:
+            if self.tftp:
                 self.setup_pxe_boot()
         elif self.medium == "url":
             self.setup_url()
@@ -539,7 +475,7 @@  class UnattendedInstall(object):
             self.setup_nfs()
         else:
             raise SetupError("Unexpected installation method %s" %
-                                   self.medium)
+                             self.medium)
         print "Unattended install setup finished successfuly"
 
 
diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample
index bef0f1c..3e8803e 100644
--- a/client/tests/kvm/tests_base.cfg.sample
+++ b/client/tests/kvm/tests_base.cfg.sample
@@ -1216,8 +1216,6 @@  variants:
             #cdrom_virtiocd = windows/virtio-win.iso
             #drive_index_virtiocd = 3
             #virtio_floppy = /usr/share/virtio-win/virtio-drivers.vfd
-            # Some flavors of the virtio drivers have an msi installer
-            #virtio_network_installer = ' msiexec /passive /package  F:\RHEV-Network64.msi'
         migrate:
             migration_test_command = ver && vol
             migration_bg_command = start ping -t localhost
@@ -1313,8 +1311,12 @@  variants:
                             md5sum_1m = b473bf75af2d1269fec8958cf0202bfd
                             unattended_file = unattended/winxp32.sif
                             floppy = images/winXP-32/floppy.img
+                            # Uncomment virtio_network_installer_path line if
+                            # you have an msi installer, also make sure the
+                            # paths are properly set in your virtio driver iso.
                             virtio_oemsetup_id = WXP32
-                            virtio_network_path = F:\\NetKVM\xp\x86
+                            virtio_network_path = 'F:\NetKVM\xp\x86'
+                            #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
                         whql_submission:
                             desc_path_desc1 = $\WDK\Logo Type\Device Logo\Windows XP
                             desc_path_desc2 = $\WDK\Logo Type\Systems Logo\Windows XP
@@ -1339,8 +1341,12 @@  variants:
                             md5sum_1m = e812363ff427effc512b7801ee70e513
                             unattended_file = unattended/winxp64.sif
                             floppy = images/winXP-64/floppy.img
+                            # Uncomment virtio_network_installer_path line if
+                            # you have an msi installer, also make sure the
+                            # paths are properly set in your virtio driver iso.
                             virtio_oemsetup_id = WNET64
-                            virtio_network_path = F:\\NetKVM\xp\\amd64
+                            virtio_network_path = 'F:\NetKVM\xp\amd64'
+                            #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
                         whql_submission:
                             desc_path_desc1 = $\WDK\Logo Type\Device Logo\Windows XP
                             desc_path_desc2 = $\WDK\Logo Type\Systems Logo\Windows XP
@@ -1370,8 +1376,12 @@  variants:
                             md5sum_1m = 37c2fdec15ac4ec16aa10fdfdb338aa3
                             unattended_file = unattended/win2003-32.sif
                             floppy = images/win2003-32/floppy.img
+                            # Uncomment virtio_network_installer_path line if
+                            # you have an msi installer, also make sure the
+                            # paths are properly set in your virtio driver iso.
                             virtio_oemsetup_id = WNET32
-                            virtio_network_path = F:\\NetKVM\2k3\x86
+                            virtio_network_path = 'F:\NetKVM\2k3\x86'
+                            #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
                         whql_submission:
                             desc_path_desc1 = $\WDK\Logo Type\Device Logo\Windows Server 2003
                             dd_data_logoarch = X86
@@ -1395,8 +1405,12 @@  variants:
                             md5sum_1m = 439393c384116aa09e08a0ad047dcea8
                             unattended_file = unattended/win2003-64.sif
                             floppy = images/win2003-64/floppy.img
+                            # Uncomment virtio_network_installer_path line if
+                            # you have an msi installer, also make sure the
+                            # paths are properly set in your virtio driver iso.
                             virtio_oemsetup_id = WNET64
-                            virtio_network_path = F:\\NetKVM\2k3\\amd64
+                            virtio_network_path = 'F:\NetKVM\2k3\amd64'
+                            #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
 
                         whql_submission:
                             desc_path_desc1 = $\WDK\Logo Type\Device Logo\Windows Server 2003
@@ -1436,8 +1450,12 @@  variants:
                                     md5sum_1m = c724e9695da483bc0fd59e426eaefc72
                                     unattended_file = unattended/winvista-32-autounattend.xml
                                     floppy = images/winvista-sp1-32/floppy.img
-                                    virtio_storage_path = F:\\viostor\w7\x86
-                                    virtio_network_path = F:\\NetKVM\w7\x86
+                                    # Uncomment virtio_network_installer_path line if
+                                    # you have an msi installer, also make sure the
+                                    # paths are properly set in your virtio driver iso.
+                                    virtio_storage_path = 'F:\viostor\w7\x86'
+                                    virtio_network_path = 'F:\NetKVM\w7\x86'
+                                    #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
 
                             - sp2:
                                 image_name += -sp2-32
@@ -1449,8 +1467,12 @@  variants:
                                     sha1sum_1m = a2afa4cffdc1c362dbf9e62942337f4f875a22cf
                                     unattended_file = unattended/winvista-32-autounattend.xml
                                     floppy = images/winvista-sp2-32/floppy.img
-                                    virtio_storage_path = F:\\viostor\w7\x86
-                                    virtio_network_path = F:\\NetKVM\w7\x86
+                                    # Uncomment virtio_network_installer_path line if
+                                    # you have an msi installer, also make sure the
+                                    # paths are properly set in your virtio driver iso.
+                                    virtio_storage_path = 'F:\viostor\w7\x86'
+                                    virtio_network_path = 'F:\NetKVM\w7\x86'
+                                    #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
 
                     - 64:
                         whql_submission:
@@ -1474,8 +1496,12 @@  variants:
                                     md5sum_1m = 0947bcd5390546139e25f25217d6f165
                                     unattended_file = unattended/winvista-64-autounattend.xml
                                     floppy = images/winvista-sp1-64/floppy.img
-                                    virtio_storage_path = F:\\viostor\w7\\amd64
-                                    virtio_network_path = F:\\NetKVM\w7\\amd64
+                                    # Uncomment virtio_network_installer_path line if
+                                    # you have an msi installer, also make sure the
+                                    # paths are properly set in your virtio driver iso.
+                                    virtio_storage_path = 'F:\viostor\w7\amd64'
+                                    virtio_network_path = 'F:\NetKVM\w7\amd64'
+                                    #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
                             - sp2:
                                 image_name += -sp2-64
                                 unattended_install.cdrom:
@@ -1486,8 +1512,12 @@  variants:
                                     sha1sum_1m = 1fd21bd3ce2a4de8856c7b8fe6fdf80260f6d1c7
                                     unattended_file = unattended/winvista-64-autounattend.xml
                                     floppy = images/winvista-sp2-64/floppy.img
-                                    virtio_storage_path = F:\\viostor\w7\\amd64
-                                    virtio_network_path = F:\\NetKVM\w7\\amd64
+                                    # Uncomment virtio_network_installer_path line if
+                                    # you have an msi installer, also make sure the
+                                    # paths are properly set in your virtio driver iso.
+                                    virtio_storage_path = 'F:\viostor\w7\amd64'
+                                    virtio_network_path = 'F:\NetKVM\w7\amd64'
+                                    #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
 
             - Win2008:
                 no whql
@@ -1514,8 +1544,12 @@  variants:
                                     md5sum_1m=07d7f5006393f74dc76e6e2e943e2440
                                     unattended_file = unattended/win2008-32-autounattend.xml
                                     floppy = images/win2008-sp1-32/floppy.img
-                                    virtio_storage_path = F:\\viostor\2k8\x86
-                                    virtio_network_path = F:\\NetKVM\2k8\x86
+                                    # Uncomment virtio_network_installer_path line if
+                                    # you have an msi installer, also make sure the
+                                    # paths are properly set in your virtio driver iso.
+                                    virtio_storage_path = 'F:\viostor\2k8\x86'
+                                    virtio_network_path = 'F:\NetKVM\2k8\x86'
+                                    #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
 
                             - sp2:
                                 image_name += -sp2-32
@@ -1527,8 +1561,12 @@  variants:
                                     sha1sum_1m = 9662ff7ed715faa00407e4befc484ea52a92a9fb
                                     unattended_file = unattended/win2008-32-autounattend.xml
                                     floppy = images/win2008-sp2-32/floppy.img
-                                    virtio_storage_path = F:\\viostor\2k8\x86
-                                    virtio_network_path = F:\\NetKVM\2k8\x86
+                                    # Uncomment virtio_network_installer_path line if
+                                    # you have an msi installer, also make sure the
+                                    # paths are properly set in your virtio driver iso.
+                                    virtio_storage_path = 'F:\viostor\2k8\x86'
+                                    virtio_network_path = 'F:\NetKVM\2k8\x86'
+                                    #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
 
                     - 64:
                         variants:
@@ -1550,8 +1588,12 @@  variants:
                                     md5sum_1m=efdcc11d485a1ef9afa739cb8e0ca766
                                     unattended_file = unattended/win2008-64-autounattend.xml
                                     floppy = images/win2008-sp1-64/floppy.img
-                                    virtio_storage_path = F:\\viostor\2k8\\amd64
-                                    virtio_network_path = F:\\NetKVM\2k8\\amd64
+                                    # Uncomment virtio_network_installer_path line if
+                                    # you have an msi installer, also make sure the
+                                    # paths are properly set in your virtio driver iso.
+                                    virtio_storage_path = 'F:\viostor\2k8\amd64'
+                                    virtio_network_path = 'F:\NetKVM\2k8\amd64'
+                                    #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
 
                             - sp2:
                                 image_name += -sp2-64
@@ -1563,8 +1605,12 @@  variants:
                                     sha1sum_1m = 8fe08b03e3531906855a60a78020ac9577dff5ba
                                     unattended_file = unattended/win2008-64-autounattend.xml
                                     floppy = images/win2008-sp2-64/floppy.img
-                                    virtio_storage_path = F:\\viostor\2k8\\amd64
-                                    virtio_network_path = F:\\NetKVM\2k8\\amd64
+                                    # Uncomment virtio_network_installer_path line if
+                                    # you have an msi installer, also make sure the
+                                    # paths are properly set in your virtio driver iso.
+                                    virtio_storage_path = 'F:\viostor\2k8\amd64'
+                                    virtio_network_path = 'F:\NetKVM\2k8\amd64'
+                                    #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
 
                             - r2:
                                 image_name += -r2-64
@@ -1576,8 +1622,12 @@  variants:
                                     sha1sum_1m = 9194a3aabae25b36e5f73cad001314b2c8d07d14
                                     unattended_file = unattended/win2008-r2-autounattend.xml
                                     floppy = images/win2008-r2-64/floppy.img
-                                    virtio_storage_path = F:\\viostor\2k8\\amd64
-                                    virtio_network_path = F:\\NetKVM\2k8\\amd64
+                                    # Uncomment virtio_network_installer_path line if
+                                    # you have an msi installer, also make sure the
+                                    # paths are properly set in your virtio driver iso.
+                                    virtio_storage_path = 'F:\viostor\2k8\amd64'
+                                    virtio_network_path = 'F:\NetKVM\2k8\amd64'
+                                    #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
 
             - Win7:
                 image_name = win7
@@ -1600,8 +1650,12 @@  variants:
                             sha1sum_1m = 9f9c3780aebeb28a9bf22188eed6bc15475dc9c5
                             unattended_file = unattended/win7-32-autounattend.xml
                             floppy = images/win7-32/floppy.img
-                            virtio_storage_path = F:\\viostor\w7\x86
-                            virtio_network_path = F:\\NetKVM\w7\x86
+                            # Uncomment virtio_network_installer_path line if
+                            # you have an msi installer, also make sure the
+                            # paths are properly set in your virtio driver iso.
+                            virtio_storage_path = 'F:\viostor\w7\x86'
+                            virtio_network_path = 'F:\NetKVM\w7\x86'
+                            #virtio_network_installer_path = 'F:\RHEV-Network32.msi'
                         whql_submission:
                             dd_data_logoarch = X86
                             dd_data_logoos = Windows 7
@@ -1626,8 +1680,12 @@  variants:
                             sha1sum_1m = 4a3903bd5157de54f0702e5263e0a683c5775515
                             unattended_file = unattended/win7-64-autounattend.xml
                             floppy = images/win7-64/floppy.img
-                            virtio_storage_path = F:\\viostor\w7\\amd64
-                            virtio_network_path = F:\\NetKVM\w7\\amd64
+                            # Uncomment virtio_network_installer_path line if
+                            # you have an msi installer, also make sure the
+                            # paths are properly set in your virtio driver iso.
+                            virtio_storage_path = 'F:\viostor\w7\amd64'
+                            virtio_network_path = 'F:\NetKVM\w7\amd64'
+                            #virtio_network_installer_path = 'F:\RHEV-Network64.msi'
                         whql_submission:
                             dd_data_logoarch = AMD64
                             dd_data_logoos = Windows 7