public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [KVM-AUTOTEST PATCH 1/9] KVM test: kvm_vm.py: make -drive index optional for both images and cdrom ISOs
@ 2010-07-15 15:57 Michael Goldish
  2010-07-15 15:57 ` [KVM-AUTOTEST PATCH 2/9] KVM test: allow definition of multiple cdroms Michael Goldish
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Goldish @ 2010-07-15 15:57 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_vm.py |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 6cd0688..248aeca 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -214,16 +214,18 @@ class VM:
         def add_smp(help, smp):
             return " -smp %s" % smp
 
-        def add_cdrom(help, filename, index=2):
+        def add_cdrom(help, filename, index=None):
             if has_option(help, "drive"):
-                return " -drive file='%s',index=%d,media=cdrom" % (filename,
-                                                                   index)
+                cmd = " -drive file='%s',media=cdrom" % filename
+                if index is not None: cmd += ",index=%s" % index
+                return cmd
             else:
                 return " -cdrom '%s'" % filename
 
-        def add_drive(help, filename, format=None, cache=None, werror=None,
-                      serial=None, snapshot=False, boot=False):
+        def add_drive(help, filename, index=None, format=None, cache=None,
+                      werror=None, serial=None, snapshot=False, boot=False):
             cmd = " -drive file='%s'" % filename
+            if index is not None: cmd += ",index=%s" % index
             if format: cmd += ",if=%s" % format
             if cache: cmd += ",cache=%s" % cache
             if werror: cmd += ",werror=%s" % werror
@@ -362,6 +364,7 @@ class VM:
                 continue
             qemu_cmd += add_drive(help,
                                   get_image_filename(image_params, root_dir),
+                                  image_params.get("drive_index"),
                                   image_params.get("drive_format"),
                                   image_params.get("drive_cache"),
                                   image_params.get("drive_werror"),
@@ -414,7 +417,7 @@ class VM:
         iso = params.get("cdrom")
         if iso:
             iso = kvm_utils.get_path(root_dir, iso)
-            qemu_cmd += add_cdrom(help, iso)
+            qemu_cmd += add_cdrom(help, iso, 2)
 
         # Even though this is not a really scalable approach,
         # it doesn't seem like we are going to need more than
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-08-05 13:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-15 15:57 [KVM-AUTOTEST PATCH 1/9] KVM test: kvm_vm.py: make -drive index optional for both images and cdrom ISOs Michael Goldish
2010-07-15 15:57 ` [KVM-AUTOTEST PATCH 2/9] KVM test: allow definition of multiple cdroms Michael Goldish
2010-07-15 15:57   ` [KVM-AUTOTEST PATCH 3/9] KVM test: rss_file_transfer.py: add convenience functions upload() and download() Michael Goldish
2010-07-15 15:57     ` [KVM-AUTOTEST PATCH 4/9] [RFC] KVM test: DTM automation program for WHQL tests Michael Goldish
2010-07-15 15:57       ` [KVM-AUTOTEST PATCH 5/9] [RFC] KVM test: DTM machine deletion tool " Michael Goldish
2010-07-15 15:57         ` [KVM-AUTOTEST PATCH 6/9] [RFC] KVM test: add utility functions start_windows_service() and stop_windows_service() Michael Goldish
2010-07-15 15:57           ` [KVM-AUTOTEST PATCH 7/9] [RFC] KVM test: add whql_submission test Michael Goldish
2010-07-15 15:57             ` [KVM-AUTOTEST PATCH 8/9] [RFC] KVM test: add whql_client_install test Michael Goldish
2010-07-15 15:57               ` [KVM-AUTOTEST PATCH 9/9] [RFC] KVM test: add WHQL test definitions to tests_base.cfg.sample Michael Goldish
2010-08-05  0:38           ` [KVM-AUTOTEST PATCH 6/9] [RFC] KVM test: add utility functions start_windows_service() and stop_windows_service() Amos Kong
2010-08-05 13:32             ` Michael Goldish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox