diff mbox

[1/2] KVM test: Add a new (optional) extra param to VM, cdrom_extra

Message ID 1263782202-8086-1-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues Jan. 18, 2010, 2:36 a.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index ed6d5ad..483204c 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -268,7 +268,15 @@  class VM:
         iso = params.get("cdrom")
         if iso:
             iso = kvm_utils.get_path(root_dir, iso)
-            qemu_cmd += " -cdrom %s" % iso
+            qemu_cmd += " -drive file=%s,index=2,media=cdrom" % iso
+
+        # Even though this is not a really scalable approach,
+        # it doesn't seem like we are going to need more than
+        # 2 CDs active on the same VM.
+        iso_extra = params.get("cdrom_extra")
+        if iso_extra:
+            iso_extra = kvm_utils.get_path(root_dir, iso_extra)
+            qemu_cmd += " -drive file=%s,index=3,media=cdrom" % iso_extra
 
         # We may want to add {floppy_otps} parameter for -fda
         # {fat:floppy:}/path/. However vvfat is not usually recommended