On 08/29/2012 04:12 AM, [email protected] wrote:
From: Xiaoqing Wei <[email protected]>

As the win guest driver is getting more huge, the virtio-win.vfd is now 
increased to 2.88M.
Let's increase vfd in autotest to 2.88M too.
Changelog From V1:
Now setting 1.44M for Linux guest, as the answer file is small and
legacy systems like RHEL.3 cant work with a 2.88M floppy.

Ok, code looks good, applied to next. Let's see what the next jobs tomorrow will tell us... thanks!


Signed-off-by: Xiaoqing Wei <[email protected]>
---
  client/tools/virt_disk.py               |    2 +-
  client/virt/base.cfg.sample             |    4 ++++
  client/virt/guest-os.cfg.sample         |    1 +
  client/virt/tests/unattended_install.py |   10 +++++-----
  client/virt/utils_disk.py               |    7 ++++---
  5 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/client/tools/virt_disk.py b/client/tools/virt_disk.py
index b95c918..5d0c9a5 100755
--- a/client/tools/virt_disk.py
+++ b/client/tools/virt_disk.py
@@ -75,7 +75,7 @@ class App:
          if self.options.floppy:
              self.disk = utils_disk.FloppyDisk(self.image,
                                                     self.options.qemu_img,
-                                                   self.options.temp)
+                                                   self.options.temp, 
self.vfd_size)
          elif self.options.cdrom:
              self.disk = utils_disk.CdromDisk(self.image,
                                                    self.options.temp)
diff --git a/client/virt/base.cfg.sample b/client/virt/base.cfg.sample
index 898ee00..6377981 100644
--- a/client/virt/base.cfg.sample
+++ b/client/virt/base.cfg.sample
@@ -363,3 +363,7 @@ image_clone_commnad = 'cp --reflink=auto %s %s'
  image_remove_commnad = 'rm -rf %s'

  indirect_image_blacklist = "/dev/hda.* /dev/sda.* /dev/sg0 /dev/md0"
+
+# Floppy size when unattended installing guests
+# 1.44MB for Linux, but 2.88MB for Windows guest, same as the virtio-win.vfd
+vfd_size = 1440k
diff --git a/client/virt/guest-os.cfg.sample b/client/virt/guest-os.cfg.sample
index ad75b72..5336008 100644
--- a/client/virt/guest-os.cfg.sample
+++ b/client/virt/guest-os.cfg.sample
@@ -1473,6 +1473,7 @@ variants:

      # Windows section
      - @Windows:
+        vfd_size = 2880k
          os_type = windows
          use_libvirt_cdrom_switch = yes
          shutdown_command = shutdown /s /f /t 0
diff --git a/client/virt/tests/unattended_install.py 
b/client/virt/tests/unattended_install.py
index 04cb757..7007656 100644
--- a/client/virt/tests/unattended_install.py
+++ b/client/virt/tests/unattended_install.py
@@ -125,7 +125,7 @@ class UnattendedInstallConfig(object):
                        'nfs_server', 'nfs_dir', 'install_virtio',
                        'floppy_name', 'cdrom_unattended', 'boot_path',
                        'kernel_params', 'extra_params', 'qemu_img_binary',
-                      'cdkey', 'finish_program', 'vm_type', 'process_check']
+                      'cdkey', 'finish_program', 'vm_type', 'process_check', 
'vfd_size']

          for a in attributes:
              setattr(self, a, params.get(a, ''))
@@ -443,7 +443,7 @@ class UnattendedInstallConfig(object):
              setup_file = 'winnt.bat'
              boot_disk = utils_disk.FloppyDisk(self.floppy,
                                                     self.qemu_img_binary,
-                                                   self.tmpdir)
+                                                   self.tmpdir, self.vfd_size)
              answer_path = boot_disk.get_answer_file_path(dest_fname)
              self.answer_windows_ini(answer_path)
              setup_file_path = os.path.join(self.unattended_dir, setup_file)
@@ -523,7 +523,7 @@ class UnattendedInstallConfig(object):
              elif self.params.get('unattended_delivery_method') == 'floppy':
                  boot_disk = utils_disk.FloppyDisk(self.floppy,
                                                         self.qemu_img_binary,
-                                                       self.tmpdir)
+                                                       self.tmpdir, 
self.vfd_size)
              else:
                  raise ValueError("Neither cdrom_unattended nor floppy set "
                                   "on the config file, please verify")
@@ -540,7 +540,7 @@ class UnattendedInstallConfig(object):
                  elif self.floppy:
                      boot_disk = utils_disk.FloppyDisk(self.floppy,
                                                             
self.qemu_img_binary,
-                                                           self.tmpdir)
+                                                           self.tmpdir, 
self.vfd_size)
                  else:
                      raise ValueError("Neither cdrom_unattended nor floppy set 
"
                                       "on the config file, please verify")
@@ -552,7 +552,7 @@ class UnattendedInstallConfig(object):
                  dest_fname = "autounattend.xml"
                  boot_disk = utils_disk.FloppyDisk(self.floppy,
                                                         self.qemu_img_binary,
-                                                       self.tmpdir)
+                                                       self.tmpdir, 
self.vfd_size)
                  answer_path = boot_disk.get_answer_file_path(dest_fname)
                  self.answer_windows_xml(answer_path)

diff --git a/client/virt/utils_disk.py b/client/virt/utils_disk.py
index 6a573c5..bc9ae25 100644
--- a/client/virt/utils_disk.py
+++ b/client/virt/utils_disk.py
@@ -77,22 +77,23 @@ class Disk(object):

  class FloppyDisk(Disk):
      """
-    Represents a 1.44 MB floppy disk. We can copy files to it, and setup it in
+    Represents a floppy disk. We can copy files to it, and setup it in
      convenient ways.
      """
      @error.context_aware
-    def __init__(self, path, qemu_img_binary, tmpdir):
+    def __init__(self, path, qemu_img_binary, tmpdir, vfd_size):
          error.context("Creating unattended install floppy image %s" % path)
          self.tmpdir = tmpdir
          self.mount = tempfile.mkdtemp(prefix='floppy_', dir=self.tmpdir)
          self.virtio_mount = None
          self.path = path
+        self.vfd_size = vfd_size
          clean_old_image(path)
          if not os.path.isdir(os.path.dirname(path)):
              os.makedirs(os.path.dirname(path))

          try:
-            c_cmd = '%s create -f raw %s 1440k' % (qemu_img_binary, path)
+            c_cmd = '%s create -f raw %s %s' % (qemu_img_binary, path, 
self.vfd_size)
              utils.run(c_cmd, verbose=DEBUG)
              f_cmd = 'mkfs.msdos -s 1 %s' % path
              utils.run(f_cmd, verbose=DEBUG)


_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to